aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2019-04-04 14:58:53 -0400
committerRobert Haas <rhaas@postgresql.org>2019-04-04 15:04:43 -0400
commita96c41feec6b6616eb9d5baee9a9e08c20533c38 (patch)
tree8224a04fbe5c2165fd2ed18655aa63259c234ae4 /src/include/commands
parent74eb2176bf3ac7a2fae1282b4f4f1d000f3e6d78 (diff)
downloadpostgresql-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/include/commands')
-rw-r--r--src/include/commands/vacuum.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h
index 77086f3e913..9cc6e0d0235 100644
--- a/src/include/commands/vacuum.h
+++ b/src/include/commands/vacuum.h
@@ -149,6 +149,19 @@ typedef enum VacuumOption
} VacuumOption;
/*
+ * A ternary value used by vacuum parameters.
+ *
+ * DEFAULT value is used to determine the value based on other
+ * configurations, e.g. reloptions.
+ */
+typedef enum VacOptTernaryValue
+{
+ VACOPT_TERNARY_DEFAULT = 0,
+ VACOPT_TERNARY_DISABLED,
+ VACOPT_TERNARY_ENABLED,
+} VacOptTernaryValue;
+
+/*
* Parameters customizing behavior of VACUUM and ANALYZE.
*
* Note that at least one of VACOPT_VACUUM and VACOPT_ANALYZE must be set
@@ -167,6 +180,8 @@ typedef struct VacuumParams
int log_min_duration; /* minimum execution threshold in ms at
* which verbose logs are activated, -1
* to use default */
+ VacOptTernaryValue index_cleanup; /* Do index vacuum and cleanup,
+ * default value depends on reloptions */
} VacuumParams;
/* GUC parameters */