diff options
author | Robert Haas <rhaas@postgresql.org> | 2019-04-04 14:58:53 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2019-04-04 15:04:43 -0400 |
commit | a96c41feec6b6616eb9d5baee9a9e08c20533c38 (patch) | |
tree | 8224a04fbe5c2165fd2ed18655aa63259c234ae4 /src/backend/access/common/reloptions.c | |
parent | 74eb2176bf3ac7a2fae1282b4f4f1d000f3e6d78 (diff) | |
download | postgresql-a96c41feec6b6616eb9d5baee9a9e08c20533c38.tar.gz postgresql-a96c41feec6b6616eb9d5baee9a9e08c20533c38.zip |
Allow VACUUM to be run with index cleanup disabled.
This commit adds a new reloption, vacuum_index_cleanup, which
controls whether index cleanup is performed for a particular
relation by default. It also adds a new option to the VACUUM
command, INDEX_CLEANUP, which can be used to override the
reloption. If neither the reloption nor the VACUUM option is
used, the default is true, as before.
Masahiko Sawada, reviewed and tested by Nathan Bossart, Alvaro
Herrera, Kyotaro Horiguchi, Darafei Praliaskouski, and me.
The wording of the documentation is mostly due to me.
Discussion: http://postgr.es/m/CAD21AoAt5R3DNUZSjOoXDUY=naYPUOuffVsRzuTYMz29yLzQCA@mail.gmail.com
Diffstat (limited to 'src/backend/access/common/reloptions.c')
-rw-r--r-- | src/backend/access/common/reloptions.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/access/common/reloptions.c b/src/backend/access/common/reloptions.c index b58a1f7a729..e2c0de352ad 100644 --- a/src/backend/access/common/reloptions.c +++ b/src/backend/access/common/reloptions.c @@ -138,6 +138,15 @@ static relopt_bool boolRelOpts[] = }, false }, + { + { + "vacuum_index_cleanup", + "Enables index vacuuming and index cleanup", + RELOPT_KIND_HEAP, + ShareUpdateExclusiveLock + }, + true + }, /* list terminator */ {{NULL}} }; @@ -1388,7 +1397,9 @@ default_reloptions(Datum reloptions, bool validate, relopt_kind kind) {"parallel_workers", RELOPT_TYPE_INT, offsetof(StdRdOptions, parallel_workers)}, {"vacuum_cleanup_index_scale_factor", RELOPT_TYPE_REAL, - offsetof(StdRdOptions, vacuum_cleanup_index_scale_factor)} + offsetof(StdRdOptions, vacuum_cleanup_index_scale_factor)}, + {"vacuum_index_cleanup", RELOPT_TYPE_BOOL, + offsetof(StdRdOptions, vacuum_index_cleanup)} }; options = parseRelOptions(reloptions, validate, kind, &numoptions); |