Skip to content

Commit 6404751

Browse files
committed
Improve documentation around autovacuum-related storage parameters.
These were discussed in three different sections of the manual, which unsurprisingly had diverged over time; and the descriptions of individual variables lacked stylistic consistency even within each section (and frequently weren't in very good English anyway). Clean up the mess, and remove some of the redundant information in hopes that future additions will be less likely to re-introduce inconsistency. For instance I see no need for maintenance.sgml to include its very own list of all the autovacuum storage parameters, especially since that list was already incomplete.
1 parent da3751c commit 6404751

File tree

3 files changed

+106
-116
lines changed

3 files changed

+106
-116
lines changed

doc/src/sgml/config.sgml

+35-30
Original file line numberDiff line numberDiff line change
@@ -5234,8 +5234,10 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
52345234

52355235
<para>
52365236
These settings control the behavior of the <firstterm>autovacuum</>
5237-
feature. Refer to <xref linkend="autovacuum"> for
5238-
more information.
5237+
feature. Refer to <xref linkend="autovacuum"> for more information.
5238+
Note that many of these settings can be overridden on a per-table
5239+
basis; see <xref linkend="sql-createtable-storage-parameters"
5240+
endterm="sql-createtable-storage-parameters-title">.
52395241
</para>
52405242

52415243
<variablelist>
@@ -5253,7 +5255,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
52535255
<xref linkend="guc-track-counts"> must also be enabled for
52545256
autovacuum to work.
52555257
This parameter can only be set in the <filename>postgresql.conf</>
5256-
file or on the server command line.
5258+
file or on the server command line; however, autovacuuming can be
5259+
disabled for individual tables by changing table storage parameters.
52575260
</para>
52585261
<para>
52595262
Note that even when this parameter is disabled, the system
@@ -5281,8 +5284,10 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
52815284
set to any value other than <literal>-1</literal>, a message will be
52825285
logged if an autovacuum action is skipped due to the existence of a
52835286
conflicting lock. Enabling this parameter can be helpful
5284-
in tracking autovacuum activity. This setting can only be set in
5285-
the <filename>postgresql.conf</> file or on the server command line.
5287+
in tracking autovacuum activity. This parameter can only be set in
5288+
the <filename>postgresql.conf</> file or on the server command line;
5289+
but the setting can be overridden for individual tables by
5290+
changing table storage parameters.
52865291
</para>
52875292
</listitem>
52885293
</varlistentry>
@@ -5296,7 +5301,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
52965301
<listitem>
52975302
<para>
52985303
Specifies the maximum number of autovacuum processes (other than the
5299-
autovacuum launcher) which may be running at any one time. The default
5304+
autovacuum launcher) that may be running at any one time. The default
53005305
is three. This parameter can only be set at server start.
53015306
</para>
53025307
</listitem>
@@ -5333,9 +5338,9 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
53335338
to trigger a <command>VACUUM</> in any one table.
53345339
The default is 50 tuples.
53355340
This parameter can only be set in the <filename>postgresql.conf</>
5336-
file or on the server command line.
5337-
This setting can be overridden for individual tables by
5338-
changing storage parameters.
5341+
file or on the server command line;
5342+
but the setting can be overridden for individual tables by
5343+
changing table storage parameters.
53395344
</para>
53405345
</listitem>
53415346
</varlistentry>
@@ -5352,9 +5357,9 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
53525357
needed to trigger an <command>ANALYZE</> in any one table.
53535358
The default is 50 tuples.
53545359
This parameter can only be set in the <filename>postgresql.conf</>
5355-
file or on the server command line.
5356-
This setting can be overridden for individual tables by
5357-
changing storage parameters.
5360+
file or on the server command line;
5361+
but the setting can be overridden for individual tables by
5362+
changing table storage parameters.
53585363
</para>
53595364
</listitem>
53605365
</varlistentry>
@@ -5372,9 +5377,9 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
53725377
when deciding whether to trigger a <command>VACUUM</>.
53735378
The default is 0.2 (20% of table size).
53745379
This parameter can only be set in the <filename>postgresql.conf</>
5375-
file or on the server command line.
5376-
This setting can be overridden for individual tables by
5377-
changing storage parameters.
5380+
file or on the server command line;
5381+
but the setting can be overridden for individual tables by
5382+
changing table storage parameters.
53785383
</para>
53795384
</listitem>
53805385
</varlistentry>
@@ -5392,9 +5397,9 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
53925397
when deciding whether to trigger an <command>ANALYZE</>.
53935398
The default is 0.1 (10% of table size).
53945399
This parameter can only be set in the <filename>postgresql.conf</>
5395-
file or on the server command line.
5396-
This setting can be overridden for individual tables by
5397-
changing storage parameters.
5400+
file or on the server command line;
5401+
but the setting can be overridden for individual tables by
5402+
changing table storage parameters.
53985403
</para>
53995404
</listitem>
54005405
</varlistentry>
@@ -5421,7 +5426,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
54215426
is a relatively low 200 million transactions.
54225427
This parameter can only be set at server start, but the setting
54235428
can be reduced for individual tables by
5424-
changing storage parameters.
5429+
changing table storage parameters.
54255430
For more information see <xref linkend="vacuum-for-wraparound">.
54265431
</para>
54275432
</listitem>
@@ -5448,8 +5453,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
54485453
<filename>pg_multixact/members</> and <filename>pg_multixact/offsets</>
54495454
subdirectories, which is why the default is a relatively low
54505455
400 million multixacts.
5451-
This parameter can only be set at server start, but the setting
5452-
can be reduced for individual tables by changing storage parameters.
5456+
This parameter can only be set at server start, but the setting can
5457+
be reduced for individual tables by changing table storage parameters.
54535458
For more information see <xref linkend="vacuum-for-multixact-wraparound">.
54545459
</para>
54555460
</listitem>
@@ -5468,9 +5473,9 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
54685473
<xref linkend="guc-vacuum-cost-delay"> value will be used.
54695474
The default value is 20 milliseconds.
54705475
This parameter can only be set in the <filename>postgresql.conf</>
5471-
file or on the server command line.
5472-
This setting can be overridden for individual tables by
5473-
changing storage parameters.
5476+
file or on the server command line;
5477+
but the setting can be overridden for individual tables by
5478+
changing table storage parameters.
54745479
</para>
54755480
</listitem>
54765481
</varlistentry>
@@ -5488,12 +5493,12 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
54885493
default), the regular
54895494
<xref linkend="guc-vacuum-cost-limit"> value will be used. Note that
54905495
the value is distributed proportionally among the running autovacuum
5491-
workers, if there is more than one, so that the sum of the limits of
5492-
each worker never exceeds the limit on this variable.
5496+
workers, if there is more than one, so that the sum of the limits for
5497+
each worker does not exceed the value of this variable.
54935498
This parameter can only be set in the <filename>postgresql.conf</>
5494-
file or on the server command line.
5495-
This setting can be overridden for individual tables by
5496-
changing storage parameters.
5499+
file or on the server command line;
5500+
but the setting can be overridden for individual tables by
5501+
changing table storage parameters.
54975502
</para>
54985503
</listitem>
54995504
</varlistentry>
@@ -6072,7 +6077,7 @@ SET XML OPTION { DOCUMENT | CONTENT };
60726077
the entries in it to the main GIN data structure in bulk.
60736078
The default is four megabytes (<literal>4MB</>). This setting
60746079
can be overridden for individual GIN indexes by changing
6075-
storage parameters.
6080+
index storage parameters.
60766081
See <xref linkend="gin-fast-update"> and <xref linkend="gin-tips">
60776082
for more information.
60786083
</para>

