forked from docs/doc-exports
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>
44 lines
8.6 KiB
HTML
44 lines
8.6 KiB
HTML
<a name="EN-US_TOPIC_0000001233761707"></a><a name="EN-US_TOPIC_0000001233761707"></a>
|
|
|
|
<h1 class="topictitle1">Cost-based Vacuum Delay</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001233761707__en-us_topic_0059778692_p11105168622">The purpose of cost-based vacuum delay is to allow administrators to reduce the I/O impact of <strong id="EN-US_TOPIC_0000001233761707__b64298318495">VACUUM</strong> and <strong id="EN-US_TOPIC_0000001233761707__b784818674914">ANALYZE</strong> statements on concurrently active databases. For example, when maintenance statements such as <strong id="EN-US_TOPIC_0000001233761707__b859617302496">VACUUM </strong>and <strong id="EN-US_TOPIC_0000001233761707__b122719321493">ANALYZE </strong>do not need to be executed quickly and do not interfere with other database operations, administrators can use this function to achieve this purpose.</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001233761707__note11169193713198"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001233761707__p3491194881410">Certain operations hold critical locks and should be complete as quickly as possible. In <span id="EN-US_TOPIC_0000001233761707__text1752061080">GaussDB(DWS)</span>, cost-based vacuum delays do not take effect during such operations. To avoid uselessly long delays in such cases, the actual delay is calculated as follows and is the maximum value of the following calculation results:</p>
|
|
<ul id="EN-US_TOPIC_0000001233761707__ul64914484143"><li id="EN-US_TOPIC_0000001233761707__li10491104871412">vacuum_cost_delay*accumulated_balance/vacuum_cost_limit</li><li id="EN-US_TOPIC_0000001233761707__li104911648181418">vacuum_cost_delay*4</li></ul>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0000001233761707__ada3c60518c98426285be74c8adda3d01">During the execution of the ANALYZE | ANALYSE and VACUUM statements, the system maintains an internal counter that keeps track of the estimated cost of the various I/O operations that are performed. When the accumulated cost reaches a limit (specified by <strong id="EN-US_TOPIC_0000001233761707__b198861648134616">vacuum_cost_limit</strong>), the process performing the operation will sleep for a short period of time (specified by <strong id="EN-US_TOPIC_0000001233761707__b118861248134617">vacuum_cost_delay</strong>). Then, the counter resets and the operation continues.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__a09f0054dddf448feae90555acf3f721a">By default, this feature is disabled. To enable this feature, set <strong id="EN-US_TOPIC_0000001233761707__b148881948124616">vacuum_cost_delay</strong> to a value other than 0.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001233761707__section117926911015"><h4 class="sectiontitle">vacuum_cost_delay</h4><p id="EN-US_TOPIC_0000001233761707__p25101158201012"><strong id="EN-US_TOPIC_0000001233761707__en-us_topic_0059778187_en-us_topic_0058967640_b9255475">Parameter description</strong>: Specifies the length of time that the process will sleep when <strong id="EN-US_TOPIC_0000001233761707__b5549194651914">vacuum_cost_limit</strong> has been exceeded.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p1518316391091"><strong id="EN-US_TOPIC_0000001233761707__b58404385173">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p1327124513716"><strong id="EN-US_TOPIC_0000001233761707__b106531657681">Value range</strong>: an integer ranging from 0 to 100. The unit is millisecond (ms). A positive number enables cost-based vacuum delay and <strong id="EN-US_TOPIC_0000001233761707__b122615199313">0</strong> disables cost-based vacuum delay.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__a916b4ec249094ee583e83464e89f5dd8"><strong id="EN-US_TOPIC_0000001233761707__b186431436122917">Default value</strong>: <strong id="EN-US_TOPIC_0000001233761707__b1064483612914">0</strong></p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001233761707__note159701275179"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001233761707__ul625661216184"><li id="EN-US_TOPIC_0000001233761707__li1625671215189">On many systems, the effective resolution of sleep length is 10 ms. Therefore, setting this parameter to a value that is not a multiple of 10 has the same effect as setting it to the next higher multiple of 10.</li><li id="EN-US_TOPIC_0000001233761707__li123131426141919">This parameter is set to a small value, such as 10 or 20 milliseconds.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233761707__section19750183765213"><h4 class="sectiontitle">vacuum_cost_limit</h4><p id="EN-US_TOPIC_0000001233761707__p13750537125213"><strong id="EN-US_TOPIC_0000001233761707__b1269470128">Parameter description:</strong> Specifies the cost limit. The cleanup process will sleep if this limit is exceeded.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p16751837125218"><strong id="EN-US_TOPIC_0000001233761707__b18836834101918">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p15751163755220"><strong id="EN-US_TOPIC_0000001233761707__b15828744896">Value range</strong>: an integer ranging from 1 to 10000. The unit is ms.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p8751163712528"><strong id="EN-US_TOPIC_0000001233761707__b2032180814174">Default value:</strong> <strong id="EN-US_TOPIC_0000001233761707__b12068582004174">200</strong></p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233761707__section1288159151015"><h4 class="sectiontitle">vacuum_cost_page_hit</h4><p id="EN-US_TOPIC_0000001233761707__p164696610159"><strong id="EN-US_TOPIC_0000001233761707__b594157129">Parameter description:</strong> Specifies the estimated cost for vacuuming a buffer found in the shared buffer. It represents the cost to lock the buffer pool, look up the shared Hash table, and scan the page.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p147317341201"><strong id="EN-US_TOPIC_0000001233761707__b10728899197">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p119652441520"><strong id="EN-US_TOPIC_0000001233761707__b17985191018915">Value range</strong>: an integer ranging from 0 to 10000. The unit is millisecond (ms).</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p93096307155"><strong id="EN-US_TOPIC_0000001233761707__a4c25757a8859417e8d363ca9016b506c">Default value</strong>: <strong id="EN-US_TOPIC_0000001233761707__en-us_topic_0058967566_b56157513619462">1</strong></p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233761707__section165681910191413"><h4 class="sectiontitle">vacuum_cost_page_miss</h4><p id="EN-US_TOPIC_0000001233761707__p17962114241512"><strong id="EN-US_TOPIC_0000001233761707__b341133783">Parameter description:</strong> Specifies the estimated cost for vacuuming a buffer read from the disk. It represents the cost to lock the buffer pool, look up the shared Hash table, read the desired block from the disk, and scan the block.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p62811348172011"><strong id="EN-US_TOPIC_0000001233761707__b9770161317193">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p1013685132812"><strong id="EN-US_TOPIC_0000001233761707__b1019882512917">Value range</strong>: an integer ranging from 0 to 10000. The unit is millisecond (ms).</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p996394281513"><strong id="EN-US_TOPIC_0000001233761707__en-us_topic_0059778487_a69c0ed76f7a6489cbb26a65ec66507af">Default value</strong>: <strong id="EN-US_TOPIC_0000001233761707__en-us_topic_0059778487_b842352706201318">2</strong></p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001233761707__section412883521410"><h4 class="sectiontitle">vacuum_cost_page_dirty</h4><p id="EN-US_TOPIC_0000001233761707__p460219464153"><strong id="EN-US_TOPIC_0000001233761707__b602849573">Parameter description:</strong> Specifies the estimated cost charged when vacuum modifies a block that was previously clean. It represents the I/Os required to flush the dirty block out to disk again.</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p435312112119"><strong id="EN-US_TOPIC_0000001233761707__b89942161919">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p164299162914"><strong id="EN-US_TOPIC_0000001233761707__b285817282920">Value range</strong>: an integer ranging from 0 to 10000. The unit is millisecond (ms).</p>
|
|
<p id="EN-US_TOPIC_0000001233761707__p8602546181516"><strong id="EN-US_TOPIC_0000001233761707__en-us_topic_0059779078_a937850c620024da6b6db471938c675a3">Default value</strong>: <strong id="EN-US_TOPIC_0000001233761707__b842352706164045">20</strong></p>
|
|
</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>
|
|
|