Re: Add SKIP LOCKED to VACUUM and ANALYZE

Nathan Bossart <bossartn@amazon.com>

From: "Bossart, Nathan" <bossartn@amazon.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "Andres Freund" <andres@anarazel.de>, Masahiko Sawada <sawada.mshk@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Lyes Ameddah <lyes.amd@gmail.com>
Date: 2018-09-05T15:24:21Z
Lists: pgsql-hackers

Attachments

On 9/4/18, 1:32 PM, "Michael Paquier" <michael@paquier.xyz> wrote:
>On Tue, Sep 04, 2018 at 03:49:09PM +0000, Bossart, Nathan wrote:
>> Yes.  I've started working on this again, but the new patch set is
>> probably still a few days out.
>
> Thanks, Nathan.

And here it is.  Here is a summary of the notable changes:

 1) Patches v8-0003 and v8-0008 have been discarded.  These patches
    added SKIP_LOCKED behavior when opening a relation's indexes.
    Instead, I've documented that VACUUM and ANALYZE may still block
    on indexes in v9-0007.
 2) Patches v8-0004 and v8-0005 have been discarded, as they have
    already been committed.
 3) Patch v8-0011 has been discarded.  As previously noted, VACUUM
    (SKIP_LOCKED, FULL) is already handled in vacuum_rel(), so no
    changed are required to cluster_rel().  However, we will need
    something similar to v8-0011 if we ever add SKIP_LOCKED to
    CLUSTER.
 4) The option has been renamed to SKIP_LOCKED (with the underscore)
    for consistency with the DISABLE_PAGE_SKIPPING option.
 5) In the documentation, I've listed the caveats for SKIP_LOCKED and
    partitioned tables.  I tried to make all the new documentation as
    concise as possible.

Nathan

Commits

  1. Add option SKIP_LOCKED to VACUUM and ANALYZE

  2. Refactor relation opening for VACUUM and ANALYZE

  3. Refactor cluster_rel() to handle more options

  4. Add assertion in expand_vacuum_rel() for non-autovacuum path