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: Masahiko Sawada <sawada.mshk@gmail.com>,
"David G. Johnston" <david.g.johnston@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Tom Lane <tgl@sss.pgh.pa.us>
Date: 2017-09-05T01:16:39Z
Lists: pgsql-hackers
On Mon, Sep 4, 2017 at 11:47 PM, Bossart, Nathan <bossartn@amazon.com> wrote: > I've made this change in v14 of the main patch. > > In case others had opinions regarding the de-duplication patch, I've > attached that again as well. + /* + * Create the relation list in a long-lived memory context so that it + * survives transaction boundaries. + */ + old_cxt = MemoryContextSwitchTo(AutovacMemCxt); + rangevar = makeRangeVar(tab->at_nspname, tab->at_relname, -1); + rel = makeVacuumRelation(rangevar, NIL, tab->at_relid); + rel_list = list_make1(rel); + MemoryContextSwitchTo(old_cxt); That's way better, thanks for the new patch. So vacuum_multiple_tables_v14.patch is good for a committer in my opinion. With this patch, if the same relation is specified multiple times, then it gets vacuum'ed that many times. Using the same column multi-times results in an error as on HEAD, but that's not a new problem with this patch. So I would tend to think that the same column specified multiple times should cause an error, and that we could let VACUUM run work N times on a relation if it is specified this much. This feels more natural, at least to me, and it keeps the code simple. -- Michael
Commits
-
Allow multiple tables to be specified in one VACUUM or ANALYZE command.
- 11d8d72c27a6 11.0 landed
-
Give a better error for duplicate entries in VACUUM/ANALYZE column list.
- ea31541f5648 9.6.6 landed
- e56facd8b300 9.2.24 landed
- b572b435ca67 9.4.15 landed
- a2b1eb23496e 10.0 landed
- a09d8be7ddaf 9.3.20 landed
- 71480501057f 11.0 landed
- 122289a66b92 9.5.10 landed
-
Reject ANALYZE commands during VACUUM FULL or another ANALYZE.
- e415b469b33b 9.5.0 cited