doc/src/sgml/maintenance.sgml

+16-37
Original file line numberDiff line numberDiff line change
@@ -705,15 +705,15 @@ HINT: Stop the postmaster and vacuum that database in single-user mode.
705705
the next database will be processed as soon as the first worker finishes.
706706
Each worker process will check each table within its database and
707707
execute <command>VACUUM</> and/or <command>ANALYZE</> as needed.
708-
<varname>log_autovacuum_min_duration</varname> can be used to monitor
709-
autovacuum activity.
708+
<xref linkend="guc-log-autovacuum-min-duration"> can be set to monitor
709+
autovacuum workers' activity.
710710
</para>
711711

712712
<para>
713713
If several large tables all become eligible for vacuuming in a short
714714
amount of time, all autovacuum workers might become occupied with
715715
vacuuming those tables for a long period. This would result
716-
in other tables and databases not being vacuumed until a worker became
716+
in other tables and databases not being vacuumed until a worker becomes
717717
available. There is no limit on how many workers might be in a
718718
single database, but workers do try to avoid repeating work that has
719719
already been done by other workers. Note that the number of running
@@ -767,45 +767,24 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
767767
<para>
768768
The default thresholds and scale factors are taken from
769769
<filename>postgresql.conf</filename>, but it is possible to override them
770-
on a table-by-table basis; see
770+
(and many other autovacuum control parameters) on a per-table basis; see
771771
<xref linkend="sql-createtable-storage-parameters"
772772
endterm="sql-createtable-storage-parameters-title"> for more information.
773-
If a setting
774-
has been changed via storage parameters, that value is used; otherwise the
775-
global settings are used. See <xref linkend="runtime-config-autovacuum"> for
776-
more details on the global settings.
777-
</para>
778-
779-
<para>
780-
Besides the base threshold values and scale factors, there are six
781-
more autovacuum parameters that can be set for each table via
782-
storage parameters.
783-
The first parameter, <literal>autovacuum_enabled</>,
784-
can be set to <literal>false</literal> to instruct the autovacuum daemon
785-
to skip that particular table entirely. In this case
786-
autovacuum will only touch the table if it must do so
787-
to prevent transaction ID wraparound.
788-
Another two parameters,
789-
<varname>autovacuum_vacuum_cost_delay</> and
790-
<varname>autovacuum_vacuum_cost_limit</>, are used to set
791-
table-specific values for the cost-based vacuum delay feature
792-
(see <xref linkend="runtime-config-resource-vacuum-cost">).
793-
<varname>autovacuum_freeze_min_age</>,
794-
<varname>autovacuum_freeze_max_age</> and
795-
<varname>autovacuum_freeze_table_age</> are used to set
796-
values for <xref linkend="guc-vacuum-freeze-min-age">,
797-
<xref linkend="guc-autovacuum-freeze-max-age"> and
798-
<xref linkend="guc-vacuum-freeze-table-age"> respectively.
799-
</para>
800-
801-
<para>
802-
When multiple workers are running, the cost delay parameters are
773+
If a setting has been changed via a table's storage parameters, that value
774+
is used when processing that table; otherwise the global settings are
775+
used. See <xref linkend="runtime-config-autovacuum"> for more details on
776+
the global settings.
777+
</para>
778+
779+
<para>
780+
When multiple workers are running, the autovacuum cost delay parameters
781+
(see <xref linkend="runtime-config-resource-vacuum-cost">) are
803782
<quote>balanced</quote> among all the running workers, so that the
804783
total I/O impact on the system is the same regardless of the number
805784
of workers actually running. However, any workers processing tables whose
806-
<literal>autovacuum_vacuum_cost_delay</> or
807-
<literal>autovacuum_vacuum_cost_limit</> have been set are not considered
808-
in the balancing algorithm.
785+
per-table <literal>autovacuum_vacuum_cost_delay</> or
786+
<literal>autovacuum_vacuum_cost_limit</> storage parameters have been set
787+
are not considered in the balancing algorithm.
809788
</para>
810789
</sect2>
811790
</sect1>

0 commit comments

Comments
 (0)