From 3d246ace93f13594b8525b3516f35560f9721599 Mon Sep 17 00:00:00 2001 From: Peter Geoghegan Date: Sat, 6 May 2023 12:32:43 -0700 Subject: [PATCH v4 3/9] Reindent autovacuum daemon sect1. When "The Autovacuum Daemon" became its own sect1, the sect1 tags were left indented incorrectly (for a sect1) in order to make the initial "move text into its own sect1" commit as mechanical as possible (we kept the original sect2 indentation). A later commit further split up "The Autovacuum Daemon" into further sect2 and sect3 subsections, to add useful headings. Now we actually fix the indentation changes that were put off at first. It may look like these indentation changes are wrong (they look wrong relative to the chapter-level introductory content that precedes these changes to indentation), but it's actually the other way around: there is a preexisting problem with the indentation for the chapter-level introductory material (which I have opted to not fix now). Note that the newly added "The Autovacuum Daemon" sect1 now has one space of indentation at the top level, just like every other sect1. As usual, the goal of structuring things this way is to make life easier for translators. --- doc/src/sgml/maintenance.sgml | 198 +++++++++++++++++----------------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index c27efc58d..702e2797c 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -59,46 +59,46 @@ pleasant and productive experience with the system. - - The Autovacuum Daemon + + The Autovacuum Daemon - - autovacuum - general information - - - PostgreSQL has an optional but highly - recommended feature called autovacuum, - whose purpose is to automate the execution of - VACUUM and ANALYZE commands. - When enabled, autovacuum checks for - tables that have had a large number of inserted, updated or deleted - tuples. These checks use the statistics collection facility; - therefore, autovacuum cannot be used unless + autovacuum + general information + + + PostgreSQL has an optional but highly + recommended feature called autovacuum, + whose purpose is to automate the execution of + VACUUM and ANALYZE commands. + When enabled, autovacuum checks for + tables that have had a large number of inserted, updated or deleted + tuples. These checks use the statistics collection facility; + therefore, autovacuum cannot be used unless is set to true. - In the default configuration, autovacuuming is enabled and the related - configuration parameters are appropriately set. - + In the default configuration, autovacuuming is enabled and the related + configuration parameters are appropriately set. + - - The autovacuum daemon actually consists of multiple processes. - There is a persistent daemon process, called the - autovacuum launcher, which is in charge of starting - autovacuum worker processes for all databases. The - launcher will distribute the work across time, attempting to start one - worker within each database every - seconds. (Therefore, if the installation has N databases, - a new worker will be launched every - autovacuum_naptime/N seconds.) - A maximum of worker processes - are allowed to run at the same time. If there are more than - autovacuum_max_workers databases to be processed, - the next database will be processed as soon as the first worker finishes. - Each worker process will check each table within its database and - execute VACUUM and/or ANALYZE as needed. - can be set to monitor - autovacuum workers' activity. - + + The autovacuum daemon actually consists of multiple processes. + There is a persistent daemon process, called the + autovacuum launcher, which is in charge of starting + autovacuum worker processes for all databases. The + launcher will distribute the work across time, attempting to start one + worker within each database every + seconds. (Therefore, if the installation has N databases, + a new worker will be launched every + autovacuum_naptime/N seconds.) + A maximum of worker processes + are allowed to run at the same time. If there are more than + autovacuum_max_workers databases to be processed, + the next database will be processed as soon as the first worker finishes. + Each worker process will check each table within its database and + execute VACUUM and/or ANALYZE as needed. + can be set to monitor + autovacuum workers' activity. + Autovacuum Scheduling @@ -114,78 +114,78 @@ limits. - - Configurable thresholds for vacuuming - - Tables whose relfrozenxid value is more than - transactions old are always - vacuumed (this also applies to those tables whose freeze max age has - been modified via storage parameters; see below). Otherwise, if the - number of tuples obsoleted since the last - VACUUM exceeds the vacuum threshold, the - table is vacuumed. The vacuum threshold is defined as: + + Configurable thresholds for vacuuming + + Tables whose relfrozenxid value is more than + transactions old are always + vacuumed (this also applies to those tables whose freeze max age has + been modified via storage parameters; see below). Otherwise, if the + number of tuples obsoleted since the last + VACUUM exceeds the vacuum threshold, the + table is vacuumed. The vacuum threshold is defined as: vacuum threshold = vacuum base threshold + vacuum scale factor * number of tuples - where the vacuum base threshold is - , - the vacuum scale factor is - , - and the number of tuples is - pg_class.reltuples. - + where the vacuum base threshold is + , + the vacuum scale factor is + , + and the number of tuples is + pg_class.reltuples. + - - The table is also vacuumed if the number of tuples inserted since the last - vacuum has exceeded the defined insert threshold, which is defined as: + + The table is also vacuumed if the number of tuples inserted since the last + vacuum has exceeded the defined insert threshold, which is defined as: vacuum insert threshold = vacuum base insert threshold + vacuum insert scale factor * number of tuples - where the vacuum insert base threshold is - , - and vacuum insert scale factor is - . - Such vacuums may allow portions of the table to be marked as - all visible and also allow tuples to be frozen, which - can reduce the work required in subsequent vacuums. - For tables which receive INSERT operations but no or - almost no UPDATE/DELETE operations, - it may be beneficial to lower the table's - as this may allow - tuples to be frozen by earlier vacuums. The number of obsolete tuples and - the number of inserted tuples are obtained from the cumulative statistics system; - it is a semi-accurate count updated by each UPDATE, - DELETE and INSERT operation. (It is - only semi-accurate because some information might be lost under heavy - load.) If the relfrozenxid value of the table - is more than vacuum_freeze_table_age transactions old, - an aggressive vacuum is performed to freeze old tuples and advance - relfrozenxid; otherwise, only pages that have been modified - since the last vacuum are scanned. - - + where the vacuum insert base threshold is + , + and vacuum insert scale factor is + . + Such vacuums may allow portions of the table to be marked as + all visible and also allow tuples to be frozen, which + can reduce the work required in subsequent vacuums. + For tables which receive INSERT operations but no or + almost no UPDATE/DELETE operations, + it may be beneficial to lower the table's + as this may allow + tuples to be frozen by earlier vacuums. The number of obsolete tuples and + the number of inserted tuples are obtained from the cumulative statistics system; + it is a semi-accurate count updated by each UPDATE, + DELETE and INSERT operation. (It is + only semi-accurate because some information might be lost under heavy + load.) If the relfrozenxid value of the table + is more than vacuum_freeze_table_age transactions old, + an aggressive vacuum is performed to freeze old tuples and advance + 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: + + Configurable thresholds for <command>ANALYZE</command> + + For analyze, a similar condition is used: the threshold, defined as: analyze threshold = analyze base threshold + analyze scale factor * number of tuples - is compared to the total number of tuples inserted, updated, or deleted - since the last ANALYZE. - - - The default thresholds and scale factors are taken from - postgresql.conf, but it is possible to override them - (and many other autovacuum control parameters) on a per-table basis; see - for more information. - If a setting has been changed via a table's storage parameters, that value - is used when processing that table; otherwise the global settings are - used. See for more details on - the global settings. - - + is compared to the total number of tuples inserted, updated, or deleted + since the last ANALYZE. + + + The default thresholds and scale factors are taken from + postgresql.conf, but it is possible to override them + (and many other autovacuum control parameters) on a per-table basis; see + for more information. + If a setting has been changed via a table's storage parameters, that value + is used when processing that table; otherwise the global settings are + used. See for more details on + the global settings. + + @@ -240,7 +240,7 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu session SQL commands. - + Routine Vacuuming -- 2.40.1