Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Bossart, Nathan" <bossartn@amazon.com>
Cc: Michael Paquier <michael.paquier@gmail.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
"Masahiko Sawada" <sawada.mshk@gmail.com>,
"David G. Johnston" <david.g.johnston@gmail.com>,
Robert Haas <robertmhaas@gmail.com>
Date: 2017-09-21T22:26:50Z
Lists: pgsql-hackers
"Bossart, Nathan" <bossartn@amazon.com> writes: > [ 0001-error_on_duplicate_columns_in_analyze_v6.patch ] I've pushed (and back-patched) the 0001 patch, with some significant changes: * The list_concat_unique implementation is O(N^2), and seems a bit obscure as well. Perhaps there will never be so many column list entries that the speed is a big issue, but I'm not sure. I replaced the list with a bitmap to avoid the risk. * I did not see the point of having "ANALYZE t (x,x,x,nosuchcolumn)" complain about nosuchcolumn rather than the duplicated x entries, especially not if it meant you couldn't say which column was duplicated. So I folded the test into the primary loop and made the error look more like what you get for a nonexistent column. * I didn't like the test case at all: it was repetitive and it actually failed to exhibit the originally problematic behavior with unpatched code, which is generally a minimum expectation for a regression test. (I think that's because you used an empty table, for which ANALYZE will not try to make any pg_statistic entries.) So I rewrote that, and made it use an existing table rather than create a whole new one just for this. I'll take a look at the updated 0002 tomorrow, but if anyone living in a different timezone wants to review it meanwhile, feel free. regards, tom lane
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