Re: [Proposal] Allow users to specify multiple tables in VACUUM commands

Michael Paquier <michael.paquier@gmail.com>

From: Michael Paquier <michael.paquier@gmail.com>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Tom Lane <tgl@sss.pgh.pa.us>, Masahiko Sawada <sawada.mshk@gmail.com>
Date: 2017-05-18T02:01:57Z
Lists: pgsql-hackers
On Thu, May 18, 2017 at 12:06 AM, Bossart, Nathan <bossartn@amazon.com> wrote:
> I agree with you here, too.  I stopped short of allowing customers to explicitly provide per-table options, so the example you provided wouldn’t work here.  This is more applicable for something like the following:
>
>         VACUUM (FREEZE, VERBOSE) foo, bar (a);
>
> In this case, the FREEZE and VERBOSE options are used for both tables.  However, we have a column list specified for ‘bar’, and the ANALYZE option is implied when we specify a column list.  So when we process ‘bar’, we need to apply the ANALYZE option, but we do not need it for ‘foo’.  For now, that is all that this per-table options variable is used for.

Hm. One argument can be made here: having a column list defined in one
of the tables implies that ANALYZE is enforced for all the relations
listed instead of doing that only on the relations listing columns.
-- 
Michael


Commits

  1. Allow multiple tables to be specified in one VACUUM or ANALYZE command.

  2. Give a better error for duplicate entries in VACUUM/ANALYZE column list.

  3. Reject ANALYZE commands during VACUUM FULL or another ANALYZE.