VACUUM: ignore indexing operations with CONCURRENTLY
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 23 Feb 2021 15:15:09 +0000 (12:15 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 23 Feb 2021 15:15:09 +0000 (12:15 -0300)
commitd9d076222f5b94a85e0e318339cfc44b8f26022d
tree246a3d9659c6d782033f30d454055eb3fd7d81f1
parent6f6f284c7ee44264eb3e128e2bf54d9276711d11
VACUUM: ignore indexing operations with CONCURRENTLY

As envisioned in commit c98763bf51bf, it is possible for VACUUM to
ignore certain transactions that are executing CREATE INDEX CONCURRENTLY
and REINDEX CONCURRENTLY for the purposes of computing Xmin; that's
because we know those transactions are not going to examine any other
tables, and are not going to execute anything else in the same
transaction.  (Only operations on "safe" indexes can be ignored: those
on indexes that are neither partial nor expressional).

This is extremely useful in cases where CIC/RC can run for a very long
time, because that used to be a significant headache for concurrent
vacuuming of other tables.

Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/20210115133858.GA18931@alvherre.pgsql
doc/src/sgml/ref/create_index.sgml
doc/src/sgml/ref/reindex.sgml
src/backend/storage/ipc/procarray.c
src/backend/utils/misc/guc.c