mirror of https://github.com/citusdata/citus.git
fixup! Introduces macros for vacuum options
parent
fddf4ca22d
commit
63b7a93a52
|
@ -886,7 +886,7 @@ columnar_vacuum_rel(Relation rel, VacuumParams *params,
|
||||||
int elevel = (params->options & VACOPT_VERBOSE) ? INFO : DEBUG2;
|
int elevel = (params->options & VACOPT_VERBOSE) ? INFO : DEBUG2;
|
||||||
|
|
||||||
/* this should have been resolved by vacuum.c until now */
|
/* this should have been resolved by vacuum.c until now */
|
||||||
Assert(params->truncate != VACOPTVALUE_UNSPECIFIED_COMPAT);
|
Assert(params->truncate != VACOPTVALUE_UNSPECIFIED);
|
||||||
|
|
||||||
LogRelationStats(rel, elevel);
|
LogRelationStats(rel, elevel);
|
||||||
|
|
||||||
|
@ -894,7 +894,7 @@ columnar_vacuum_rel(Relation rel, VacuumParams *params,
|
||||||
* We don't have updates, deletes, or concurrent updates, so all we
|
* We don't have updates, deletes, or concurrent updates, so all we
|
||||||
* care for now is truncating the unused space at the end of storage.
|
* care for now is truncating the unused space at the end of storage.
|
||||||
*/
|
*/
|
||||||
if (params->truncate == VACOPTVALUE_ENABLED_COMPAT)
|
if (params->truncate == VACOPTVALUE_ENABLED)
|
||||||
{
|
{
|
||||||
TruncateColumnar(rel, elevel);
|
TruncateColumnar(rel, elevel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,8 +39,8 @@
|
||||||
typedef struct CitusVacuumParams
|
typedef struct CitusVacuumParams
|
||||||
{
|
{
|
||||||
int options;
|
int options;
|
||||||
VacOptValue_compat truncate;
|
VacOptValue truncate;
|
||||||
VacOptValue_compat index_cleanup;
|
VacOptValue index_cleanup;
|
||||||
|
|
||||||
#if PG_VERSION_NUM >= PG_VERSION_13
|
#if PG_VERSION_NUM >= PG_VERSION_13
|
||||||
int nworkers;
|
int nworkers;
|
||||||
|
@ -346,8 +346,8 @@ DeparseVacuumStmtPrefix(CitusVacuumParams vacuumParams)
|
||||||
|
|
||||||
/* if no flags remain, exit early */
|
/* if no flags remain, exit early */
|
||||||
if (vacuumFlags == 0 &&
|
if (vacuumFlags == 0 &&
|
||||||
vacuumParams.truncate == VACOPTVALUE_UNSPECIFIED_COMPAT &&
|
vacuumParams.truncate == VACOPTVALUE_UNSPECIFIED &&
|
||||||
vacuumParams.index_cleanup == VACOPTVALUE_UNSPECIFIED_COMPAT
|
vacuumParams.index_cleanup == VACOPTVALUE_UNSPECIFIED
|
||||||
#if PG_VERSION_NUM >= PG_VERSION_13
|
#if PG_VERSION_NUM >= PG_VERSION_13
|
||||||
&& vacuumParams.nworkers == VACUUM_PARALLEL_NOTSET
|
&& vacuumParams.nworkers == VACUUM_PARALLEL_NOTSET
|
||||||
#endif
|
#endif
|
||||||
|
@ -389,18 +389,18 @@ DeparseVacuumStmtPrefix(CitusVacuumParams vacuumParams)
|
||||||
appendStringInfoString(vacuumPrefix, "SKIP_LOCKED,");
|
appendStringInfoString(vacuumPrefix, "SKIP_LOCKED,");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vacuumParams.truncate != VACOPTVALUE_UNSPECIFIED_COMPAT)
|
if (vacuumParams.truncate != VACOPTVALUE_UNSPECIFIED)
|
||||||
{
|
{
|
||||||
appendStringInfoString(vacuumPrefix,
|
appendStringInfoString(vacuumPrefix,
|
||||||
vacuumParams.truncate == VACOPTVALUE_ENABLED_COMPAT ?
|
vacuumParams.truncate == VACOPTVALUE_ENABLED ?
|
||||||
"TRUNCATE," : "TRUNCATE false,"
|
"TRUNCATE," : "TRUNCATE false,"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vacuumParams.index_cleanup != VACOPTVALUE_UNSPECIFIED_COMPAT)
|
if (vacuumParams.index_cleanup != VACOPTVALUE_UNSPECIFIED)
|
||||||
{
|
{
|
||||||
appendStringInfoString(vacuumPrefix,
|
appendStringInfoString(vacuumPrefix,
|
||||||
vacuumParams.index_cleanup == VACOPTVALUE_ENABLED_COMPAT ?
|
vacuumParams.index_cleanup == VACOPTVALUE_ENABLED ?
|
||||||
"INDEX_CLEANUP," : "INDEX_CLEANUP false,"
|
"INDEX_CLEANUP," : "INDEX_CLEANUP false,"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -506,8 +506,8 @@ VacuumStmtParams(VacuumStmt *vacstmt)
|
||||||
bool disable_page_skipping = false;
|
bool disable_page_skipping = false;
|
||||||
|
|
||||||
/* Set default value */
|
/* Set default value */
|
||||||
params.index_cleanup = VACOPTVALUE_UNSPECIFIED_COMPAT;
|
params.index_cleanup = VACOPTVALUE_UNSPECIFIED;
|
||||||
params.truncate = VACOPTVALUE_UNSPECIFIED_COMPAT;
|
params.truncate = VACOPTVALUE_UNSPECIFIED;
|
||||||
#if PG_VERSION_NUM >= PG_VERSION_13
|
#if PG_VERSION_NUM >= PG_VERSION_13
|
||||||
params.nworkers = VACUUM_PARALLEL_NOTSET;
|
params.nworkers = VACUUM_PARALLEL_NOTSET;
|
||||||
#endif
|
#endif
|
||||||
|
@ -551,13 +551,13 @@ VacuumStmtParams(VacuumStmt *vacstmt)
|
||||||
}
|
}
|
||||||
else if (strcmp(opt->defname, "index_cleanup") == 0)
|
else if (strcmp(opt->defname, "index_cleanup") == 0)
|
||||||
{
|
{
|
||||||
params.index_cleanup = defGetBoolean(opt) ? VACOPTVALUE_ENABLED_COMPAT :
|
params.index_cleanup = defGetBoolean(opt) ? VACOPTVALUE_ENABLED :
|
||||||
VACOPTVALUE_DISABLED_COMPAT;
|
VACOPTVALUE_DISABLED;
|
||||||
}
|
}
|
||||||
else if (strcmp(opt->defname, "truncate") == 0)
|
else if (strcmp(opt->defname, "truncate") == 0)
|
||||||
{
|
{
|
||||||
params.truncate = defGetBoolean(opt) ? VACOPTVALUE_ENABLED_COMPAT :
|
params.truncate = defGetBoolean(opt) ? VACOPTVALUE_ENABLED :
|
||||||
VACOPTVALUE_DISABLED_COMPAT;
|
VACOPTVALUE_DISABLED;
|
||||||
}
|
}
|
||||||
#if PG_VERSION_NUM >= PG_VERSION_13
|
#if PG_VERSION_NUM >= PG_VERSION_13
|
||||||
else if (strcmp(opt->defname, "parallel") == 0)
|
else if (strcmp(opt->defname, "parallel") == 0)
|
||||||
|
|
|
@ -40,10 +40,6 @@
|
||||||
#define FuncnameGetCandidates_compat(a, b, c, d, e, f, g) \
|
#define FuncnameGetCandidates_compat(a, b, c, d, e, f, g) \
|
||||||
FuncnameGetCandidates(a, b, c, d, e, f, g)
|
FuncnameGetCandidates(a, b, c, d, e, f, g)
|
||||||
#define expand_function_arguments_compat(a, b, c, d) expand_function_arguments(a, b, c, d)
|
#define expand_function_arguments_compat(a, b, c, d) expand_function_arguments(a, b, c, d)
|
||||||
#define VacOptValue_compat VacOptValue
|
|
||||||
#define VACOPTVALUE_UNSPECIFIED_COMPAT VACOPTVALUE_UNSPECIFIED
|
|
||||||
#define VACOPTVALUE_DISABLED_COMPAT VACOPTVALUE_DISABLED
|
|
||||||
#define VACOPTVALUE_ENABLED_COMPAT VACOPTVALUE_ENABLED
|
|
||||||
#define IsReindexWithParam_compat(reindex, param) IsReindexWithParam(reindex, param)
|
#define IsReindexWithParam_compat(reindex, param) IsReindexWithParam(reindex, param)
|
||||||
#define CopyFromState_compat CopyFromState
|
#define CopyFromState_compat CopyFromState
|
||||||
#define BeginCopyFrom_compat(a, b, c, d, e, f, g, h) BeginCopyFrom(a, b, c, d, e, f, g, h)
|
#define BeginCopyFrom_compat(a, b, c, d, e, f, g, h) BeginCopyFrom(a, b, c, d, e, f, g, h)
|
||||||
|
@ -73,10 +69,10 @@
|
||||||
#define FuncnameGetCandidates_compat(a, b, c, d, e, f, g) \
|
#define FuncnameGetCandidates_compat(a, b, c, d, e, f, g) \
|
||||||
FuncnameGetCandidates(a, b, c, d, e, g)
|
FuncnameGetCandidates(a, b, c, d, e, g)
|
||||||
#define expand_function_arguments_compat(a, b, c, d) expand_function_arguments(a, c, d)
|
#define expand_function_arguments_compat(a, b, c, d) expand_function_arguments(a, c, d)
|
||||||
#define VacOptValue_compat VacOptTernaryValue
|
#define VacOptValue VacOptTernaryValue
|
||||||
#define VACOPTVALUE_UNSPECIFIED_COMPAT VACOPT_TERNARY_DEFAULT
|
#define VACOPTVALUE_UNSPECIFIED VACOPT_TERNARY_DEFAULT
|
||||||
#define VACOPTVALUE_DISABLED_COMPAT VACOPT_TERNARY_DISABLED
|
#define VACOPTVALUE_DISABLED VACOPT_TERNARY_DISABLED
|
||||||
#define VACOPTVALUE_ENABLED_COMPAT VACOPT_TERNARY_ENABLED
|
#define VACOPTVALUE_ENABLED VACOPT_TERNARY_ENABLED
|
||||||
#define IsReindexWithParam_compat(reindex, param) \
|
#define IsReindexWithParam_compat(reindex, param) \
|
||||||
((strcmp(param, "concurrently") == 0) ? ((reindex)->concurrent) : \
|
((strcmp(param, "concurrently") == 0) ? ((reindex)->concurrent) : \
|
||||||
((strcmp(param, "verbose") == 0) ? ((reindex)->options == REINDEXOPT_VERBOSE) : \
|
((strcmp(param, "verbose") == 0) ? ((reindex)->options == REINDEXOPT_VERBOSE) : \
|
||||||
|
|
Loading…
Reference in New Issue