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

Nathan Bossart <bossartn@amazon.com>

From: "Bossart, Nathan" <bossartn@amazon.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Masahiko Sawada <sawada.mshk@gmail.com>, Michael Paquier <michael.paquier@gmail.com>
Date: 2017-05-12T00:47:40Z
Lists: pgsql-hackers

Attachments

Hi again,

Attached is a more complete first attempt at adding this functionality.  I added two node types: one for parsing the “relation and columns” list in the grammar, and one for holding the relation information we need for each call to vacuum_rel(…)/analyze_rel(…).  I also added assertions and comments for some undocumented assumptions that we currently rely upon.

Adjustments to the documentation for VACUUM/ANALYZE and new checks in the VACUUM regression test are included in this patch as well.

Looking forward to any feedback that you have.

Nathan

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.