Skip to content

Commit 82fa3ff

Browse files
author
Amit Kapila
committed
Doc: document autovacuum interruption.
It's important users be able to know (without looking at the source code) that running DDL or DDL-like commands can interrupt autovacuum which can lead to a lot of dead tuples and hence slower database operations. Reported-by: James Coleman Author: James Coleman Reviewed-by: Amit Kapila Backpatch-through: 9.4 Discussion: https://postgr.es/m/CAAaqYe-XYyNwML1=f=gnd0qWg46PnvD=BDrCZ5-L94B887XVxQ@mail.gmail.com
1 parent 58b4cb3 commit 82fa3ff

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/src/sgml/maintenance.sgml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,26 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
825825
<literal>autovacuum_vacuum_cost_limit</literal> storage parameters have been set
826826
are not considered in the balancing algorithm.
827827
</para>
828+
829+
<para>
830+
Autovacuum workers generally don't block other commands. If a process
831+
attempts to acquire a lock that conficts with the
832+
<literal>SHARE UPDATE EXCLUSIVE</literal> lock held by autovacuum, lock
833+
acquisition will interrupt the autovacuum. For conflicting lock modes,
834+
see <xref linkend="table-lock-compatibility"/>. However, if the autovacuum
835+
is running to prevent transaction ID wraparound (i.e., the autovacuum query
836+
name in the <structname>pg_stat_activity</structname> view ends with
837+
<literal>(to prevent wraparound)</literal>), the autovacuum is not
838+
automatically interrupted.
839+
</para>
840+
841+
<warning>
842+
<para>
843+
Regularly running commands that acquire locks conflicting with a
844+
<literal>SHARE UPDATE EXCLUSIVE</literal> lock (e.g., ANALYZE) can
845+
effectively prevent autovacuums from ever completing.
846+
</para>
847+
</warning>
828848
</sect2>
829849
</sect1>
830850

0 commit comments

Comments
 (0)