Subject: add PROCESS_MAIN to VACUUM

From: Nathan Bossart <[email-masked]>
Date: Thu, 29 Dec 2022 16:00:28 -0800

Hi hackers,

I originally suggested $ЅUBJECT as part of the thread that ultimately led
to the addition of PROCESS_TOAST [0], but we decided not to proceed with
it.  Recently, this idea came up again [1], so I thought I'd give it
another try.

The motivation for adding this option is to make it easier to VACUUM only a
relation's TOAST table.  At the moment, you need to find the TOAST table by
examining a relation's reltoastrelid, and you need USAGE on the pg_toast
schema.  This option could also help make it possible to call only
vac_update_datfrozenxid() without processing any relations, as discussed
elsewhere [2].

The demand for all these niche VACUUM options is likely limited, but it
does seem like there are some useful applications.  If a new option is out
of the question, perhaps this functionality could be added to the existing
PROCESS_TOAST option.

[0] https://postgr.es/m/BA8951E9-1524-48C5-94AF-73B1F0D7857F%40amazon.com
[1] https://postgr.es/m/20221215191246.GA252861%40nathanxps13
[2] https://postgr.es/m/20221229213719.GA301584%40nathanxps13

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com