]> granicus.if.org Git - postgresql/commit
Add option SKIP_LOCKED to VACUUM and ANALYZE
authorMichael Paquier <michael@paquier.xyz>
Thu, 4 Oct 2018 00:00:33 +0000 (09:00 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 4 Oct 2018 00:00:33 +0000 (09:00 +0900)
commit803b1301e8c9aac478abeec62824a5d09664ffff
treef4ade5601668689308c4acdd34fef6d6984dd54b
parentd173652797cf0cf456ac2c38eca898159a7c19fc
Add option SKIP_LOCKED to VACUUM and ANALYZE

When specified, this option allows VACUUM to skip the work on a relation
if there is a conflicting lock on it when trying to open it at the
beginning of its processing.

Similarly to autovacuum, this comes with a couple of limitations while
the relation is processed which can cause the process to still block:
- when opening the relation indexes.
- when acquiring row samples for table inheritance trees, partition trees
or certain types of foreign tables, and that a lock is taken on some
leaves of such trees.

Author: Nathan Bossart
Reviewed-by: Michael Paquier, Andres Freund, Masahiko Sawada
Discussion: https://postgr.es/m/9EF7EBE4-720D-4CF1-9D0E-4403D7E92990@amazon.com
Discussion: https://postgr.es/m/20171201160907.27110.74730@wrigleys.postgresql.org
doc/src/sgml/ref/analyze.sgml
doc/src/sgml/ref/vacuum.sgml
src/backend/commands/vacuum.c
src/backend/parser/gram.y
src/include/nodes/parsenodes.h
src/test/isolation/expected/vacuum-skip-locked.out [new file with mode: 0644]
src/test/isolation/isolation_schedule
src/test/isolation/specs/vacuum-skip-locked.spec [new file with mode: 0644]
src/test/regress/expected/vacuum.out
src/test/regress/sql/vacuum.sql