forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: luhuayi <luhuayi@huawei.com> Co-committed-by: luhuayi <luhuayi@huawei.com>
79 lines
19 KiB
HTML
79 lines
19 KiB
HTML
<a name="EN-US_TOPIC_0000001764650468"></a><a name="EN-US_TOPIC_0000001764650468"></a>
|
||
|
||
<h1 class="topictitle1">Automatic Cleanup</h1>
|
||
<div id="body8662426"><p id="EN-US_TOPIC_0000001764650468__en-us_topic_0059778244_p595074117714">The automatic cleanup process in the system automatically runs the <strong id="EN-US_TOPIC_0000001764650468__b147932253834649">VACUUM</strong> and <strong id="EN-US_TOPIC_0000001764650468__b140381129034649">ANALYZE</strong> statements to reclaim the record space marked as deleted and update statistics in the table.</p>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__section58821328135013"><h4 class="sectiontitle">autovacuum_compaction_rows_limit</h4><p id="EN-US_TOPIC_0000001764650468__p128823286506"><strong id="EN-US_TOPIC_0000001764650468__b6965183895716">Parameter description</strong>: Specifies the small CU threshold. A CU whose number of live tuples is less than the value of this parameter is considered as a small CU. This parameter is supported only by clusters of version 8.2.1.300 or later.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p16882928205019"><strong id="EN-US_TOPIC_0000001764650468__b99918371316">Type</strong>: USERSET</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p158822281507"><strong id="EN-US_TOPIC_0000001764650468__b1931018418318">Value range</strong>: an integer ranging from –1 to 5000</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1088212284501"><strong id="EN-US_TOPIC_0000001764650468__b137411678151033">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__b12633277551033">2500</strong></p>
|
||
<div class="notice" id="EN-US_TOPIC_0000001764650468__note1991417359282"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001764650468__p161046122917">If the version is earlier than 9.1.0.100, do not set this parameter. Otherwise, duplicate primary key data may occur.</p>
|
||
</div></div>
|
||
<div class="note" id="EN-US_TOPIC_0000001764650468__note17625124151616"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001764650468__ul78579131184"><li id="EN-US_TOPIC_0000001764650468__li10502822191918">If the version is earlier than 9.1.0.100, value <strong id="EN-US_TOPIC_0000001764650468__b1128121517414">–1</strong> indicates that the 0 CU switch is disabled.</li><li id="EN-US_TOPIC_0000001764650468__li1586122031819">In version 9.1.0.100, the default value of this parameter is <strong id="EN-US_TOPIC_0000001764650468__b19955031941">0</strong>.</li><li id="EN-US_TOPIC_0000001764650468__li118581413101817">In 9.1.0.200 and later versions, the default value of this parameter is <strong id="EN-US_TOPIC_0000001764650468__b132317373410">2500</strong>.</li><li id="EN-US_TOPIC_0000001764650468__li15750747162015"><strong id="EN-US_TOPIC_0000001764650468__b5504174218413">You are advised not to modify this parameter. If you need to modify this parameter, contact technical support.</strong></li></ul>
|
||
</div></div>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__section16990030134516"><h4 class="sectiontitle">autoanalyze_mode</h4><p id="EN-US_TOPIC_0000001764650468__p69270559452"><strong id="EN-US_TOPIC_0000001764650468__b133361240135712">Parameter description</strong>: Specifies the autoanalyze mode. This parameter is supported by clusters of version 8.2.0 or later.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1392735594511"><strong id="EN-US_TOPIC_0000001764650468__b12927655134511">Type</strong>: USERSET</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p992795515458"><strong id="EN-US_TOPIC_0000001764650468__b1186542899">Value range</strong>: enumerated values</p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul136545413471"><li id="EN-US_TOPIC_0000001764650468__li22816556478"><strong id="EN-US_TOPIC_0000001764650468__b1548317538573">normal</strong> indicates common autoanalyze.</li><li id="EN-US_TOPIC_0000001764650468__li1828117559477"><strong id="EN-US_TOPIC_0000001764650468__b135001958195713">light</strong> indicates lightweight autoanalyze.</li></ul>
|
||
<p id="EN-US_TOPIC_0000001764650468__p209271155164511"><strong id="EN-US_TOPIC_0000001764650468__b10953155910578">Default value</strong>:</p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul122341914154619"><li id="EN-US_TOPIC_0000001764650468__li1234121411466">If the current cluster is upgraded from an earlier version to 8.2.0, the default value is <strong id="EN-US_TOPIC_0000001764650468__b1168310512311">normal</strong> to ensure forward compatibility.</li><li id="EN-US_TOPIC_0000001764650468__li02349146466">If the cluster version 8.2.0 is newly installed, the default value is <strong id="EN-US_TOPIC_0000001764650468__b17958517173213">light</strong>.</li></ul>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__section256951212282"><h4 class="sectiontitle">analyze_stats_mode</h4><p id="EN-US_TOPIC_0000001764650468__p1356991214288"><strong id="EN-US_TOPIC_0000001764650468__b16996357113018">Parameter description</strong>: Specifies the mode for <strong id="EN-US_TOPIC_0000001764650468__b177712415319">ANALYZE</strong> to calculate statistics.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p13569201252811"><strong id="EN-US_TOPIC_0000001764650468__b68141471316">Type</strong>: USERSET</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1172112104305"><strong id="EN-US_TOPIC_0000001764650468__b13907121113312">Value range</strong>: enumerated values</p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul6721010183019"><li id="EN-US_TOPIC_0000001764650468__li07211810113018"><strong id="EN-US_TOPIC_0000001764650468__b1763181303416">memory</strong> indicates that the memory is forcibly used to calculate statistics. Multi-column statistics are not calculated.</li><li id="EN-US_TOPIC_0000001764650468__li157211510143013"><strong id="EN-US_TOPIC_0000001764650468__b898175016345">sample_table</strong> indicates that temporary sampling tables are forcibly used to calculate statistics. Temporary tables do not support this mode.</li><li id="EN-US_TOPIC_0000001764650468__li2721110103013"><strong id="EN-US_TOPIC_0000001764650468__b16266154118351">dynamic</strong> indicates that the statistics calculation mode is determined based on the size of <strong id="EN-US_TOPIC_0000001764650468__b167108173812">maintenance_work_mem</strong>. If <a href="dws_04_0893.html#EN-US_TOPIC_0000001811610373__sfbfa78b6871442cb85a84a425335ce38">maintenance_work_mem</a> can store samples, the memory mode is used. Otherwise, the temporary sampling table mode is used.</li></ul>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1672141017301"><strong id="EN-US_TOPIC_0000001764650468__b132941139324">Default value</strong>:</p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul12406172216259"><li id="EN-US_TOPIC_0000001764650468__li1440622211257">If the current cluster is upgraded from an earlier version to 8.2.0.100, the default value is <strong id="EN-US_TOPIC_0000001764650468__b1771101602014">memory</strong> to ensure forward compatibility.</li><li id="EN-US_TOPIC_0000001764650468__li104066227252">If the cluster version 8.2.0.100 is newly installed, the default value is <strong id="EN-US_TOPIC_0000001764650468__b08783013243">dynamic</strong>.</li></ul>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__section716332525610"><h4 class="sectiontitle">analyze_sample_mode</h4><p id="EN-US_TOPIC_0000001764650468__p1163325135616"><strong id="EN-US_TOPIC_0000001764650468__b9266125123210">Parameter description</strong>: Specifies the sampling model used by <strong id="EN-US_TOPIC_0000001764650468__b161151954113212">ANALYZE</strong>.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p11163112565610"><strong id="EN-US_TOPIC_0000001764650468__b10118115814323">Type</strong>: USERSET</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p51631425175614"><strong id="EN-US_TOPIC_0000001764650468__b1615211913333">Value range</strong>: an integer ranging from <strong id="EN-US_TOPIC_0000001764650468__b115281914337">0</strong> to <strong id="EN-US_TOPIC_0000001764650468__b181539191337">2</strong></p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul3443101745816"><li id="EN-US_TOPIC_0000001764650468__li8444141715816"><strong id="EN-US_TOPIC_0000001764650468__b67377252100">0</strong> indicates the default reservoir sampling.</li><li id="EN-US_TOPIC_0000001764650468__li14444131714584"><strong id="EN-US_TOPIC_0000001764650468__b5254161221114">1</strong> indicates the optimized reservoir sampling.</li><li id="EN-US_TOPIC_0000001764650468__li4444181765817"><strong id="EN-US_TOPIC_0000001764650468__b0286161731116">2</strong> indicates range sampling.</li></ul>
|
||
<p id="EN-US_TOPIC_0000001764650468__p81631825115613"><strong id="EN-US_TOPIC_0000001764650468__b982162819111">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__b1682122811110">0</strong></p>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__s502d4304994d4da5bd3cda661aab27ac"><a name="EN-US_TOPIC_0000001764650468__s502d4304994d4da5bd3cda661aab27ac"></a><a name="s502d4304994d4da5bd3cda661aab27ac"></a><h4 class="sectiontitle">autovacuum_max_workers</h4><p id="EN-US_TOPIC_0000001764650468__a02743f17d05e49e89826be06b50d977a"><strong id="EN-US_TOPIC_0000001764650468__en-us_topic_0059778244_en-us_topic_0058967612_b39331917">Parameter description</strong>: Specifies the maximum number of automatic cleanup threads running at the same time.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1923610101295"><strong id="EN-US_TOPIC_0000001764650468__b6876152016616">Type</strong>: SIGHUP</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__aed697a6422bb4d2b9772a1b00f6e618d"><strong id="EN-US_TOPIC_0000001764650468__en-us_topic_0059777487_en-us_topic_0058967566_b6696864">Value range</strong>: an integer ranging from 0 to 128. <strong id="EN-US_TOPIC_0000001764650468__b1727104773811">0</strong> indicates that <strong id="EN-US_TOPIC_0000001764650468__b1197312592212">autovacuum</strong> is disabled.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__a0055a0ef82e54f16ab80cf51d5d82146"><strong id="EN-US_TOPIC_0000001764650468__b529416482062">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__b3294124811613">6</strong></p>
|
||
<div class="note" id="EN-US_TOPIC_0000001764650468__note482310229373"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001764650468__p2598113310375">This parameter works with autovacuum. The rules for clearing system catalogs and user tables are as follows:</p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul1659843393717"><li id="EN-US_TOPIC_0000001764650468__li6598153318378">When <strong id="EN-US_TOPIC_0000001764650468__b680560752102157">autovacuum_max_workers</strong> is set to <strong id="EN-US_TOPIC_0000001764650468__b1565282846102157">0</strong>, <strong id="EN-US_TOPIC_0000001764650468__b343008323102157">autovacuum</strong> is disabled and no tables are cleared.</li><li id="EN-US_TOPIC_0000001764650468__li1059833319372">When <strong id="EN-US_TOPIC_0000001764650468__b17923132415365">autovacuum_max_workers</strong> is set to a value greater than 0 and <strong id="EN-US_TOPIC_0000001764650468__b17924142453610">autovacuum</strong> is set to <strong id="EN-US_TOPIC_0000001764650468__b38639518454">off</strong>, the system only clears the system catalogs and column-store tables with delta tables enabled (such as vacuum delta tables, vacuum cudesc tables, and delta merge).</li><li id="EN-US_TOPIC_0000001764650468__li1159823343717">When <strong id="EN-US_TOPIC_0000001764650468__b7386182284816">autovacuum_max_workers</strong> is set to a value greater than 0 and <strong id="EN-US_TOPIC_0000001764650468__b1338662219487">autovacuum</strong> is set to <strong id="EN-US_TOPIC_0000001764650468__b726074124915">on</strong>, all tables will be cleared.</li></ul>
|
||
</div></div>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__section12149133813371"><h4 class="sectiontitle">autovacuum_max_workers_hstore</h4><p id="EN-US_TOPIC_0000001764650468__p10150538193717"><strong id="EN-US_TOPIC_0000001764650468__b161518543610">Parameter description</strong>: Specifies the maximum number of concurrent automatic cleanup threads used for hstore tables in <strong id="EN-US_TOPIC_0000001764650468__b18151195418612">autovacuum_max_workers</strong>.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1815063833715"><strong id="EN-US_TOPIC_0000001764650468__b1213054110">Type</strong>: SIGHUP</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p61501838123717"><strong id="EN-US_TOPIC_0000001764650468__b475811818549">Value range</strong>: an integer ranging from 0 to 128. <strong id="EN-US_TOPIC_0000001764650468__b771073413541">0</strong> indicates that the automatic cleanup function of HStore tables is disabled.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p915014381378"><strong id="EN-US_TOPIC_0000001764650468__b32238246551033">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__b213141243151033">3</strong></p>
|
||
<div class="note" id="EN-US_TOPIC_0000001764650468__note715413610418"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001764650468__p181164934111">To use HStore tables, set the following parameters, or the HStore performance will deteriorate severely. The recommended settings are as follows:</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p81178984113"><strong id="EN-US_TOPIC_0000001764650468__b490120488814">autovacuum_max_workers_hstore=3, autovacuum_max_workers=6, autovacuum=true</strong></p>
|
||
</div></div>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__s41db964155f3432d8ebe76db75ea50cb"><h4 class="sectiontitle">autovacuum_naptime</h4><p id="EN-US_TOPIC_0000001764650468__abb4867d9d7764a5ba4ed9a2e0d1e6dc8"><strong id="EN-US_TOPIC_0000001764650468__en-us_topic_0059778244_en-us_topic_0058967612_b64864880">Parameter description</strong>: Specifies the interval between two automatic cleanup operations.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p614254619319"><strong id="EN-US_TOPIC_0000001764650468__b1565212375267">Type</strong>: SIGHUP</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__af4e85e3cf1144a2faaff468b11186d27"><strong id="EN-US_TOPIC_0000001764650468__b16644135514240">Value range</strong>: an integer ranging from 1 to 2147483. The unit is second.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__afe225e07d4f5493db2d230c4a1cf0562"><strong id="EN-US_TOPIC_0000001764650468__b842352706185119">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__en-us_topic_0059778244_b15310055141954">60s</strong></p>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__sd3082605f4ef4a4383807a078c38bc1e"><h4 class="sectiontitle">autovacuum_vacuum_cost_delay</h4><p id="EN-US_TOPIC_0000001764650468__aa9e29e9224b243758df82ae2606aab5e"><strong id="EN-US_TOPIC_0000001764650468__en-us_topic_0059778244_en-us_topic_0058967612_b39055335">Parameter description</strong>: Specifies the value of the cost delay used in the <strong id="EN-US_TOPIC_0000001764650468__b95544175227">autovacuum</strong> operation.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p62421778312"><strong id="EN-US_TOPIC_0000001764650468__b71411939152618">Type</strong>: SIGHUP</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__ac28c2d20ef894e2e9c8517e5a942abce"><strong id="EN-US_TOPIC_0000001764650468__en-us_topic_0059778244_en-us_topic_0058967612_b21083041">Value range</strong>: an integer ranging from –1 to 100. The unit is ms. <strong id="EN-US_TOPIC_0000001764650468__b185331434133917">–1</strong> indicates that the normal vacuum cost delay is used.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__af37beecf08954cfcaa966bedcf008dbd"><strong id="EN-US_TOPIC_0000001764650468__b189481635144016">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__b895053544011">2ms</strong></p>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__section9213122818617"><h4 class="sectiontitle">check_crossvw_write</h4><p id="EN-US_TOPIC_0000001764650468__p981510293620"><strong id="EN-US_TOPIC_0000001764650468__b2153133414492">Parameter description</strong>: Specifies whether to enable cross-VW write detection. This parameter is supported only by clusters of version 9.1.0.100 or later.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1981511298615"><strong id="EN-US_TOPIC_0000001764650468__b17241633121819">Type</strong>: USERSET</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p15654121112816"><strong id="EN-US_TOPIC_0000001764650468__b38151829462">Value range</strong>: an integer, -1 or 1.</p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul114413121384"><li id="EN-US_TOPIC_0000001764650468__li17444127810">The value <strong id="EN-US_TOPIC_0000001764650468__b113251843153715">–1</strong> indicates that it is compatible with the capabilities of version 9.0.3. For the v3 table vacuum, it only clears non-last files for all epochs.</li><li id="EN-US_TOPIC_0000001764650468__li34411218810">The value <strong id="EN-US_TOPIC_0000001764650468__b563253171418">1</strong> indicates checking whether it is a cross-VW write scenario. For the v3 table vacuum, if it is determined to be a non-cross-VW write scenario, it clears non-last files for all epochs, clears the last file for the current epoch, and clears the last file for epochs that are less than the current epoch. If it is determined to be a cross-VW write scenario, CNs will obtain epoch information from all DNs and package it into an epochList to be sent to the metadata VW. The v3 table vacuum will clear non-last files for all epochs and clear the last file for epochs that are less than max{epochList} and not in epochList.</li></ul>
|
||
<p id="EN-US_TOPIC_0000001764650468__p16815112911615"><strong id="EN-US_TOPIC_0000001764650468__b106771410161">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__b196761415161">1</strong></p>
|
||
</div>
|
||
<div class="section" id="EN-US_TOPIC_0000001764650468__section4328534144311"><a name="EN-US_TOPIC_0000001764650468__section4328534144311"></a><a name="section4328534144311"></a><h4 class="sectiontitle">enable_pg_stat_object</h4><p id="EN-US_TOPIC_0000001764650468__p43281234174311"><strong id="EN-US_TOPIC_0000001764650468__b14263118173012">Parameter description</strong>: Specifies whether <strong id="EN-US_TOPIC_0000001764650468__b14882957143017">AUTO VACUUM</strong> updates the <a href="dws_04_1062.html">PG_STAT_OBJECT</a> system catalog. This parameter is supported only by clusters of version 8.2.1 or later.</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1432853419434"><strong id="EN-US_TOPIC_0000001764650468__b1805986002">Type</strong>: USERSET</p>
|
||
<p id="EN-US_TOPIC_0000001764650468__p632863464317"><strong id="EN-US_TOPIC_0000001764650468__b926601601">Value range</strong>: Boolean</p>
|
||
<ul id="EN-US_TOPIC_0000001764650468__ul1924641264619"><li id="EN-US_TOPIC_0000001764650468__li1324611211462"><strong id="EN-US_TOPIC_0000001764650468__b18950014193212">on</strong> indicates that the <strong id="EN-US_TOPIC_0000001764650468__b7442182813325">PG_STAT_OBJECT</strong> system catalog is updated during <strong id="EN-US_TOPIC_0000001764650468__b619810228329">AUTO VACUUM</strong>.</li><li id="EN-US_TOPIC_0000001764650468__li132461912164620"><strong id="EN-US_TOPIC_0000001764650468__b88242032163214">off</strong> indicates that the <strong id="EN-US_TOPIC_0000001764650468__b159884546328">PG_STAT_OBJECT</strong> system catalog is not updated during <strong id="EN-US_TOPIC_0000001764650468__b1598813548326">AUTO VACUUM</strong>.</li></ul>
|
||
<p id="EN-US_TOPIC_0000001764650468__p1724691210466"><strong id="EN-US_TOPIC_0000001764650468__b339479695">Default value</strong>: <strong id="EN-US_TOPIC_0000001764650468__b260955262">on</strong></p>
|
||
</div>
|
||
</div>
|
||
<div>
|
||
<div class="familylinks">
|
||
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0883.html">GUC Parameters of the GaussDB(DWS) Database</a></div>
|
||
</div>
|
||
</div>
|
||
|