summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/commands/vacuum.h25
-rw-r--r--src/include/utils/rel.h10
2 files changed, 22 insertions, 13 deletions
diff --git a/src/include/commands/vacuum.h b/src/include/commands/vacuum.h
index cb27257bb65..bf3126aa9bb 100644
--- a/src/include/commands/vacuum.h
+++ b/src/include/commands/vacuum.h
@@ -185,17 +185,20 @@ typedef struct VacAttrStats
#define VACOPT_DISABLE_PAGE_SKIPPING 0x80 /* don't skip any pages */
/*
- * A ternary value used by vacuum parameters.
+ * Values used by index_cleanup and truncate params.
*
- * DEFAULT value is used to determine the value based on other
- * configurations, e.g. reloptions.
+ * VACOPTVALUE_UNSPECIFIED is used as an initial placeholder when VACUUM
+ * command has no explicit value. When that happens the final usable value
+ * comes from the corresponding reloption (though the reloption default is
+ * usually used).
*/
-typedef enum VacOptTernaryValue
+typedef enum VacOptValue
{
- VACOPT_TERNARY_DEFAULT = 0,
- VACOPT_TERNARY_DISABLED,
- VACOPT_TERNARY_ENABLED,
-} VacOptTernaryValue;
+ VACOPTVALUE_UNSPECIFIED = 0,
+ VACOPTVALUE_AUTO,
+ VACOPTVALUE_DISABLED,
+ VACOPTVALUE_ENABLED,
+} VacOptValue;
/*
* Parameters customizing behavior of VACUUM and ANALYZE.
@@ -216,10 +219,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 */
- VacOptTernaryValue truncate; /* Truncate empty pages at the end,
- * default value depends on reloptions */
+ VacOptValue index_cleanup; /* Do index vacuum and cleanup */
+ VacOptValue truncate; /* Truncate empty pages at the end */
/*
* The number of parallel vacuum workers. 0 by default which means choose
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index 774ac5b2b19..77d176a9348 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -307,6 +307,14 @@ typedef struct AutoVacOpts
float8 analyze_scale_factor;
} AutoVacOpts;
+/* StdRdOptions->vacuum_index_cleanup values */
+typedef enum StdRdOptIndexCleanup
+{
+ STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO = 0,
+ STDRD_OPTION_VACUUM_INDEX_CLEANUP_OFF,
+ STDRD_OPTION_VACUUM_INDEX_CLEANUP_ON
+} StdRdOptIndexCleanup;
+
typedef struct StdRdOptions
{
int32 vl_len_; /* varlena header (do not touch directly!) */
@@ -316,7 +324,7 @@ typedef struct StdRdOptions
AutoVacOpts autovacuum; /* autovacuum-related options */
bool user_catalog_table; /* use as an additional catalog relation */
int parallel_workers; /* max number of parallel workers */
- bool vacuum_index_cleanup; /* enables index vacuuming and cleanup */
+ StdRdOptIndexCleanup vacuum_index_cleanup; /* controls index vacuuming */
bool vacuum_truncate; /* enables vacuum to truncate a relation */
} StdRdOptions;