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-10-04T01:32:47Z
Lists: pgsql-hackers
On 10/3/18, 7:10 PM, "Michael Paquier" <michael@paquier.xyz> wrote:
> Thanks, I have committed the patch, after minor tweaks to the docs.

Thanks!

> Mainly, in the VACUUM page, I have added a mention that VACUUM ANALYZE
> can block for row sampling.  I have also removed for now the set of
> recommendations the patch added, as we still gather statistics on the
> partitioned tables from the row samples gathered from the partitions, so
> recommending to list only the leaves is not completely correct either
> all the time.

Good catch.  The committed version of the documentation looks good to
me.

> We could perhaps add something about such recommendations.  A separate
> section covering more general things may be interesting.

Agreed, this could be a good addition to the "Notes" sections.

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