Skip to content

Commit aafce77

Browse files
Daniil DavidovCommitfest Bot
authored andcommitted
Documentation for parallel autovacuum
1 parent 527d7d0 commit aafce77

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

doc/src/sgml/config.sgml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,6 +2835,7 @@ include_dir 'conf.d'
28352835
<para>
28362836
When changing this value, consider also adjusting
28372837
<xref linkend="guc-max-parallel-workers"/>,
2838+
<xref linkend="guc-autovacuum-max-parallel-workers"/>,
28382839
<xref linkend="guc-max-parallel-maintenance-workers"/>, and
28392840
<xref linkend="guc-max-parallel-workers-per-gather"/>.
28402841
</para>
@@ -9254,6 +9255,23 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
92549255
</listitem>
92559256
</varlistentry>
92569257

9258+
<varlistentry id="guc-autovacuum-max-parallel-workers" xreflabel="autovacuum_max_parallel_workers">
9259+
<term><varname>autovacuum_max_parallel_workers</varname> (<type>integer</type>)
9260+
<indexterm>
9261+
<primary><varname>autovacuum_max_parallel_workers</varname></primary>
9262+
<secondary>configuration parameter</secondary>
9263+
</indexterm>
9264+
</term>
9265+
<listitem>
9266+
<para>
9267+
Sets the maximum number of parallel autovacuum workers that
9268+
can be used for parallel index vacuuming at one time. Is capped by
9269+
<xref linkend="guc-max-worker-processes"/>. The default is 0,
9270+
which means no parallel index vacuuming.
9271+
</para>
9272+
</listitem>
9273+
</varlistentry>
9274+
92579275
</variablelist>
92589276
</sect2>
92599277

doc/src/sgml/maintenance.sgml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,18 @@ HINT: Execute a database-wide VACUUM in that database.
897897
autovacuum workers' activity.
898898
</para>
899899

900+
<para>
901+
If an autovacuum worker process comes across a table with the enabled
902+
<xref linkend="reloption-autovacuum-parallel-workers"/> storage parameter,
903+
it will launch parallel workers in order to vacuum indexes of this table
904+
in a parallel mode. Parallel workers are taken from the pool of processes
905+
established by <xref linkend="guc-max-worker-processes"/>, limited by
906+
<xref linkend="guc-max-parallel-workers"/>.
907+
The total number of parallel autovacuum workers that can be active at one
908+
time is limited by the <xref linkend="guc-autovacuum-max-parallel-workers"/>
909+
configuration parameter.
910+
</para>
911+
900912
<para>
901913
If several large tables all become eligible for vacuuming in a short
902914
amount of time, all autovacuum workers might become occupied with

doc/src/sgml/ref/create_table.sgml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,6 +1717,26 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
17171717
</listitem>
17181718
</varlistentry>
17191719

1720+
<varlistentry id="reloption-autovacuum-parallel-workers" xreflabel="autovacuum_parallel_workers">
1721+
<term><literal>autovacuum_parallel_workers</literal> (<type>integer</type>)
1722+
<indexterm>
1723+
<primary><varname>autovacuum_parallel_workers</varname> storage parameter</primary>
1724+
</indexterm>
1725+
</term>
1726+
<listitem>
1727+
<para>
1728+
Sets the maximum number of parallel autovacuum workers that can process
1729+
indexes of this table.
1730+
The default value is -1, which means no parallel index vacuuming for
1731+
this table. If value is 0 then parallel degree will computed based on
1732+
number of indexes.
1733+
Note that the computed number of workers may not actually be available at
1734+
run time. If this occurs, the autovacuum will run with fewer workers
1735+
than expected.
1736+
</para>
1737+
</listitem>
1738+
</varlistentry>
1739+
17201740
<varlistentry id="reloption-autovacuum-vacuum-threshold" xreflabel="autovacuum_vacuum_threshold">
17211741
<term><literal>autovacuum_vacuum_threshold</literal>, <literal>toast.autovacuum_vacuum_threshold</literal> (<type>integer</type>)
17221742
<indexterm>

0 commit comments

Comments
 (0)