Add option PROCESS_TOAST to VACUUM
authorMichael Paquier <michael@paquier.xyz>
Tue, 9 Feb 2021 05:13:57 +0000 (14:13 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 9 Feb 2021 05:13:57 +0000 (14:13 +0900)
commit7cb3048f38e26b39dd5fd412ed8a4981b6809b35
treef7ffbf1180744895084e82223ac9f9d6e20988e2
parent5fd590021d268190e4c8f377370c7e7f1e7d9229
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
doc/src/sgml/ref/vacuum.sgml
doc/src/sgml/ref/vacuumdb.sgml
src/backend/commands/vacuum.c
src/backend/postmaster/autovacuum.c
src/bin/psql/tab-complete.c
src/bin/scripts/t/100_vacuumdb.pl
src/bin/scripts/vacuumdb.c
src/include/commands/vacuum.h
src/test/regress/expected/vacuum.out
src/test/regress/sql/vacuum.sql