doc-exports/docs/dws/umn/dws_03_2108.html
Lu, Huayi 95132e24fc DWS UMN 830.201_new version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-27 11:54:34 +00:00

25 lines
7.1 KiB
HTML

<a name="EN-US_TOPIC_0000001510143269"></a><a name="EN-US_TOPIC_0000001510143269"></a>
<h1 class="topictitle1">Which System Catalogs That the VACUUM FULL Operation Cannot Be Performed on?</h1>
<div id="body0000001510143269"><p id="EN-US_TOPIC_0000001510143269__p96456117484"><strong id="EN-US_TOPIC_0000001510143269__b1816654315412">VACUUM FULL</strong> can be performed on all GaussDB(DWS) system catalogs. However, during the process, level 8 locks will be imposed on the system catalogs, and services involving these system catalogs will be blocked.</p>
<p id="EN-US_TOPIC_0000001510143269__p8060118">The suggestions are based on database versions:</p>
<div class="section" id="EN-US_TOPIC_0000001510143269__section141341274720"><h4 class="sectiontitle">8.1.3 and Later Versions</h4><ul id="EN-US_TOPIC_0000001510143269__ul1037223133912"><li id="EN-US_TOPIC_0000001510143269__li737211319399">For clusters of version 8.1.3 or later, <strong id="EN-US_TOPIC_0000001510143269__b72988539110">AUTO VACUUM</strong> is enabled by default (controlled by the <strong id="EN-US_TOPIC_0000001510143269__b9990143103215">autovacuum</strong> parameter). After you set the parameter, the system automatically performs <strong id="EN-US_TOPIC_0000001510143269__b1658015402124">VACUUM FULL</strong> on all system catalogs and row-store tables.<ul id="EN-US_TOPIC_0000001510143269__ul6989138184911"><li id="EN-US_TOPIC_0000001510143269__li1798988134920">If the value of <strong id="EN-US_TOPIC_0000001510143269__b14785138185715">autovacuum_max_workers</strong> is <strong id="EN-US_TOPIC_0000001510143269__b26291555121415">0</strong>, neither on the system catalogs nor on ordinary tables will <strong id="EN-US_TOPIC_0000001510143269__b182161440141">VACUUM FULL</strong> be automatically performed.</li><li id="EN-US_TOPIC_0000001510143269__li498915894912">If <strong id="EN-US_TOPIC_0000001510143269__b1763634155714">autovacuum</strong> is set to <strong id="EN-US_TOPIC_0000001510143269__b399715771416">off</strong>, <strong id="EN-US_TOPIC_0000001510143269__b1986973991618">VACUUM FULL</strong> will be automatically performed on ordinary tables, but not system catalogs.</li></ul>
</li><li id="EN-US_TOPIC_0000001510143269__li1860222743917">This applies only to row-store tables. To automatically trigger <strong id="EN-US_TOPIC_0000001510143269__b123456440192">VACUUM </strong>for column-store tables, you need to configure intelligent scheduling tasks on the management console. </li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001510143269__section166214355478"><h4 class="sectiontitle">8.1.1 and Earlier Versions</h4><ol id="EN-US_TOPIC_0000001510143269__ol1640017195533"><li id="EN-US_TOPIC_0000001510143269__li1640011915533">Reforming <strong id="EN-US_TOPIC_0000001510143269__b158721916241">VACUUM FULL</strong> on the following system catalogs affects all services. Perform this operation in an idle time window or when services are stopped.<ul id="EN-US_TOPIC_0000001510143269__ul99701817135218"><li id="EN-US_TOPIC_0000001510143269__li597016174528"><strong id="EN-US_TOPIC_0000001510143269__b1618573652220">pg_statistic</strong> (Statistics information. You are advised not to clear it because it affects service query performance.)</li><li id="EN-US_TOPIC_0000001510143269__li12970017105213">pg_attribute</li><li id="EN-US_TOPIC_0000001510143269__li129711917175215">pgxc_class</li><li id="EN-US_TOPIC_0000001510143269__li8971111735219">pg_type</li><li id="EN-US_TOPIC_0000001510143269__li18971191718522">pg_depend</li><li id="EN-US_TOPIC_0000001510143269__li1597114172526">pg_class</li><li id="EN-US_TOPIC_0000001510143269__li297114172521">pg_index</li><li id="EN-US_TOPIC_0000001510143269__li1497171717525">pg_proc</li><li id="EN-US_TOPIC_0000001510143269__li197114174527">pg_partition</li><li id="EN-US_TOPIC_0000001510143269__li11971171719528">pg_object</li><li id="EN-US_TOPIC_0000001510143269__li11971141711522">pg_shdepend</li></ul>
</li><li id="EN-US_TOPIC_0000001510143269__li35411253539">The following system catalogs affect resource monitoring and table size query interfaces, but do not affect other services.<ul id="EN-US_TOPIC_0000001510143269__ul109333526539"><li id="EN-US_TOPIC_0000001510143269__li69339520533">gs_wlm_user_resource_history</li><li id="EN-US_TOPIC_0000001510143269__li1593325245315">gs_wlm_session_info</li><li id="EN-US_TOPIC_0000001510143269__li16933125216530">gs_wlm_instance_history</li><li id="EN-US_TOPIC_0000001510143269__li11934105215535">gs_respool_resource_history</li><li id="EN-US_TOPIC_0000001510143269__li59344523537">pg_relfilenode_size</li></ul>
</li><li id="EN-US_TOPIC_0000001510143269__li185741540195312">Other system catalogs do not occupy space and do not need to be cleared.</li><li id="EN-US_TOPIC_0000001510143269__li99632237572">During routine O&amp;M, you are advised to monitor the sizes of these system catalogs, and collect statistics every week. If the space must be reclaimed, clear the space based on the sizes of the system tables.<div class="p" id="EN-US_TOPIC_0000001510143269__p4391152416576"><a name="EN-US_TOPIC_0000001510143269__li99632237572"></a><a name="li99632237572"></a>The statement is as follows:<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510143269__screen394219520554"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="k">c</span><span class="p">.</span><span class="n">oid</span><span class="p">,</span><span class="k">c</span><span class="p">.</span><span class="n">relname</span><span class="p">,</span><span class="w"> </span><span class="k">c</span><span class="p">.</span><span class="n">relkind</span><span class="p">,</span><span class="w"> </span><span class="n">pg_relation_size</span><span class="p">(</span><span class="k">c</span><span class="p">.</span><span class="n">oid</span><span class="p">)</span><span class="w"> </span><span class="k">AS</span><span class="w"> </span><span class="k">size</span><span class="w"> </span><span class="k">FROM</span><span class="w"> </span><span class="n">pg_class</span><span class="w"> </span><span class="k">c</span><span class="w"> </span><span class="k">WHERE</span><span class="w"> </span><span class="k">c</span><span class="p">.</span><span class="n">relkind</span><span class="w"> </span><span class="k">IN</span><span class="w"> </span><span class="p">(</span><span class="s1">'r'</span><span class="p">)</span><span class="w"> </span><span class="k">AND</span><span class="w"> </span><span class="k">c</span><span class="p">.</span><span class="n">oid</span><span class="w"> </span><span class="o">&lt;</span><span class="mi">16385</span><span class="w"> </span><span class="k">ORDER</span><span class="w"> </span><span class="k">BY</span><span class="w"> </span><span class="k">size</span><span class="w"> </span><span class="k">DESC</span><span class="p">;</span>
</pre></div></td></tr></table></div>
</div>
</div>
</li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_03_0065.html">Database Usage</a></div>
</div>
</div>