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-24T02:40:49Z
Lists: pgsql-hackers
On Mon, Jul 23, 2018 at 02:27:48PM +0000, Bossart, Nathan wrote:
> Sorry for the delay on these patches!  This is nearly identical to
> what I started writing last night, so it looks good to me.

Thanks for double-checking.  I have pushed this one to move on with the
rest of the feature.

> +typedef enum ClusterOption
> +{
> +	CLUOPT_RECHECK,				/* recheck relation state */
> +	CLUOPT_VERBOSE				/* print progress info */
> +}			ClusterOption;
> 
> It looks like the last line here has a bit of extra whitespace
> compared to the other code in parsenodes.h.

That came from pgindent.  I have just updated typedefs.list to take care
of it.  There could be an argument about moving recheck out of
cluster_rel(), but that would not be nice with any module for example
calling this API, so its contract is unchanged.
--
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