doc-exports/docs/dws/dev/dws_04_0482.html
Lu, Huayi a24ca60074 DWS DEVELOPER 811 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-01-19 13:37:49 +00:00

19 lines
2.4 KiB
HTML

<a name="EN-US_TOPIC_0000001145894667"></a><a name="EN-US_TOPIC_0000001145894667"></a>
<h1 class="topictitle1">Case: Adjusting the Table Storage Mode in a Medium Table</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001145894667__s838e537f90e345f78061c1ff0fcf16e7"><h4 class="sectiontitle">Symptom</h4><p id="EN-US_TOPIC_0000001145894667__en-us_topic_0075935265_p478203216590">In the <span id="EN-US_TOPIC_0000001145894667__text1611164011">GaussDB(DWS)</span> database, row-store tables use the row execution engine, and column-store tables use the column execution engine. If both row-store table and column-store tables exist in a SQL statement, the system will automatically select the row execution engine. The performance of a column execution engine (except for the indexscan related operators) is much better than that of a row execution engine. Therefore, a column-store table is recommended. This is important for some medium result set dumping tables, and you need to select a proper table storage type.</p>
<p id="EN-US_TOPIC_0000001145894667__a6548708a44714e51ace16df066eae97b">During the test at a site, if the following execution plan is performed, the customer expects that the performance can be improved and the result can be returned within 3s.</p>
<p id="EN-US_TOPIC_0000001145894667__p3672195511239"><span><img id="EN-US_TOPIC_0000001145894667__image66712551233" src="figure/en-us_image_0000001099135134.jpg"></span></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001145894667__s16c0090f3ac04156a437e0a9ba754ef5"><h4 class="sectiontitle">Optimization Analysis</h4><p id="EN-US_TOPIC_0000001145894667__a54b2f6d2e69e4ebea03da8a7242661cf">It is found that the row engine is used after analysis, because both the temporary plan table input_acct_id_tbl and the medium result dumping table row_unlogged_table use a row-store table.</p>
<p id="EN-US_TOPIC_0000001145894667__abdeef7671bf340c88ebfdb165f86bd4f">After the two tables are changed into column-store tables, the system performance is improved and the result is returned by 1.6s.</p>
<p id="EN-US_TOPIC_0000001145894667__p15241191671811"><span><img id="EN-US_TOPIC_0000001145894667__image3227131781810" src="figure/en-us_image_0000001145695083.png"></span></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0474.html">Optimization Cases</a></div>
</div>
</div>