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

41 lines
8.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="EN-US_TOPIC_0000001460882448"></a><a name="EN-US_TOPIC_0000001460882448"></a>
<h1 class="topictitle1">Statement Disk Space Control</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001460882448__p766118032917">This section describes parameters related to statement disk space control, which are used to limit the disk space usage of statements.</p>
<div class="section" id="EN-US_TOPIC_0000001460882448__section96522431611"><h4 class="sectiontitle">sql_use_spacelimit</h4><p id="EN-US_TOPIC_0000001460882448__p2686151810715"><strong id="EN-US_TOPIC_0000001460882448__b6478319194519">Parameter description</strong>: Specifies the allowed maximum space for files to be spilled to disks in a single SQL statement on a single DN. This parameter limits the space occupied by ordinary tables, temporary tables, and intermediate result sets spilled to disks. System administrators are also restricted by this parameter.</p>
<p id="EN-US_TOPIC_0000001460882448__p1518316391091"><strong id="EN-US_TOPIC_0000001460882448__b154371356124512">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001460882448__p7414164761018"><strong id="EN-US_TOPIC_0000001460882448__b1343249486">Value range</strong>: an integer ranging from -1 to INT_MAX. The unit is KB. <strong id="EN-US_TOPIC_0000001460882448__b163601014122818">1</strong> indicates no limit.</p>
<p id="EN-US_TOPIC_0000001460882448__p1073420345369"><strong id="EN-US_TOPIC_0000001460882448__b137652620113">Default value</strong>: Set <strong id="EN-US_TOPIC_0000001460882448__b18761826114">sql_use_spacelimit</strong> to 10% of the total disk space of the instance.</p>
<div class="note" id="EN-US_TOPIC_0000001460882448__note72681330123513"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001460882448__p03551937173518">For example, if <strong id="EN-US_TOPIC_0000001460882448__b42230028443343">sql_use_spacelimit</strong> is set to <strong id="EN-US_TOPIC_0000001460882448__b36731569343343">100</strong> in the statement, and the data spilled to disks on a single DN exceeds 100 KB, DWS will stop the query and display a message indicating threshold exceeded.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001460882448__screen16546133551618"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">INSERT</span><span class="w"> </span><span class="k">INTO</span><span class="w"> </span><span class="n">user1</span><span class="p">.</span><span class="n">t1</span><span class="w"> </span><span class="k">SELECT</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">user2</span><span class="p">.</span><span class="n">t1</span><span class="p">;</span>
<span class="n">ERROR</span><span class="p">:</span><span class="w"> </span><span class="n">The</span><span class="w"> </span><span class="k">space</span><span class="w"> </span><span class="n">used</span><span class="w"> </span><span class="k">on</span><span class="w"> </span><span class="n">DN</span><span class="w"> </span><span class="p">(</span><span class="mi">104</span><span class="w"> </span><span class="n">kB</span><span class="p">)</span><span class="w"> </span><span class="n">has</span><span class="w"> </span><span class="n">exceeded</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="k">sql</span><span class="w"> </span><span class="n">use</span><span class="w"> </span><span class="k">space</span><span class="w"> </span><span class="k">limit</span><span class="w"> </span><span class="p">(</span><span class="mi">100</span><span class="w"> </span><span class="n">kB</span><span class="p">).</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001460882448__p39691145171714">Handling suggestion:</p>
<ul id="EN-US_TOPIC_0000001460882448__ul21123621820"><li id="EN-US_TOPIC_0000001460882448__li17112163186">Optimize the statement to reduce the data spilled to disks.</li><li id="EN-US_TOPIC_0000001460882448__li121129611815">If the disk space is sufficient, increase the value of this parameter.</li></ul>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001460882448__s4c0c451fb0ee406d8eb0fbb9f3cd3200"><h4 class="sectiontitle">temp_file_limit</h4><p id="EN-US_TOPIC_0000001460882448__aca5571d47798431f9f9eb3883904a023"><strong id="EN-US_TOPIC_0000001460882448__b16900205113419">Parameter description</strong>: Specifies the total space for files spilled to disks in a single thread. The temporary file can be the one used by sorting or hash tables, or cursors in a session.</p>
<p id="EN-US_TOPIC_0000001460882448__ae475a85a72c24dd7ac39150abf15d31f">This is a session-level setting.</p>
<p id="EN-US_TOPIC_0000001460882448__p1366511111425"><strong id="EN-US_TOPIC_0000001460882448__b11105135712454">Type</strong>: SUSET</p>
<p id="EN-US_TOPIC_0000001460882448__ab312c5a5f6e84309823c194e88f50569"><strong id="EN-US_TOPIC_0000001460882448__b26071931482">Value range</strong>: an integer ranging from -1 to INT_MAX. The unit is KB. <strong id="EN-US_TOPIC_0000001460882448__b834146311">1</strong> indicates no limit.</p>
<p id="EN-US_TOPIC_0000001460882448__a2bed2fbcca1140909447a8a957507bd1"><strong id="EN-US_TOPIC_0000001460882448__b1498815471013">Default value</strong>: Set <strong id="EN-US_TOPIC_0000001460882448__b149885475110">temp_file_limit</strong> to 10% of the total disk space of the instance.</p>
<div class="notice" id="EN-US_TOPIC_0000001460882448__nf08c20d4c8c3407f9aa6df0b9b7f8416"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001460882448__a70d394806cb2410680db14c721d93944">This parameter does not apply to disk space occupied by temporary tablespaces used for executing SQL queries.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001460882448__section72361353101011"><h4 class="sectiontitle">bi_page_reuse_factor</h4><p id="EN-US_TOPIC_0000001460882448__p144111326121110"><strong id="EN-US_TOPIC_0000001460882448__b547143916183">Parameter description</strong>: Specifies the percentage of idle space of old pages that can be reused when page replication is used for data synchronization between primary and standby DNs in the scenario where data is inserted into row-store tables in batches.</p>
<p id="EN-US_TOPIC_0000001460882448__p1679420371218"><strong id="EN-US_TOPIC_0000001460882448__b1810416406204">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001460882448__p13368182510128"><strong id="EN-US_TOPIC_0000001460882448__b256119490207">Value range</strong>: an integer ranging from 0 to 100. The value is a percentage. Value <strong id="EN-US_TOPIC_0000001460882448__b982361183813">0</strong> indicates that the old pages are not reused and new pages are requested.</p>
<p id="EN-US_TOPIC_0000001460882448__p1740433491219"><strong id="EN-US_TOPIC_0000001460882448__b132142011375">Default value</strong>: <strong id="EN-US_TOPIC_0000001460882448__b1890624816389">70</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001460882448__note41321944131214"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001460882448__ul12271156101512"><li id="EN-US_TOPIC_0000001460882448__li12271205641517">You are not advised to set this parameter to a value less than <strong id="EN-US_TOPIC_0000001460882448__b119778113913">50</strong> (except <strong id="EN-US_TOPIC_0000001460882448__b06341953396">0</strong>). If the idle space of the reused page is small, too much old page data will be transmitted between the primary and standby DNs. As a result, the batch insertion performance deteriorates.</li><li id="EN-US_TOPIC_0000001460882448__li11027018166">You are not advised to set this parameter to a value greater than <strong id="EN-US_TOPIC_0000001460882448__b976344314399">90</strong>. If this parameter is set to a value greater than <strong id="EN-US_TOPIC_0000001460882448__b917033124120">90</strong>, idle pages will be frequently queried, but old pages cannot be reused.</li></ul>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0892.html">Resource Consumption</a></div>
</div>
</div>