forked from docs/doc-exports
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>
45 lines
8.7 KiB
HTML
45 lines
8.7 KiB
HTML
<a name="EN-US_TOPIC_0000001098654986"></a><a name="EN-US_TOPIC_0000001098654986"></a>
|
|
|
|
<h1 class="topictitle1">Cost-based Vacuum Delay</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001098654986__en-us_topic_0059778692_p11105168622">This feature allows administrators to reduce the I/O impact of the <strong id="EN-US_TOPIC_0000001098654986__b12290129171310">VACUUM</strong> and <strong id="EN-US_TOPIC_0000001098654986__b10291129101316">ANALYZE</strong> statements on concurrent database activities. It is often more important to prevent maintenance statements, such as <strong id="EN-US_TOPIC_0000001098654986__b135261659145414">VACUUM</strong> and <strong id="EN-US_TOPIC_0000001098654986__b1752645925411">ANALYZE</strong>, from affecting other database operations than to run them quickly. Cost-based vacuum delay provides a way for administrators to achieve this purpose.</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001098654986__note11169193713198"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001098654986__p3491194881410">Certain operations hold critical locks and should be complete as quickly as possible. In <span id="EN-US_TOPIC_0000001098654986__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_0000001098654986__ul64914484143"><li id="EN-US_TOPIC_0000001098654986__li10491104871412">vacuum_cost_delay*accumulated_balance/vacuum_cost_limit</li><li id="EN-US_TOPIC_0000001098654986__li104911648181418">vacuum_cost_delay*4</li></ul>
|
|
</div></div>
|
|
<div class="section" id="EN-US_TOPIC_0000001098654986__s5f98a782f6444eb685fe269a85a69787"><h4 class="sectiontitle">Context</h4><p id="EN-US_TOPIC_0000001098654986__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>vacuum_cost_limit</strong>), the process performing the operation will sleep for a short period of time (specified by <strong>vacuum_cost_delay</strong>). Then, the counter resets and the operation continues.</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__a09f0054dddf448feae90555acf3f721a">By default, this feature is disabled. To enable this feature, set <strong>vacuum_cost_delay</strong> to a value other than 0.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001098654986__section117926911015"><h4 class="sectiontitle">vacuum_cost_delay</h4><p id="EN-US_TOPIC_0000001098654986__p25101158201012"><strong id="EN-US_TOPIC_0000001098654986__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_0000001098654986__b5549194651914">vacuum_cost_limit</strong> has been exceeded.</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p1518316391091"><strong id="EN-US_TOPIC_0000001098654986__b58404385173">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p118914174282"><strong id="EN-US_TOPIC_0000001098654986__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_0000001098654986__b122615199313">0</strong> disables cost-based vacuum delay.</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__a916b4ec249094ee583e83464e89f5dd8"><strong id="EN-US_TOPIC_0000001098654986__b186431436122917">Default value</strong>: <strong id="EN-US_TOPIC_0000001098654986__b1064483612914">0</strong></p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001098654986__note159701275179"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001098654986__ul625661216184"><li id="EN-US_TOPIC_0000001098654986__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_0000001098654986__li123131426141919">This parameter is set to a small value, such as 10 or 20 milliseconds. Adjusting vacuum's resource consumption is best done by changing other parameters.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001098654986__section1288159151015"><h4 class="sectiontitle">vacuum_cost_page_hit</h4><p id="EN-US_TOPIC_0000001098654986__p164696610159"><strong id="EN-US_TOPIC_0000001098654986__b1687885441">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_0000001098654986__p147317341201"><strong id="EN-US_TOPIC_0000001098654986__b10728899197">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p119652441520"><strong id="EN-US_TOPIC_0000001098654986__b17985191018915">Value range</strong>: an integer ranging from 0 to 10000. The unit is millisecond (ms).</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p93096307155"><strong id="EN-US_TOPIC_0000001098654986__a4c25757a8859417e8d363ca9016b506c">Default value</strong>: <strong id="EN-US_TOPIC_0000001098654986__en-us_topic_0058967566_b56157513619462">1</strong></p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001098654986__section165681910191413"><h4 class="sectiontitle">vacuum_cost_page_miss</h4><p id="EN-US_TOPIC_0000001098654986__p17962114241512"><strong id="EN-US_TOPIC_0000001098654986__b1312321336">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_0000001098654986__p62811348172011"><strong id="EN-US_TOPIC_0000001098654986__b9770161317193">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p1013685132812"><strong id="EN-US_TOPIC_0000001098654986__b1019882512917">Value range</strong>: an integer ranging from 0 to 10000. The unit is millisecond (ms).</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p996394281513"><strong id="EN-US_TOPIC_0000001098654986__en-us_topic_0059778487_a69c0ed76f7a6489cbb26a65ec66507af">Default value</strong>: <strong id="EN-US_TOPIC_0000001098654986__en-us_topic_0059778487_b842352706201318">10</strong></p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001098654986__section412883521410"><h4 class="sectiontitle">vacuum_cost_page_dirty</h4><p id="EN-US_TOPIC_0000001098654986__p460219464153"><strong id="EN-US_TOPIC_0000001098654986__b1801902395">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_0000001098654986__p435312112119"><strong id="EN-US_TOPIC_0000001098654986__b89942161919">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p164299162914"><strong id="EN-US_TOPIC_0000001098654986__b285817282920">Value range</strong>: an integer ranging from 0 to 10000. The unit is millisecond (ms).</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p8602546181516"><strong id="EN-US_TOPIC_0000001098654986__en-us_topic_0059779078_a937850c620024da6b6db471938c675a3">Default value</strong>: <strong id="EN-US_TOPIC_0000001098654986__b842352706164045">20</strong></p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001098654986__section1557591091412"><h4 class="sectiontitle">vacuum_cost_limit</h4><p id="EN-US_TOPIC_0000001098654986__p466616495158"><strong id="EN-US_TOPIC_0000001098654986__b2036305007">Parameter description:</strong> Specifies the cost limit. The cleanup process will sleep if this limit is exceeded.</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p171801117192115"><strong id="EN-US_TOPIC_0000001098654986__b18836834101918">Type</strong>: USERSET</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p1667124901516"><strong id="EN-US_TOPIC_0000001098654986__b15828744896">Value range</strong>: an integer ranging from 1 to 10000. The unit is ms.</p>
|
|
<p id="EN-US_TOPIC_0000001098654986__p1066824917150"><strong id="EN-US_TOPIC_0000001098654986__b842352706142641">Default value:</strong> <strong id="EN-US_TOPIC_0000001098654986__b842352706142642">200</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>
|
|
|