Add option SKIP_LOCKED to VACUUM and ANALYZE
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/analyze.sgml | modified | +19 −0 |
| doc/src/sgml/ref/vacuum.sgml | modified | +21 −0 |
| src/backend/commands/vacuum.c | modified | +25 −1 |
| src/backend/parser/gram.y | modified | +12 −0 |
| src/include/nodes/parsenodes.h | modified | +1 −2 |
| src/test/isolation/expected/vacuum-skip-locked.out | added | +171 −0 |
| src/test/isolation/isolation_schedule | modified | +1 −0 |
| src/test/isolation/specs/vacuum-skip-locked.spec | added | +59 −0 |
| src/test/regress/expected/vacuum.out | modified | +13 −3 |
| src/test/regress/sql/vacuum.sql | modified | +11 −1 |
Documentation touched
Discussion
- Add SKIP LOCKED to VACUUM and ANALYZE 24 messages · 2018-06-13 → 2018-10-04
- BUG #14941: Vacuum crashes 42 messages · 2017-12-01 → 2018-04-06