Add option PROCESS_TOAST to VACUUM
Michael Paquier <michael@paquier.xyz>
Add option PROCESS_TOAST to VACUUM This option controls if toast tables associated with a relation are vacuumed or not when running a manual VACUUM. It was already possible to trigger a manual VACUUM on a toast relation without processing its main relation, but a manual vacuum on a main relation always forced a vacuum on its toast table. This is useful in scenarios where the level of bloat or transaction age of the main and toast relations differs a lot. This option is an extension of the existing VACOPT_SKIPTOAST that was used by autovacuum to control if toast relations should be skipped or not. This internal flag is renamed to VACOPT_PROCESS_TOAST for consistency with the new option. A new option switch, called --no-process-toast, is added to vacuumdb. Author: Nathan Bossart Reviewed-by: Kirk Jamison, Michael Paquier, Justin Pryzby Discussion: https://postgr.es/m/BA8951E9-1524-48C5-94AF-73B1F0D7857F@amazon.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/vacuumdb.sgml | modified | +15 −0 |
| doc/src/sgml/ref/vacuum.sgml | modified | +15 −0 |
| src/backend/commands/vacuum.c | modified | +14 −3 |
| src/backend/postmaster/autovacuum.c | modified | +3 −2 |
| src/bin/psql/tab-complete.c | modified | +3 −2 |
| src/bin/scripts/t/100_vacuumdb.pl | modified | +13 −6 |
| src/bin/scripts/vacuumdb.c | modified | +28 −0 |
| src/include/commands/vacuum.h | modified | +1 −1 |
| src/test/regress/expected/vacuum.out | modified | +6 −0 |
| src/test/regress/sql/vacuum.sql | modified | +6 −0 |
Documentation touched
Discussion
- Add MAIN_RELATION_CLEANUP and SECONDARY_RELATION_CLEANUP options to VACUUM 27 messages · 2020-01-21 → 2021-02-09