!6678 添加GUC参数控制B库下创建分区表默认表现为LOCAL

Merge pull request !6678 from zhubin79/local_index
This commit is contained in:
opengauss_bot
2024-11-18 11:26:06 +00:00
committed by Gitee
4 changed files with 20 additions and 2 deletions

View File

@ -839,6 +839,7 @@ uwal_truncate_interval|int|0,7200|NULL|NULL|
uwal_async_append_switch|bool|0,0|NULL|NULL|
enable_gazelle_performance_mode|bool|0,0|NULL|NULL|
enable_aggr_coerce_type|bool|0,0|NULL|NULL|
enable_default_local_index|bool|0,0|NULL|NULL|
[cmserver]
log_dir|string|0,0|NULL|NULL|
log_file_size|int|0,2047|MB|NULL|

View File

@ -2155,6 +2155,17 @@ static void InitConfigureNamesBool()
NULL,
NULL,
NULL},
{{"enable_default_local_index",
PGC_USERSET,
NODE_ALL,
ERROR_HANDLING_OPTIONS,
gettext_noop("Enable create index default behavior is local index"),
NULL},
&u_sess->attr.attr_sql.enable_default_local_index,
false,
NULL,
NULL,
NULL},
#ifdef ENABLE_HTAP
{{"enable_parallel_populate",
PGC_USERSET,

View File

@ -536,8 +536,13 @@ void SetPartionIndexType(IndexStmt* stmt, Relation rel, bool is_alter_table)
stmt->isGlobal = !CheckIdxParamsOwnPartKey(rel, stmt->indexParams);
}
} else if (!stmt->isPartitioned) {
/* default partition index is set to Global index */
stmt->isGlobal = (!DEFAULT_CREATE_LOCAL_INDEX ? true : stmt->isGlobal);
/*
* default partition index is set to Global index.
* if B compatibility and enable_default_local_index is true, set Local index.
*/
if (!DEFAULT_CREATE_LOCAL_INDEX
&& !(DB_IS_CMPT(B_FORMAT) && u_sess->attr.attr_sql.enable_default_local_index))
stmt->isGlobal = true;
}
stmt->isPartitioned = true;
#ifndef ENABLE_MULTIPLE_NODES

View File

@ -268,6 +268,7 @@ typedef struct knl_session_attr_sql {
bool dolphin;
bool whale;
bool enable_vector_targetlist;
bool enable_default_local_index;
#endif
} knl_session_attr_sql;