From b41c88098364b10420bc5499cc8775f45406742c Mon Sep 17 00:00:00 2001 From: Peter Geoghegan Date: Mon, 24 Apr 2023 09:21:01 -0700 Subject: [PATCH v4 2/9] Restructure autovacuum daemon section. Add sect2/sect3 subsections to autovacuum sect1. Also reorder the content slightly for clarity by consolidating "limitations". The next commit finishes recent changes to the autovacuum daemon content by reindenting everything. TODO Add some basic explanations of vacuuming and relfrozenxid advancement, since that now appears later on in the chapter. Alternatively, move the autovacuum daemon sect1 after the routine vacuuming sect1. --- doc/src/sgml/maintenance.sgml | 45 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index b9091e72c..c27efc58d 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -100,6 +100,8 @@ autovacuum workers' activity. + + Autovacuum Scheduling If several large tables all become eligible for vacuuming in a short amount of time, all autovacuum workers might become occupied with @@ -112,6 +114,8 @@ limits. + + Configurable thresholds for vacuuming Tables whose relfrozenxid value is more than transactions old are always @@ -159,7 +163,10 @@ vacuum insert threshold = vacuum base insert threshold + vacuum insert scale fac relfrozenxid; otherwise, only pages that have been modified since the last vacuum are scanned. + + + Configurable thresholds for <command>ANALYZE</command> For analyze, a similar condition is used: the threshold, defined as: @@ -168,20 +175,6 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu is compared to the total number of tuples inserted, updated, or deleted since the last ANALYZE. - - - Partitioned tables are not processed by autovacuum. Statistics - should be collected by running a manual ANALYZE when it is - first populated, and again whenever the distribution of data in its - partitions changes significantly. - - - - Temporary tables cannot be accessed by autovacuum. Therefore, - appropriate vacuum and analyze operations should be performed via - session SQL commands. - - The default thresholds and scale factors are taken from postgresql.conf, but it is possible to override them @@ -192,7 +185,11 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu used. See for more details on the global settings. + + + + Autovacuum Cost-based Delays When multiple workers are running, the autovacuum cost delay parameters (see ) are @@ -203,7 +200,10 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu autovacuum_vacuum_cost_limit storage parameters have been set are not considered in the balancing algorithm. + + + Autovacuum and Lock Conflicts Autovacuum workers generally don't block other commands. If a process attempts to acquire a lock that conflicts with the @@ -223,6 +223,23 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu effectively prevent autovacuums from ever completing. + + + + Limitations + + Partitioned tables are not processed by autovacuum. Statistics + should be collected by running a manual ANALYZE when it is + first populated, and again whenever the distribution of data in its + partitions changes significantly. + + + + Temporary tables cannot be accessed by autovacuum. Therefore, + appropriate vacuum and analyze operations should be performed via + session SQL commands. + + -- 2.40.1