doc-exports/docs/dws/dev/dws_04_0483.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

21 lines
2.9 KiB
HTML

<a name="EN-US_TOPIC_0000001145814827"></a><a name="EN-US_TOPIC_0000001145814827"></a>
<h1 class="topictitle1">Case: Adjusting the Local Clustering Column</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001145814827__s1751f6f53947493eab5ccf59855e4a2f"><h4 class="sectiontitle">Symptom</h4><p id="EN-US_TOPIC_0000001145814827__a2f98dbc526ea4d6989f72eb44e91a585">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_0000001145814827__p106961251191817"><span><img id="EN-US_TOPIC_0000001145814827__image1869375221818" src="figure/en-us_image_0000001098815218.png"></span></p>
</div>
<div class="section" id="EN-US_TOPIC_0000001145814827__s5bed2104e88a4625a4ebda5b2344a642"><h4 class="sectiontitle">Optimization Analysis</h4><p id="EN-US_TOPIC_0000001145814827__a1d41b09549404914a65e458451950a93">The analysis shows that the performance bottleneck of this plan is lfbank. f_ev_dp_kdpl_zhminx. The scan condition of this table is as follows:</p>
<p id="EN-US_TOPIC_0000001145814827__en-us_topic_0075873748_p482973511826"><span><img id="EN-US_TOPIC_0000001145814827__i1db76070bddd4d418e79716595b675f9" src="figure/en-us_image_0000001145695149.png"></span></p>
<p id="EN-US_TOPIC_0000001145814827__ae9832da4cd4c4f76a150ffa8aca0d367">Try to modify the lfbank. f_ev_dp_kdpl_zhmin table to a column-store table, and then create the PCK (local clustering) in the <strong id="EN-US_TOPIC_0000001145814827__b84235270611120">yezdminc</strong> column, and set <strong id="EN-US_TOPIC_0000001145814827__b84235270611013">PARTIAL_CLUSTER_ROWS</strong> to <strong id="EN-US_TOPIC_0000001145814827__b84235270611019">100000000</strong>. The execution plan after optimization is as follows:</p>
<p id="EN-US_TOPIC_0000001145814827__p18444153291916"><span><img id="EN-US_TOPIC_0000001145814827__image17487133381915" src="figure/en-us_image_0000001145815079.png"></span></p>
<div class="note" id="EN-US_TOPIC_0000001145814827__n77dc681d02b2457da7fe9436f7f0bf22"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001145814827__u9e869845806b4661b03a4fdcfb86d1cc"><li id="EN-US_TOPIC_0000001145814827__l89d8bc882497457989cdfd799c5fb52d">This method actually sacrifices the performance during data import to improve the query performance.</li><li id="EN-US_TOPIC_0000001145814827__l6a82c1d6bdf843ca8e3fb0879c907757">The number of local sorting tuples is increased, and you need to increase the value of <strong id="EN-US_TOPIC_0000001145814827__b84235270611618">psort_work_mem</strong> to improve the sorting efficiency.</li></ul>
</div></div>
</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>