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

From: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: [Proposal] Allow users to specify multiple tables in VACUUM commands
Date: 2017-05-10 20:10:48
Message-ID: E061A8E3-5E3D-494D-94F0-E8A9B312BBFC@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

Currently, VACUUM commands allow you to specify one table or all of the tables in the current database to vacuum. I’ve recently found myself wishing I could specify multiple tables in a single VACUUM statement. For example, this would be convenient when there are several large tables in a database and only a few need cleanup for XID purposes. Is this a feature that the community might be interested in?

I’ve attached my first attempt at introducing this functionality. In the patch, I’ve extended the table_name parameter in the VACUUM grammar to a qualified_name_list. While this fits into the grammar decently well, I suspect that it may be desirable to be able to specify a column list for each table as well (e.g. VACUUM foo (a), bar (b)). The attached patch requires that only one table be specified in order to specify a column list. But before I spend too much more time working on this, I thought I’d see how pgsql-hackers@ felt about this feature.

Thanks,
Nathan Bossart

Attachment Content-Type Size
vacuum_multiple_tables_v1.patch application/octet-stream 16.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2017-05-10 20:17:29 Re: Function to move the position of a replication slot
Previous Message Jeff Janes 2017-05-10 20:09:38 Transaction held open by autoanalyze can be a bottleneck