Re: Add SKIP LOCKED to VACUUM and ANALYZE

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: "Bossart, Nathan" <bossartn@amazon.com>
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-07-23T03:10:58Z
Lists: pgsql-hackers

Attachments

On Thu, Jul 19, 2018 at 10:54:23AM +0900, Michael Paquier wrote:
> If you can get this refactoring done, let's look into getting those two
> parts committed first to simplify the next steps.  No need to extend the
> grammar of cluster either.  The set of options for CLUSTER should be a
> separate enum list on top of ClusterStmt in parsenodes.h, as VACUUM has
> no recheck option.  I would recommend to get cluster_rel reshaped first,
> and the ereport() calls done after.

The refactoring for CLUSTER is pretty obvious, and makes the API a bit
cleaner, so attached is a proposal of patch to do so.  Thoughts?
--
Michael

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