Re: [Proposal] Allow users to specify multiple tables in VACUUM commands
Nathan Bossart <bossartn@amazon.com>
From: "Bossart, Nathan" <bossartn@amazon.com>
To: Michael Paquier <michael.paquier@gmail.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-12T04:40:00Z
Lists: pgsql-hackers
Attachments
- error_on_duplicate_columns_in_analyze_v4.patch (application/octet-stream) patch v4
- vacuum_multiple_tables_v17.patch (application/octet-stream) patch v17
On 9/11/17, 9:28 PM, "Michael Paquier" <michael.paquier@gmail.com> wrote:
> + if (include_parts)
> + {
> + List *partition_oids = find_all_inheritors(relid, NoLock, NULL);
> + ListCell *part_lc;
> + foreach(part_lc, partition_oids)
> + {
> + VacuumRelation *tmp = copyObject(relinfo);
> + Oid part_oid = lfirst_oid(part_lc);
> + tmp->oid = part_oid;
> + vacrels_tmp = lappend(vacrels_tmp, tmp);
> + }
> + }
> I thought that you would have changed that as well, but that's not
> completely complete... In my opinion, HEAD is wrong in using the same
> RangeVar for error reporting for a parent table and its partitions, so
> that's not completely the fault of your patch. But I think that as
> this patch makes vacuum routines smarter, you should create a new
> RangeVar using makeRangeVar as you hold the OID of the child partition
> in this code path. This would allow error reports to actually use the
> data of the partition saved here instead of the parent data.
Good catch. I had missed this. It is added in v17.
Nathan
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