Files
doc-exports/docs/dws/dev/dws_04_0482.html
Lu, Huayi ef0ada5a59 DWS DEV 20240716 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-11-02 09:07:47 +00:00

25 lines
3.0 KiB
HTML

<a name="EN-US_TOPIC_0000001629230093"></a><a name="EN-US_TOPIC_0000001629230093"></a>
<h1 class="topictitle1">Case: Adjusting the Table Storage Mode in a Medium Table</h1>
<div id="body32001227"><p id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_p6107145511444">In <span id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_text1611164011">GaussDB(DWS)</span>, 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>
<div class="section" id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_s838e537f90e345f78061c1ff0fcf16e7"><h4 class="sectiontitle">Before Optimization</h4><p id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_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_0000001629230093__en-us_topic_0000001233761701_p3672195511239"><span><img id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_image66712551233" src="figure/en-us_image_0000001188323768.jpg" height="94.79402100000001" width="492.1" title="Click to enlarge" class="imgResize"></span></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_s16c0090f3ac04156a437e0a9ba754ef5"><h4 class="sectiontitle">After Optimization</h4><p id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_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_0000001629230093__en-us_topic_0000001233761701_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_0000001629230093__en-us_topic_0000001233761701_p15241191671811"><span><img id="EN-US_TOPIC_0000001629230093__en-us_topic_0000001233761701_image3227131781810" src="figure/en-us_image_0000001233883401.png" width="492.1" height="80.419381" title="Click to enlarge" class="imgResize"></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>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>