forked from openGauss-Ecosystem/openGauss-server
根据是否开启向量化对向量化计划中的targetlist进行剪裁,只保留使用到列,以降低行转列时候的开销
This commit is contained in:
parent
041b338788
commit
c883406e78
|
@ -165,7 +165,7 @@ static void assign_convert_string_to_digit(bool newval, void* extra);
|
|||
static void AssignUStoreAttr(const char* newval, void* extra);
|
||||
static bool check_snapshot_delimiter(char** newval, void** extra, GucSource source);
|
||||
static bool check_snapshot_separator(char** newval, void** extra, GucSource source);
|
||||
|
||||
static void strategy_assign_vector_targetlist(int newval, void* extra);
|
||||
|
||||
static void InitSqlConfigureNamesBool();
|
||||
static void InitSqlConfigureNamesInt();
|
||||
|
@ -1616,6 +1616,18 @@ static void InitSqlConfigureNamesBool()
|
|||
NULL,
|
||||
NULL},
|
||||
#endif
|
||||
{{"enable_vector_targetlist",
|
||||
PGC_USERSET,
|
||||
NODE_ALL,
|
||||
QUERY_TUNING_OTHER,
|
||||
gettext_noop("enable vector targetlist for row to vector."),
|
||||
NULL},
|
||||
&u_sess->attr.attr_sql.enable_vector_targetlist,
|
||||
false,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
},
|
||||
/* End-of-list marker */
|
||||
{{NULL,
|
||||
(GucContext)0,
|
||||
|
@ -2577,7 +2589,6 @@ static void InitSqlConfigureNamesReal()
|
|||
NULL,
|
||||
NULL,
|
||||
NULL},
|
||||
|
||||
/* End-of-list marker */
|
||||
{{NULL,
|
||||
(GucContext)0,
|
||||
|
@ -2958,7 +2969,7 @@ static void InitSqlConfigureNamesEnum()
|
|||
OFF_VECTOR_ENGINE,
|
||||
vector_engine_strategy,
|
||||
NULL,
|
||||
NULL,
|
||||
strategy_assign_vector_targetlist,
|
||||
NULL},
|
||||
|
||||
/* End-of-list marker */
|
||||
|
@ -3463,3 +3474,14 @@ static bool check_snapshot_separator(char** newval, void** extra, GucSource sour
|
|||
return (strlen(*newval) == 1 && (!u_sess->attr.attr_sql.db4ai_snapshot_version_delimiter
|
||||
|| **newval != *u_sess->attr.attr_sql.db4ai_snapshot_version_delimiter));
|
||||
}
|
||||
|
||||
static void strategy_assign_vector_targetlist(int newval, void* extra)
|
||||
{
|
||||
if (newval == FORCE_VECTOR_ENGINE || newval == OPT_VECTOR_ENGINE)
|
||||
u_sess->attr.attr_sql.enable_vector_targetlist = true;
|
||||
else {
|
||||
u_sess->attr.attr_sql.enable_vector_targetlist = false;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5042,7 +5042,10 @@ static HashJoin* create_hashjoin_plan(PlannerInfo* root, HashPath* best_path, Pl
|
|||
disuse_physical_tlist(inner_plan, best_path->jpath.innerjoinpath);
|
||||
|
||||
/* If we expect batching, suppress excess columns in outer tuples too */
|
||||
if (best_path->num_batches > 1)
|
||||
if (best_path->num_batches > 1 ||
|
||||
(u_sess->attr.attr_sql.enable_vector_engine &&
|
||||
u_sess->attr.attr_sql.vectorEngineStrategy != OFF_VECTOR_ENGINE &&
|
||||
u_sess->attr.attr_sql.enable_vector_targetlist))
|
||||
disuse_physical_tlist(outer_plan, best_path->jpath.outerjoinpath);
|
||||
|
||||
/*
|
||||
|
|
|
@ -3281,7 +3281,10 @@ static Plan* grouping_planner(PlannerInfo* root, double tuple_fraction)
|
|||
*
|
||||
* We don't want any excess columns for hashagg, since we support hashagg write-out-to-disk now
|
||||
*/
|
||||
if (use_hashed_grouping)
|
||||
if (use_hashed_grouping ||
|
||||
(u_sess->attr.attr_sql.enable_vector_engine &&
|
||||
u_sess->attr.attr_sql.vectorEngineStrategy != OFF_VECTOR_ENGINE &&
|
||||
u_sess->attr.attr_sql.enable_vector_targetlist))
|
||||
disuse_physical_tlist(result_plan, best_path);
|
||||
|
||||
locate_grouping_columns(root, tlist, result_plan->targetlist, groupColIdx);
|
||||
|
|
|
@ -242,6 +242,7 @@ typedef struct knl_session_attr_sql {
|
|||
bool dolphin;
|
||||
bool enable_trace_column;
|
||||
double pre_detoast_var_factor;
|
||||
bool enable_vector_targetlist;
|
||||
} knl_session_attr_sql;
|
||||
|
||||
#endif /* SRC_INCLUDE_KNL_KNL_SESSION_ATTR_SQL */
|
||||
|
|
Loading…
Reference in New Issue