doc-exports/docs/dws/dev/dws_04_0894.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 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-05-16 07:24:04 +00:00

42 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_0000001188642030"></a><a name="EN-US_TOPIC_0000001188642030"></a>
<h1 class="topictitle1">Statement Disk Space Control</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001188642030__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_0000001188642030__section96522431611"><h4 class="sectiontitle">sql_use_spacelimit</h4><p id="EN-US_TOPIC_0000001188642030__p2686151810715"><strong id="EN-US_TOPIC_0000001188642030__b9560242142718">Parameter description</strong>: Specifies the space size for files to be spilled to disks when a single SQL statement is executed on a single DN. The managed space includes the space occupied by ordinary tables, temporary tables, and intermediate result sets to be flushed to disks. System administrators are also restricted by this parameter.</p>
<p id="EN-US_TOPIC_0000001188642030__p1518316391091"><strong id="EN-US_TOPIC_0000001188642030__b154371356124512">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188642030__p7414164761018"><strong id="EN-US_TOPIC_0000001188642030__b1343249486">Value range</strong>: an integer ranging from -1 to INT_MAX. The unit is KB. <strong id="EN-US_TOPIC_0000001188642030__b163601014122818">1</strong> indicates no limit.</p>
<p id="EN-US_TOPIC_0000001188642030__p941544711019"><strong id="EN-US_TOPIC_0000001188642030__b15547757104613">Default value</strong>: Set <strong id="EN-US_TOPIC_0000001188642030__b165481957104617">sql_use_spacelimit</strong> to 10% of the total space of the disk where the instance is.</p>
<div class="note" id="EN-US_TOPIC_0000001188642030__note72681330123513"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188642030__p03551937173518">For example, if <strong id="EN-US_TOPIC_0000001188642030__b14601114324115">sql_use_spacelimit</strong> is set to <strong id="EN-US_TOPIC_0000001188642030__b14601184354119">100</strong> in the statement and the amount data spilled to disks on a single DN exceeds 100 KB, DWS stops the query and displays a message of threshold exceeding.</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188642030__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_0000001188642030__p39691145171714">Handling suggestion:</p>
<ul id="EN-US_TOPIC_0000001188642030__ul21123621820"><li id="EN-US_TOPIC_0000001188642030__li17112163186">Optimize the statement to reduce the data spilled to disks. </li><li id="EN-US_TOPIC_0000001188642030__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_0000001188642030__s4c0c451fb0ee406d8eb0fbb9f3cd3200"><h4 class="sectiontitle">temp_file_limit</h4><p id="EN-US_TOPIC_0000001188642030__aca5571d47798431f9f9eb3883904a023"><strong id="EN-US_TOPIC_0000001188642030__b44131440155913">Parameter description</strong>: Specifies the total space for files spilled to disks in a single thread. For example, temporary files used by sorting or hash tables, or cursors in a session.</p>
<p id="EN-US_TOPIC_0000001188642030__ae475a85a72c24dd7ac39150abf15d31f">This is a session-level setting.</p>
<p id="EN-US_TOPIC_0000001188642030__p1366511111425"><strong id="EN-US_TOPIC_0000001188642030__b11105135712454">Type</strong>: SUSET</p>
<p id="EN-US_TOPIC_0000001188642030__ab312c5a5f6e84309823c194e88f50569"><strong id="EN-US_TOPIC_0000001188642030__b26071931482">Value range</strong>: an integer ranging from -1 to INT_MAX. The unit is KB. <strong id="EN-US_TOPIC_0000001188642030__b1030525902">1</strong> indicates no limit.</p>
<p id="EN-US_TOPIC_0000001188642030__a2bed2fbcca1140909447a8a957507bd1"><strong id="EN-US_TOPIC_0000001188642030__b144021402091">Default value</strong>: Set <strong id="EN-US_TOPIC_0000001188642030__b6402407916">temp_file_limit</strong> to 10% of the total disk space of the instance.</p>
<div class="notice" id="EN-US_TOPIC_0000001188642030__nf08c20d4c8c3407f9aa6df0b9b7f8416"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001188642030__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_0000001188642030__section72361353101011"><h4 class="sectiontitle">bi_page_reuse_factor</h4><p id="EN-US_TOPIC_0000001188642030__p144111326121110"><strong id="EN-US_TOPIC_0000001188642030__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_0000001188642030__p1679420371218"><strong id="EN-US_TOPIC_0000001188642030__b1810416406204">Type</strong>: USERSET</p>
<p id="EN-US_TOPIC_0000001188642030__p13368182510128"><strong id="EN-US_TOPIC_0000001188642030__b256119490207">Value range</strong>: an integer ranging from 0 to 100. The value is a percentage. Value <strong id="EN-US_TOPIC_0000001188642030__b982361183813">0</strong> indicates that the old pages are not reused and new pages are requested.</p>
<p id="EN-US_TOPIC_0000001188642030__p1740433491219"><strong id="EN-US_TOPIC_0000001188642030__b132142011375">Default value</strong>: <strong id="EN-US_TOPIC_0000001188642030__b1890624816389">70</strong></p>
<div class="notice" id="EN-US_TOPIC_0000001188642030__note41321944131214"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001188642030__ul12271156101512"><li id="EN-US_TOPIC_0000001188642030__li12271205641517">You are not advised to set this parameter to a value less than <strong id="EN-US_TOPIC_0000001188642030__b119778113913">50</strong> (except <strong id="EN-US_TOPIC_0000001188642030__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_0000001188642030__li11027018166">You are not advised to set this parameter to a value greater than <strong id="EN-US_TOPIC_0000001188642030__b976344314399">90</strong>. If this parameter is set to a value greater than <strong id="EN-US_TOPIC_0000001188642030__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>