pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add option SKIP_LOCKED to VACUUM and ANALYZE
Date: Thu, 04 Oct 2018 00:08:15 +0000
Message-ID: <E1g7rBf-0005NL-OF@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/803b1301e8c9aac478abeec62824a5d09664ffff

Modified Files
--------------
doc/src/sgml/ref/analyze.sgml                      |  19 +++
doc/src/sgml/ref/vacuum.sgml                       |  21 +++
src/backend/commands/vacuum.c                      |  26 +++-
src/backend/parser/gram.y                          |  12 ++
src/include/nodes/parsenodes.h                     |   3 +-
src/test/isolation/expected/vacuum-skip-locked.out | 171 +++++++++++++++++++++
src/test/isolation/isolation_schedule              |   1 +
src/test/isolation/specs/vacuum-skip-locked.spec   |  59 +++++++
src/test/regress/expected/vacuum.out               |  16 +-
src/test/regress/sql/vacuum.sql                    |  12 +-
10 files changed, 333 insertions(+), 7 deletions(-)



Message-ID: <E1g7rBf-0005NL-OF@gemulon.postgresql.org>
Permalink:  ../E1g7rBf-0005NL-OF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1g7rBf-0005NL-OF@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Add option SKIP_LOCKED to VACUUM and ANALYZE
  In-Reply-To: <E1g7rBf-0005NL-OF@gemulon.postgresql.org>
  References: <E1g7rBf-0005NL-OF@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox