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-04T15:49:09Z
Lists: pgsql-hackers
On 9/3/18, 6:20 PM, "Michael Paquier" <michael@paquier.xyz> wrote:
> Nathan, could you rebase your patch set?  From what I can see the last
> patch set applies with one conflict, and it would be nice for clarity to
> split the routines for analyze, vacuum and cluster into separate places.
> Similar to what is done with vacuum_is_relation_owner, having the same
> set of logs for vacuum and analyze may be cleaner.  The set of ownership
> checks should happen after the skip lock checks to be consistent between
> the ownership checks done when building the relation list (list
> expansion for partitions and such) as well as for vacuum_rel() and
> analyze_rel().

Yes.  I've started working on this again, but the new patch set is
probably still a few days out.

> With all the work which has been done already, I don't think that we are
> that far from getting something committable.

Great!

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