From e3470f1eec139b9c5cbd76e15ec32c3fa9411004 Mon Sep 17 00:00:00 2001 From: cc_db_dev Date: Thu, 23 Mar 2023 16:17:26 +0800 Subject: [PATCH] =?UTF-8?q?IUD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去底噪优化、流程优化 --- src/bin/gs_guc/cluster_guc.conf | 1 + src/common/backend/nodes/makefuncs.cpp | 2 +- src/common/backend/parser/analyze.cpp | 22 +-- src/common/backend/parser/parse_collate.cpp | 10 +- src/common/backend/parser/parse_relation.cpp | 11 +- src/common/backend/utils/cache/lsyscache.cpp | 69 ++++++--- src/common/backend/utils/misc/guc.cpp | 13 ++ .../cbb/communication/comm_proxy/comm_proxy.h | 9 +- .../optimizer/commands/auto_explain.cpp | 10 +- src/gausskernel/optimizer/plan/createplan.cpp | 13 +- .../optimizer/plan/pgxcplan_single.cpp | 12 +- src/gausskernel/optimizer/plan/planner.cpp | 14 +- .../optimizer/prep/prepjointree.cpp | 8 +- src/gausskernel/optimizer/prep/prepunion.cpp | 10 +- .../optimizer/util/bucketpruning.cpp | 7 +- src/gausskernel/optimizer/util/nodegroups.cpp | 32 +++- src/gausskernel/optimizer/util/plancat.cpp | 12 +- src/gausskernel/process/postmaster/pgstat.cpp | 6 +- src/gausskernel/process/tcop/postgres.cpp | 14 +- src/gausskernel/runtime/executor/execMain.cpp | 141 +++++++++--------- .../runtime/executor/nodeModifyTable.cpp | 36 ++--- .../runtime/opfusion/opfusion_indexscan.cpp | 13 +- .../runtime/opfusion/opfusion_update.cpp | 2 +- .../vecexecutor/vecnode/vecmergeinto.cpp | 2 + .../vecexecutor/vecnode/vecmodifytable.cpp | 14 +- .../storage/access/heap/heapam.cpp | 18 ++- src/include/fmgr.h | 2 +- .../knl/knl_guc/knl_session_attr_common.h | 1 + src/include/nodes/nodes.h | 16 ++ src/include/nodes/relation.h | 1 + src/include/pgxc/pgxc.h | 4 + src/include/utils/rel_gs.h | 19 +++ src/test/regress/expected/auto_explain.out | 25 ---- .../regress/output/recovery_2pc_tools.source | 1 + src/test/regress/pg_regress.cpp | 2 +- 35 files changed, 352 insertions(+), 220 deletions(-) diff --git a/src/bin/gs_guc/cluster_guc.conf b/src/bin/gs_guc/cluster_guc.conf index 86d904f1e..bffabb1e6 100755 --- a/src/bin/gs_guc/cluster_guc.conf +++ b/src/bin/gs_guc/cluster_guc.conf @@ -679,6 +679,7 @@ sql_beta_feature|enum|partition_fdw_on,partition_opfusion,index_cost_with_leaf_p partition_iterator_elimination|bool|0,0|NULL|NULL| enable_functional_dependency|bool|0,0|NULL|NULL| enable_seqscan_fusion|bool|0,0|NULL|NULL| +enable_iud_fusion|bool|0,0|NULL|NULL| enable_indexscan_optimization|bool|0,0|NULL|NULL| max_logical_replication_workers|int|0,262143|NULL|Maximum number of logical replication worker processes.| max_sync_workers_per_subscription|int|0,262143|NULL|Maximum number of table synchronization workers per subscription.| diff --git a/src/common/backend/nodes/makefuncs.cpp b/src/common/backend/nodes/makefuncs.cpp index 30396d51b..9e9167f0c 100644 --- a/src/common/backend/nodes/makefuncs.cpp +++ b/src/common/backend/nodes/makefuncs.cpp @@ -72,7 +72,7 @@ A_Expr* makeSimpleA_Expr(A_Expr_Kind kind, char* name, Node* lexpr, Node* rexpr, */ Var* makeVar(Index varno, AttrNumber varattno, Oid vartype, int32 vartypmod, Oid varcollid, Index varlevelsup) { - Var* var = makeNode(Var); + Var* var = makeNodeFast(Var); var->varno = varno; var->varattno = varattno; diff --git a/src/common/backend/parser/analyze.cpp b/src/common/backend/parser/analyze.cpp index 82ba626a7..dbf2d5cf3 100644 --- a/src/common/backend/parser/analyze.cpp +++ b/src/common/backend/parser/analyze.cpp @@ -37,6 +37,7 @@ #include "utils/fmgroids.h" #include "utils/snapmgr.h" #endif +#include "catalog/pg_auth_history.h" #include "catalog/pg_type.h" #include "executor/node/nodeModifyTable.h" #include "foreign/foreign.h" @@ -1708,15 +1709,6 @@ static Query* transformInsertStmt(ParseState* pstate, InsertStmt* stmt) } } - /* - * Insert into relation pg_auth_history is not allowed. - * We update it only when some user's password has been changed. - */ - if (pg_strcasecmp(stmt->relation->relname, "pg_auth_history") == 0) { - ereport(ERROR, - (errcode(ERRCODE_INVALID_OPERATION), errmsg("Not allowed to insert into relation pg_auth_history."))); - } - /* process the WITH clause independently of all else */ if (stmt->withClause) { qry->hasRecursive = stmt->withClause->recursive; @@ -1771,6 +1763,15 @@ static Query* transformInsertStmt(ParseState* pstate, InsertStmt* stmt) qry->resultRelations = setTargetTables(pstate, list_make1(stmt->relation), false, false, targetPerms); targetrel = (Relation)linitial(pstate->p_target_relation); + /* + * Insert into relation pg_auth_history is not allowed. + * We update it only when some user's password has been changed. + */ + if (targetrel != NULL && RelationGetRelid(targetrel) == AuthHistoryRelationId) { + ereport(ERROR, + (errcode(ERRCODE_INVALID_OPERATION), errmsg("Not allowed to insert into relation pg_auth_history."))); + } + if (targetrel != NULL && ((unsigned int)RelationGetInternalMask(targetrel) & INTERNAL_MASK_DINSERT)) { ereport(ERROR, @@ -3953,7 +3954,7 @@ static void CheckUpdateRelation(Relation targetrel) errmsg("Un-support feature"), errdetail("internal relation doesn't allow UPDATE"))); } - +#ifdef ENABLE_MULTIPLE_NODES // check if the target relation is being redistributed in read only mode if (!u_sess->attr.attr_sql.enable_cluster_resize && targetrel != NULL && RelationInClusterResizingWriteErrorMode(targetrel)) { @@ -3961,6 +3962,7 @@ static void CheckUpdateRelation(Relation targetrel) (errcode(ERRCODE_READ_ONLY_SQL_TRANSACTION), errmsg("%s is redistributing, please retry later.", targetrel->rd_rel->relname.data))); } +#endif } void UpdateParseCheck(ParseState *pstate, Node *qry) diff --git a/src/common/backend/parser/parse_collate.cpp b/src/common/backend/parser/parse_collate.cpp index 97b656a57..de9b673fe 100644 --- a/src/common/backend/parser/parse_collate.cpp +++ b/src/common/backend/parser/parse_collate.cpp @@ -87,8 +87,8 @@ static void assign_ordered_set_collations(Aggref* aggref, assign_collations_cont * @in collatable: represent if the input is collatable * @in context: collation state */ -static void get_valid_collation(Oid& collation, CollateStrength& strength, int& location, Oid typcollation, - bool collatable, int expr_location, assign_collations_context context) +FORCE_INLINE static void get_valid_collation(Oid& collation, CollateStrength& strength, int& location, Oid typcollation, + bool collatable, const Node* node, assign_collations_context context) { if (OidIsValid(typcollation)) { /* typllation (comes from a node) is collatable; what about its input? */ @@ -106,7 +106,7 @@ static void get_valid_collation(Oid& collation, CollateStrength& strength, int& */ collation = typcollation; strength = COLLATE_IMPLICIT; - location = expr_location; + location = exprCollation(node); } } else { /* Node's result type isn't collatable. */ @@ -408,7 +408,7 @@ static bool assign_collations_walker(Node* node, assign_collations_context* cont location, typcollation, (typcollation == DEFAULT_COLLATION_OID) ? true : false, - exprLocation(node), + node, loccontext); /* @@ -607,7 +607,7 @@ static bool assign_collations_walker(Node* node, assign_collations_context* cont location, typcollation, (loccontext.strength > COLLATE_NONE) ? true : false, - exprLocation(node), + node, loccontext); /* diff --git a/src/common/backend/parser/parse_relation.cpp b/src/common/backend/parser/parse_relation.cpp index b573c5850..b65607bad 100755 --- a/src/common/backend/parser/parse_relation.cpp +++ b/src/common/backend/parser/parse_relation.cpp @@ -21,6 +21,7 @@ #include "access/tableam.h" #include "catalog/heap.h" #include "catalog/namespace.h" +#include "catalog/pg_auth_history.h" #include "catalog/pg_type.h" #include "funcapi.h" #include "nodes/makefuncs.h" @@ -999,7 +1000,7 @@ Relation parserOpenTable(ParseState *pstate, const RangeVar *relation, int lockm initStringInfo(&detailInfo); char *snapshot_name = strchr(relation->relname, DB4AI_SNAPSHOT_VERSION_DELIMITER); - if (snapshot_name) { + if (unlikely(snapshot_name)) { *snapshot_name = *u_sess->attr.attr_sql.db4ai_snapshot_version_delimiter; while (*(++snapshot_name)) { if (*snapshot_name == DB4AI_SNAPSHOT_VERSION_SEPARATOR) { @@ -1128,7 +1129,7 @@ Relation parserOpenTable(ParseState *pstate, const RangeVar *relation, int lockm TrForbidAccessRbObject(RelationRelationId, RelationGetRelid(rel), relation->relname); /* check wlm session info whether is valid in this database */ - if (!CheckWLMSessionInfoTableValid(relation->relname) && !u_sess->attr.attr_common.IsInplaceUpgrade) { + if (ENABLE_WORKLOAD_CONTROL && !CheckWLMSessionInfoTableValid(relation->relname) && !u_sess->attr.attr_common.IsInplaceUpgrade) { ereport(NOTICE, (errcode(ERRCODE_UNDEFINED_TABLE), errmsg("relation \"%s\" has data only in database \"postgres\"", relation->relname), @@ -1231,6 +1232,7 @@ RangeTblEntry* addRangeTableEntry(ParseState* pstate, RangeVar* relation, Alias* if (list_length(relation->partitionNameList) > 0) { GetPartitionOidListForRTE(rte, relation); } +#ifdef ENABLE_MULTIPLE_NODES if (!rte->relhasbucket && relation->isbucket) { ereport(ERROR, (errmsg("table is normal,cannot contains buckets(0,1,2...)"))); } @@ -1243,6 +1245,7 @@ RangeTblEntry* addRangeTableEntry(ParseState* pstate, RangeVar* relation, Alias* rte->isbucket = true; rte->buckets = RangeVarGetBucketList(relation); } +#endif #ifdef PGXC rte->relname = pstrdup(RelationGetRelationName(rel)); @@ -1926,7 +1929,7 @@ void addRTEtoQuery( { if (addToJoinList) { int rtindex = RTERangeTablePosn(pstate, rte, NULL); - RangeTblRef* rtr = makeNode(RangeTblRef); + RangeTblRef* rtr = makeNodeFast(RangeTblRef); rtr->rtindex = rtindex; pstate->p_joinlist = lappend(pstate->p_joinlist, rtr); @@ -3004,6 +3007,7 @@ static void setRteOrientation(Relation rel, RangeTblEntry* rte) { if (RelationIsCUFormat(rel)) { rte->orientation = REL_COL_ORIENTED; +#ifdef ENABLE_MULTIPLE_NODES } else if (RelationIsPAXFormat(rel)) { rte->orientation = REL_PAX_ORIENTED; @@ -3014,6 +3018,7 @@ static void setRteOrientation(Relation rel, RangeTblEntry* rte) } } else if(RelationIsTsStore(rel)) { rte->orientation = REL_TIMESERIES_ORIENTED; +#endif } else { rte->orientation = REL_ROW_ORIENTED; } diff --git a/src/common/backend/utils/cache/lsyscache.cpp b/src/common/backend/utils/cache/lsyscache.cpp index 61b734369..8f57178da 100644 --- a/src/common/backend/utils/cache/lsyscache.cpp +++ b/src/common/backend/utils/cache/lsyscache.cpp @@ -2170,16 +2170,34 @@ bool get_typbyval(Oid typid) */ void get_typlenbyval(Oid typid, int16* typlen, bool* typbyval) { - HeapTuple tp; - Form_pg_type typtup; - tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); - if (!HeapTupleIsValid(tp)) { - ereport(ERROR, (errcode(ERRCODE_CACHE_LOOKUP_FAILED), errmsg("cache lookup failed for type %u", typid))); + switch (typid) { + case INT4OID: + case DATEOID: { + *typlen = 4; + *typbyval = true; + } break; + case TIMESTAMPOID:{ + *typlen = 8; + *typbyval = true; + } break; + case BPCHAROID: + case VARCHAROID: { + *typlen = -1; + *typbyval = false; + } break; + default: { + HeapTuple tp; + Form_pg_type typtup; + tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); + if (!HeapTupleIsValid(tp)) { + ereport(ERROR, (errcode(ERRCODE_CACHE_LOOKUP_FAILED), errmsg("cache lookup failed for type %u", typid))); + } + typtup = (Form_pg_type)GETSTRUCT(tp); + *typlen = typtup->typlen; + *typbyval = typtup->typbyval; + ReleaseSysCache(tp); + } } - typtup = (Form_pg_type)GETSTRUCT(tp); - *typlen = typtup->typlen; - *typbyval = typtup->typbyval; - ReleaseSysCache(tp); } /* @@ -4464,16 +4482,29 @@ Oid get_typmodout(Oid typid) */ Oid get_typcollation(Oid typid) { - HeapTuple tp; - tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); - if (HeapTupleIsValid(tp)) { - Form_pg_type typtup = (Form_pg_type)GETSTRUCT(tp); - Oid result; - result = typtup->typcollation; - ReleaseSysCache(tp); - return result; - } else { - return InvalidOid; + switch (typid) { + case INT4OID: + case DATEOID: + case TIMESTAMPOID:{ + return InvalidOid; + } break; + case BPCHAROID: + case VARCHAROID: { + return DEFAULT_COLLATION_OID; + } break; + default: { + HeapTuple tp; + tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid)); + if (HeapTupleIsValid(tp)) { + Form_pg_type typtup = (Form_pg_type)GETSTRUCT(tp); + Oid result; + result = typtup->typcollation; + ReleaseSysCache(tp); + return result; + } else { + return InvalidOid; + } + } } } diff --git a/src/common/backend/utils/misc/guc.cpp b/src/common/backend/utils/misc/guc.cpp index 8259c9c99..5b2fff3f5 100755 --- a/src/common/backend/utils/misc/guc.cpp +++ b/src/common/backend/utils/misc/guc.cpp @@ -1867,6 +1867,19 @@ static void InitConfigureNamesBool() NULL, NULL }, + {{"enable_iud_fusion", + PGC_USERSET, + NODE_SINGLENODE, + QUERY_TUNING, + gettext_noop("Enable iud fusion"), + NULL}, + &u_sess->attr.attr_common.enable_iud_fusion, + false, + NULL, + NULL, + NULL, + NULL + }, #endif {{"enable_expr_fusion", PGC_USERSET, diff --git a/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.h b/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.h index edfaa51a1..9d49a24c9 100644 --- a/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.h +++ b/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.h @@ -40,6 +40,7 @@ #include #include #include "comm_connection.h" +#include "utils/guc.h" /*--------------------------Global Variables Declaretion-------------------------------*/ #define COMM_PROXY_DEBUG_LEVEL COMM_DEBUG1 @@ -109,9 +110,11 @@ typedef struct CommSendParam { int caller(Sys_send fn, unsigned long int reqid = 0) { int ret = fn(s_fd, buff, len, flags); - ereport(DEBUG4, (errmodule(MOD_COMM_PROXY), - errmsg("%s reqid[%016lu] comm_send: send comm_server_fd[%d], buff_char:%c, ret:%d, errno:%d, %m", - t_thrd.proxy_cxt.identifier, reqid, s_fd, ((char *)buff)[0], ret, errno))); + if ((SECUREC_UNLIKELY(log_min_messages <= DEBUG1))) { + ereport(DEBUG4, (errmodule(MOD_COMM_PROXY), + errmsg("%s reqid[%016lu] comm_send: send comm_server_fd[%d], buff_char:%c, ret:%d, errno:%d, %m", + t_thrd.proxy_cxt.identifier, reqid, s_fd, ((char *)buff)[0], ret, errno))); + } s_ret = ret; return ret; diff --git a/src/gausskernel/optimizer/commands/auto_explain.cpp b/src/gausskernel/optimizer/commands/auto_explain.cpp index 37039dfb4..304aabb27 100644 --- a/src/gausskernel/optimizer/commands/auto_explain.cpp +++ b/src/gausskernel/optimizer/commands/auto_explain.cpp @@ -154,12 +154,6 @@ static void explain_ExecutorFinish(QueryDesc *queryDesc) void opfusion_executeEnd(PlannedStmt* plannedstmt, const char *queryString, Snapshot snapshot) { - long secs; - int usecs; - int msecs; - TimestampDifference(GetCurrentStatementLocalStartTimestamp(), GetCurrentTimestamp(), &secs, &usecs); - msecs = usecs / 1000 + secs * 1000; - if (!auto_explain_enabled() || !instr_stmt_need_track_plan()) return; @@ -235,7 +229,7 @@ void print_parameters(const QueryDesc *queryDesc, ExplainState es) void exec_explain_plan(QueryDesc *queryDesc) { ExplainState es; - if (is_valid_query(queryDesc) && auto_explain_plan()) { + if (auto_explain_plan() && is_valid_query(queryDesc)) { INSTR_TIME_SET_CURRENT(plan_time); ExplainInitState(&es); es.costs = true; @@ -279,7 +273,7 @@ void exec_explain_plan(QueryDesc *queryDesc) } } void print_duration(const QueryDesc *queryDesc) { - if (is_valid_query(queryDesc) && auto_explain_plan()) { + if (auto_explain_plan() && is_valid_query(queryDesc)) { double time_diff = 0; time_diff += elapsed_time(&plan_time); ereport(u_sess->attr.attr_resource.auto_explain_level, diff --git a/src/gausskernel/optimizer/plan/createplan.cpp b/src/gausskernel/optimizer/plan/createplan.cpp index 19bed05b2..932a85b25 100755 --- a/src/gausskernel/optimizer/plan/createplan.cpp +++ b/src/gausskernel/optimizer/plan/createplan.cpp @@ -137,7 +137,9 @@ static TsStoreScan* make_tsstorescan(List* qptlist, List* qpqual, Index scanreli static PartIterator* create_partIterator_plan( PlannerInfo* root, PartIteratorPath* pIterpath, GlobalPartIterator* gpIter); static Plan* setPartitionParam(PlannerInfo* root, Plan* plan, RelOptInfo* rel); +#ifdef ENABLE_MULTIPLE_NODES static Plan* setBucketInfoParam(PlannerInfo* root, Plan* plan, RelOptInfo* rel); +#endif Plan* create_globalpartInterator_plan(PlannerInfo* root, PartIteratorPath* pIterpath); static IndexScan* make_indexscan(List* qptlist, List* qpqual, Index scanrelid, Oid indexid, List* indexqual, @@ -600,6 +602,7 @@ static Plan* create_scan_plan(PlannerInfo* root, Path* best_path) List* scan_clauses = NIL; Plan* plan = NULL; +#ifdef ENABLE_MULTIPLE_NODES /* * If planning is uner recursive CTE, we need check if we are going to generate * path that not supported with current Recursive-Execution mode. @@ -614,6 +617,7 @@ static Plan* create_scan_plan(PlannerInfo* root, Path* best_path) mark_stream_unsupport(); } } +#endif /* * For table scans, rather than using the relation targetlist (which is @@ -751,8 +755,9 @@ static Plan* create_scan_plan(PlannerInfo* root, Path* best_path) if (!CheckPathUseGlobalPartIndex(best_path)) { (void*)setPartitionParam(root, plan, best_path->parent); } +#ifdef ENABLE_MULTIPLE_NODES (void*)setBucketInfoParam(root, plan, best_path->parent); - +#endif /* * If there are any pseudoconstant clauses attached to this node, insert a * gating Result node that evaluates the pseudoconstants as one-time @@ -2617,10 +2622,12 @@ static Scan* create_indexscan_plan( best_path->indexinfo->indextlist, best_path->indexscandir, indexonly); +#ifdef ENABLE_MULTIPLE_NODES } else if (best_path->path.parent->orientation == REL_TIMESERIES_ORIENTED) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("Unsupported Index Scan FOR TIMESERIES."))); +#endif } else { if (indexonly) { scan_plan = (Scan*)make_indexonlyscan(tlist, @@ -9266,6 +9273,8 @@ static Plan* setPartitionParam(PlannerInfo* root, Plan* plan, RelOptInfo* rel) } return plan; } + +#ifdef ENABLE_MULTIPLE_NODES static Plan* setBucketInfoParam(PlannerInfo* root, Plan* plan, RelOptInfo* rel) { if (rel->bucketInfo != NULL) { @@ -9308,7 +9317,7 @@ static Plan* setBucketInfoParam(PlannerInfo* root, Plan* plan, RelOptInfo* rel) return plan; } - +#endif #ifdef PGXC /* * Wrapper functions to expose some functions to PGXC planner. These functions diff --git a/src/gausskernel/optimizer/plan/pgxcplan_single.cpp b/src/gausskernel/optimizer/plan/pgxcplan_single.cpp index 20bf88e43..1347d6c50 100755 --- a/src/gausskernel/optimizer/plan/pgxcplan_single.cpp +++ b/src/gausskernel/optimizer/plan/pgxcplan_single.cpp @@ -130,11 +130,13 @@ PlannedStmt* pgxc_planner(Query* query, int cursorOptions, ParamListInfo boundPa re_query = check_shippable(&stream_unsupport, query, &context); } else { - errno_t sprintf_rc = sprintf_s(u_sess->opt_cxt.not_shipping_info->not_shipping_reason, - NOTPLANSHIPPING_LENGTH, - "\"enable_stream_operator\" is off"); - securec_check_ss_c(sprintf_rc, "\0", "\0"); - output_unshipped_log(); + if (unlikely(u_sess->attr.attr_sql.enable_unshipping_log)) { + errno_t sprintf_rc = sprintf_s(u_sess->opt_cxt.not_shipping_info->not_shipping_reason, + NOTPLANSHIPPING_LENGTH, + "\"enable_stream_operator\" is off"); + securec_check_ss_c(sprintf_rc, "\0", "\0"); + output_unshipped_log(); + } set_stream_off(); } diff --git a/src/gausskernel/optimizer/plan/planner.cpp b/src/gausskernel/optimizer/plan/planner.cpp index d94dc470b..2dfd56ecc 100755 --- a/src/gausskernel/optimizer/plan/planner.cpp +++ b/src/gausskernel/optimizer/plan/planner.cpp @@ -652,6 +652,7 @@ PlannedStmt* standard_planner(Query* parse, int cursorOptions, ParamListInfo bou MemoryContextSwitchTo(old_context); +#ifdef ENABLE_MULTIPLE_NODES /* Are there OBS/HDFS ForeignScan node(s) in the plan tree? */ u_sess->opt_cxt.srvtype = T_INVALID; u_sess->opt_cxt.has_obsrel = has_dfs_node(top_plan, glob); @@ -667,7 +668,7 @@ PlannedStmt* standard_planner(Query* parse, int cursorOptions, ParamListInfo bou top_plan = try_accelerate_plan(top_plan, root, glob); } - +#endif /* * If creating a plan for a scrollable cursor, make sure it can run * backwards on demand. Add a Material node at the top at need. @@ -703,6 +704,7 @@ PlannedStmt* standard_planner(Query* parse, int cursorOptions, ParamListInfo bou */ top_plan = try_deparse_agg(top_plan, root, glob); +#ifdef ENABLE_MULTIPLE_NODES /* * just for cooperation analysis on source data cluster, * reassign dn list scaned of RemoteQuery node for the request from client cluster. @@ -723,7 +725,7 @@ PlannedStmt* standard_planner(Query* parse, int cursorOptions, ParamListInfo bou } materialize_remote_query(top_plan, &materialize, sort_to_store); } - +#endif /* * Handle subplan situation. * We have to put this under set_plan_references() function, @@ -958,11 +960,14 @@ PlannedStmt* standard_planner(Query* parse, int cursorOptions, ParamListInfo bou result->query_mem[1]))); } +#ifdef ENABLE_MULTIPLE_NODES /* data redistribution for DFS table. */ if (u_sess->attr.attr_sql.enable_cluster_resize && root->query_level == 1 && root->parse->commandType == CMD_INSERT) { result->dataDestRelIndex = root->dataDestRelIndex; - } else { + } else +#endif + { result->dataDestRelIndex = 0; } @@ -1515,6 +1520,7 @@ Plan* subquery_planner(PlannerGlobal* glob, Query* parse, PlannerInfo* parent_ro separate_rowmarks(root); #endif +#ifdef ENABLE_MULTIPLE_NODES /* * When the SQL dose not support stream mode in coordinator node, must send remotequery * to datanode, and need not expand dfs table into dfs main table and delta table. @@ -1526,7 +1532,7 @@ Plan* subquery_planner(PlannerGlobal* glob, Query* parse, PlannerInfo* parent_ro */ expand_dfs_tables(root); } - +#endif /* * Expand any rangetable entries that are inheritance sets into "append * relations". This can add entries to the rangetable, but they must be diff --git a/src/gausskernel/optimizer/prep/prepjointree.cpp b/src/gausskernel/optimizer/prep/prepjointree.cpp index a4c9a6620..cbcfac1c2 100755 --- a/src/gausskernel/optimizer/prep/prepjointree.cpp +++ b/src/gausskernel/optimizer/prep/prepjointree.cpp @@ -3642,8 +3642,8 @@ extern bool find_rownum_in_quals(PlannerInfo *root) return false; } - if(root->hasRownumQual) { - return true; + if(root->hasRownumQual || root->hasRownumCheck) { + return root->hasRownumQual; } bool hasRownum = false; @@ -3657,9 +3657,7 @@ extern bool find_rownum_in_quals(PlannerInfo *root) } } - if (quallist) { - list_free(quallist); - } + root->hasRownumCheck = true; return hasRownum; } diff --git a/src/gausskernel/optimizer/prep/prepunion.cpp b/src/gausskernel/optimizer/prep/prepunion.cpp index 9a255c5b0..18b7bb761 100644 --- a/src/gausskernel/optimizer/prep/prepunion.cpp +++ b/src/gausskernel/optimizer/prep/prepunion.cpp @@ -1452,17 +1452,15 @@ static void expand_inherited_rtentry(PlannerInfo* root, RangeTblEntry* rte, Inde } /* Fast path for common case of childless table */ parentOID = rte->relid; - parentRel = RelationIdGetRelation(parentOID); - if (parentRel == NULL) { - ereport(ERROR, (errmodule(MOD_OPT), errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("No Such Relation"))); - } - if (!has_subclass(parentOID)) { /* Clear flag before returning */ rte->inh = false; - RelationClose(parentRel); return; } + parentRel = RelationIdGetRelation(parentOID); + if (parentRel == NULL) { + ereport(ERROR, (errmodule(MOD_OPT), errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), errmsg("No Such Relation"))); + } RelationClose(parentRel); diff --git a/src/gausskernel/optimizer/util/bucketpruning.cpp b/src/gausskernel/optimizer/util/bucketpruning.cpp index f233e7c18..6113bc094 100644 --- a/src/gausskernel/optimizer/util/bucketpruning.cpp +++ b/src/gausskernel/optimizer/util/bucketpruning.cpp @@ -274,8 +274,9 @@ static BucketPruningResult* notPruningResult(BucketPruningResult* a, BucketPruni * @out RelOptInfo: the bucketinfo will set to rel->bucketInfo * @in RangeTblEntry: the user might have selected some buckets from sql stmt */ -void set_rel_bucketinfo(PlannerInfo* root, RelOptInfo* rel, RangeTblEntry* rte) +void FORCE_INLINE set_rel_bucketinfo(PlannerInfo* root, RelOptInfo* rel, RangeTblEntry* rte) { +#ifdef ENABLE_MULTIPLE_NODES /* add the bucketinfo to the rel */ if (rte->isbucket) { /* the user select the buckets from sql stmt */ @@ -289,7 +290,9 @@ void set_rel_bucketinfo(PlannerInfo* root, RelOptInfo* rel, RangeTblEntry* rte) /* the relation does not have underlying buckets */ rel->bucketInfo = NULL; } - +#else + rel->bucketInfo = NULL; +#endif return; } diff --git a/src/gausskernel/optimizer/util/nodegroups.cpp b/src/gausskernel/optimizer/util/nodegroups.cpp index d4f9db833..ecf8ef855 100644 --- a/src/gausskernel/optimizer/util/nodegroups.cpp +++ b/src/gausskernel/optimizer/util/nodegroups.cpp @@ -222,10 +222,9 @@ void ng_init_nodegroup_optimizer(Query* query) * it will be NULL if there is no 'in redistribution' group. */ u_sess->opt_cxt.in_redistribution_group_distribution = NULL; +#ifdef ENABLE_MULTIPLE_NODES u_sess->opt_cxt.in_redistribution_group_distribution = ng_get_in_redistribution_group_distribution(); - - /* Get installation group distribution */ - Distribution* installation_group_distribution = ng_get_installation_group_distribution(); +#endif /* * Init compute permission group distribution @@ -233,25 +232,36 @@ void ng_init_nodegroup_optimizer(Query* query) * so, in this mode, we set u_sess->opt_cxt.compute_permission_group_distribution, * and in other modes, we set u_sess->opt_cxt.compute_permission_group_distribution to NULL */ - ComputingNodeGroupMode cng_mode = ng_get_computing_nodegroup_mode(); u_sess->opt_cxt.compute_permission_group_distribution = NULL; +#ifdef ENABLE_MULTIPLE_NODES + ComputingNodeGroupMode cng_mode = ng_get_computing_nodegroup_mode(); if (CNG_MODE_COSTBASED_OPTIMAL == cng_mode) { u_sess->opt_cxt.compute_permission_group_distribution = ng_get_compute_permission_group_distribution(); } - +#endif /* * Get and set query union group distribution and check wheather base relations are in same group * 1. Get base relations' range table entry list * 2. Construct query union-set group */ + bool baserels_in_same_group = true; +#ifdef ENABLE_MULTIPLE_NODES FindBaserelRTEContext* findBaserelRTEContext = (FindBaserelRTEContext*)palloc0(sizeof(FindBaserelRTEContext)); (void)get_baserel_rte_list((Node*)query, findBaserelRTEContext); - bool baserels_in_same_group = true; u_sess->opt_cxt.query_union_set_group_distribution = ng_get_query_union_set_group_distribution(findBaserelRTEContext->baserel_rte_list, &baserels_in_same_group); pfree_ext(findBaserelRTEContext); +#else + /* must in same group */ + u_sess->opt_cxt.query_union_set_group_distribution = + ng_get_query_union_set_group_distribution(NULL, &baserels_in_same_group); + +#endif /* Check wheather it is a multiple node group scenario */ +#ifdef ENABLE_MULTIPLE_NODES + /* Get installation group distribution */ + Distribution* installation_group_distribution = ng_get_installation_group_distribution(); u_sess->opt_cxt.is_multiple_nodegroup_scenario = true; u_sess->opt_cxt.different_nodegroup_count = 2; if (baserels_in_same_group) { @@ -265,6 +275,10 @@ void ng_init_nodegroup_optimizer(Query* query) } } } +#else + u_sess->opt_cxt.is_multiple_nodegroup_scenario = false; + u_sess->opt_cxt.different_nodegroup_count = 1; +#endif u_sess->opt_cxt.single_node_distribution = NULL; /* Init dn gather's single node distribution */ @@ -382,12 +396,16 @@ char* ng_get_installation_group_name() * @return: * the oid of installation group */ -Oid ng_get_installation_group_oid() +Oid FORCE_INLINE ng_get_installation_group_oid() { +#ifdef ENABLE_MULTIPLE_NODES char* installation_group_name = ng_get_installation_group_name(); Oid oid = ng_get_group_groupoid(installation_group_name); return oid; +#else + return InvalidOid; +#endif } /* diff --git a/src/gausskernel/optimizer/util/plancat.cpp b/src/gausskernel/optimizer/util/plancat.cpp index 89201b938..961404387 100755 --- a/src/gausskernel/optimizer/util/plancat.cpp +++ b/src/gausskernel/optimizer/util/plancat.cpp @@ -670,7 +670,7 @@ void get_relation_info(PlannerInfo* root, Oid relationObjectId, bool inhparent, * than the table. */ if (info->indpred == NIL) { -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES /* * If parent relation is distributed the local storage manager * does not have actual information about index size. @@ -694,7 +694,7 @@ void get_relation_info(PlannerInfo* root, Oid relationObjectId, bool inhparent, info->pages = EstimatePartitionIndexPages(relation, indexRelation, sampledPartitionIds); } } -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES } #endif info->tuples = rel->tuples; @@ -767,7 +767,7 @@ void estimate_rel_size(Relation rel, int32* attr_widths, RelPageType* pages, dou switch (rel->rd_rel->relkind) { case RELKIND_RELATION: case RELKIND_MATVIEW: -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES /* * This is a remote table... we have no idea how many pages/rows * we may get from a scan of this table. However, we should set the @@ -855,11 +855,15 @@ void estimate_rel_size(Relation rel, int32* attr_widths, RelPageType* pages, dou */ curpages = rel->rd_rel->relpages; } else { +#ifdef ENABLE_MULTIPLE_NODES if (RELATION_CREATE_BUCKET(rel)) { curpages = RelationGetNumberOfBlocksInFork(rel, MAIN_FORKNUM, true); } else { +#endif curpages = RelationGetNumberOfBlocks(rel); +#ifdef ENABLE_MULTIPLE_NODES } +#endif } /* @@ -2024,9 +2028,11 @@ static void setRelStoreInfo(RelOptInfo* relOptInfo, Relation relation) AssertEreport(RelationIsCUFormat(relation), MOD_OPT, "Unexpected relation store format."); relOptInfo->orientation = REL_COL_ORIENTED; } +#ifdef ENABLE_MULTIPLE_NODES } else if(RelationIsTsStore(relation)) { relOptInfo->orientation = REL_TIMESERIES_ORIENTED; relOptInfo->relStoreLocation = LOCAL_STORE; +#endif } else { /* * This is a row store table. diff --git a/src/gausskernel/process/postmaster/pgstat.cpp b/src/gausskernel/process/postmaster/pgstat.cpp index 08f2cfc0c..6b0b2f54a 100644 --- a/src/gausskernel/process/postmaster/pgstat.cpp +++ b/src/gausskernel/process/postmaster/pgstat.cpp @@ -4218,9 +4218,11 @@ void pgstat_add_warning_hash_conflict() */ void pgstat_set_io_state(WorkloadManagerIOState iostate) { + if (!u_sess->attr.attr_common.pgstat_track_activities) + return; + volatile PgBackendStatus* beentry = t_thrd.shemem_ptr_cxt.MyBEEntry; - - if (!u_sess->attr.attr_common.pgstat_track_activities || (beentry == NULL)) + if (beentry == NULL) return; /* set current workload backend state */ diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index 1ddc7fbde..178113004 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -1508,9 +1508,9 @@ List* pg_plan_queries(List* querytrees, int cursorOptions, ParamListInfo boundPa output_utility_hint_warning((Node*)query, DEBUG1); } else { query->boundParamsQ = boundParams; - +#ifdef ENABLE_MULTIPLE_NODES bool is_insert_multiple_values = is_insert_multiple_values_query_in_gtmfree(query); - +#endif /* Temporarily apply SET hint using PG_TRY for later recovery */ int nest_level = apply_set_hint(query); PG_TRY(); @@ -1525,7 +1525,7 @@ List* pg_plan_queries(List* querytrees, int cursorOptions, ParamListInfo boundPa PG_END_TRY(); recover_set_hint(nest_level); - +#ifdef ENABLE_MULTIPLE_NODES /* When insert multiple values query is a generate plan, * we don't consider whether it can be executed on a single dn. * Because it can be executed on a single DN only in custom plan. @@ -1536,7 +1536,7 @@ List* pg_plan_queries(List* querytrees, int cursorOptions, ParamListInfo boundPa check_gtm_free_plan((PlannedStmt *)stmt, (u_sess->attr.attr_sql.explain_allow_multinode || ClusterResizingInProgress()) ? WARNING : ERROR); } - +#endif ps = (PlannedStmt*)stmt; check_plan_mergeinto_replicate(ps, ERROR); @@ -1549,8 +1549,10 @@ List* pg_plan_queries(List* querytrees, int cursorOptions, ParamListInfo boundPa t_thrd.time_cxt.is_abstimeout_in = false; - /* Set warning that no-analyzed relation name to log. */ - output_noanalyze_rellist_to_log(LOG); + if (!u_sess->attr.attr_common.enable_iud_fusion) { + /* Set warning that no-analyzed relation name to log. */ + output_noanalyze_rellist_to_log(LOG); + } return stmt_list; } diff --git a/src/gausskernel/runtime/executor/execMain.cpp b/src/gausskernel/runtime/executor/execMain.cpp index 1cbc5c8a8..494b55e8e 100755 --- a/src/gausskernel/runtime/executor/execMain.cpp +++ b/src/gausskernel/runtime/executor/execMain.cpp @@ -253,7 +253,9 @@ void standard_ExecutorStart(QueryDesc *queryDesc, int eflags) t_thrd.utils_cxt.mctx_sequent_count = 0; /* Initialize the memory tracking information */ - MemoryTrackingInit(); + if (u_sess->attr.attr_memory.memory_tracking_mode > MEMORY_TRACKING_NONE) { + MemoryTrackingInit(); + } /* * Build EState, switch into per-query memory context for startup. @@ -262,11 +264,13 @@ void standard_ExecutorStart(QueryDesc *queryDesc, int eflags) queryDesc->estate = estate; /* record the init memory track of the executor engine */ + if (u_sess->attr.attr_memory.memory_tracking_mode > MEMORY_TRACKING_NONE) { #ifndef ENABLE_MEMORY_CHECK - t_thrd.utils_cxt.ExecutorMemoryTrack = ((AllocSet)(estate->es_query_cxt))->track; + t_thrd.utils_cxt.ExecutorMemoryTrack = ((AllocSet)(estate->es_query_cxt))->track; #else - t_thrd.utils_cxt.ExecutorMemoryTrack = ((AsanSet)(estate->es_query_cxt))->track; + t_thrd.utils_cxt.ExecutorMemoryTrack = ((AsanSet)(estate->es_query_cxt))->track; #endif + } #ifndef ENABLE_MULTIPLE_NODES (void)InitStreamObject(queryDesc->plannedstmt); @@ -286,7 +290,7 @@ void standard_ExecutorStart(QueryDesc *queryDesc, int eflags) } /* CN of the compute pool. */ - if (StreamTopConsumerAmI() && queryDesc->instrument_options != 0 && IS_PGXC_COORDINATOR && + if (IS_PGXC_COORDINATOR && StreamTopConsumerAmI() && queryDesc->instrument_options != 0 && queryDesc->plannedstmt->in_compute_pool) { const int dop = 1; @@ -1323,74 +1327,75 @@ void InitPlan(QueryDesc *queryDesc, int eflags) * While we are at it, build the ExecRowMark list. */ estate->es_rowMarks = NIL; - uint64 plan_start_time = time(NULL); - foreach (l, plannedstmt->rowMarks) { - PlanRowMark *rc = (PlanRowMark *)lfirst(l); - Oid relid; - Relation relation = NULL; - ExecRowMark *erm = NULL; + if (plannedstmt->rowMarks) { + uint64 plan_start_time = time(NULL); + foreach (l, plannedstmt->rowMarks) { + PlanRowMark *rc = (PlanRowMark *)lfirst(l); + Oid relid; + Relation relation = NULL; + ExecRowMark *erm = NULL; - /* ignore "parent" rowmarks; they are irrelevant at runtime */ - if (rc->isParent) { - continue; + /* ignore "parent" rowmarks; they are irrelevant at runtime */ + if (rc->isParent) { + continue; + } + + /* + * If you change the conditions under which rel locks are acquired + * here, be sure to adjust ExecOpenScanRelation to match. + */ + switch (rc->markType) { + case ROW_MARK_EXCLUSIVE: + case ROW_MARK_NOKEYEXCLUSIVE: + case ROW_MARK_SHARE: + case ROW_MARK_KEYSHARE: + if (IS_PGXC_COORDINATOR || u_sess->pgxc_cxt.PGXCNodeId < 0 || + bms_is_member(u_sess->pgxc_cxt.PGXCNodeId, rc->bms_nodeids)) { + relid = getrelid(rc->rti, rangeTable); + relation = heap_open(relid, RowShareLock); + } + break; + case ROW_MARK_REFERENCE: + if (IS_PGXC_COORDINATOR || u_sess->pgxc_cxt.PGXCNodeId < 0 || + bms_is_member(u_sess->pgxc_cxt.PGXCNodeId, rc->bms_nodeids)) { + relid = getrelid(rc->rti, rangeTable); + relation = heap_open(relid, AccessShareLock); + } + break; + case ROW_MARK_COPY: + case ROW_MARK_COPY_DATUM: + /* there's no real table here ... */ + break; + default: + ereport(ERROR, (errcode(ERRCODE_UNRECOGNIZED_NODE_TYPE), + errmsg("unrecognized markType: %d when initializing query plan.", rc->markType))); + break; + } + + /* Check that relation is a legal target for marking */ + if (relation != NULL) { + CheckValidRowMarkRel(relation, rc->markType); + } + + erm = (ExecRowMark *)palloc(sizeof(ExecRowMark)); + erm->relation = relation; + erm->rti = rc->rti; + erm->prti = rc->prti; + erm->rowmarkId = rc->rowmarkId; + erm->markType = rc->markType; + erm->waitPolicy = rc->waitPolicy; + erm->waitSec = rc->waitSec; + erm->numAttrs = rc->numAttrs; + ItemPointerSetInvalid(&(erm->curCtid)); + estate->es_rowMarks = lappend(estate->es_rowMarks, erm); } - - /* - * If you change the conditions under which rel locks are acquired - * here, be sure to adjust ExecOpenScanRelation to match. - */ - switch (rc->markType) { - case ROW_MARK_EXCLUSIVE: - case ROW_MARK_NOKEYEXCLUSIVE: - case ROW_MARK_SHARE: - case ROW_MARK_KEYSHARE: - if (IS_PGXC_COORDINATOR || u_sess->pgxc_cxt.PGXCNodeId < 0 || - bms_is_member(u_sess->pgxc_cxt.PGXCNodeId, rc->bms_nodeids)) { - relid = getrelid(rc->rti, rangeTable); - relation = heap_open(relid, RowShareLock); - } - break; - case ROW_MARK_REFERENCE: - if (IS_PGXC_COORDINATOR || u_sess->pgxc_cxt.PGXCNodeId < 0 || - bms_is_member(u_sess->pgxc_cxt.PGXCNodeId, rc->bms_nodeids)) { - relid = getrelid(rc->rti, rangeTable); - relation = heap_open(relid, AccessShareLock); - } - break; - case ROW_MARK_COPY: - case ROW_MARK_COPY_DATUM: - /* there's no real table here ... */ - break; - default: - ereport(ERROR, (errcode(ERRCODE_UNRECOGNIZED_NODE_TYPE), - errmsg("unrecognized markType: %d when initializing query plan.", rc->markType))); - break; + uint64 plan_end_time = time(NULL); + if ((plan_end_time - plan_start_time) > THREAD_INTSERVAL_60S) { + ereport(WARNING, + (errmsg("InitPlan foreach plannedstmt->rowMarks takes %lus, plan_start_time:%lus, plan_end_time:%lus.", + plan_end_time - plan_start_time, plan_start_time, plan_end_time))); } - - /* Check that relation is a legal target for marking */ - if (relation != NULL) { - CheckValidRowMarkRel(relation, rc->markType); - } - - erm = (ExecRowMark *)palloc(sizeof(ExecRowMark)); - erm->relation = relation; - erm->rti = rc->rti; - erm->prti = rc->prti; - erm->rowmarkId = rc->rowmarkId; - erm->markType = rc->markType; - erm->waitPolicy = rc->waitPolicy; - erm->waitSec = rc->waitSec; - erm->numAttrs = rc->numAttrs; - ItemPointerSetInvalid(&(erm->curCtid)); - estate->es_rowMarks = lappend(estate->es_rowMarks, erm); } - uint64 plan_end_time = time(NULL); - if ((plan_end_time - plan_start_time) > THREAD_INTSERVAL_60S) { - ereport(WARNING, - (errmsg("InitPlan foreach plannedstmt->rowMarks takes %lus, plan_start_time:%lus, plan_end_time:%lus.", - plan_end_time - plan_start_time, plan_start_time, plan_end_time))); - } - /* * Initialize the executor's tuple table to empty. */ diff --git a/src/gausskernel/runtime/executor/nodeModifyTable.cpp b/src/gausskernel/runtime/executor/nodeModifyTable.cpp index e719b6321..b98b8a7fd 100644 --- a/src/gausskernel/runtime/executor/nodeModifyTable.cpp +++ b/src/gausskernel/runtime/executor/nodeModifyTable.cpp @@ -89,7 +89,6 @@ #include "gs_ledger/userchain.h" #ifdef PGXC -static TupleTableSlot* fill_slot_with_oldvals(TupleTableSlot* slot, HeapTupleHeader oldtuphd, Bitmapset* modifiedCols); static void RecoredGeneratedExpr(ResultRelInfo *resultRelInfo, EState *estate, CmdType cmdtype); /* Copied from trigger.c */ @@ -111,6 +110,7 @@ extern void HeapDeleteCStore(Relation relation, ItemPointer tid, Oid tableOid, S extern Oid pg_get_serial_sequence_oid(text* tablename, text* columnname); #ifdef ENABLE_MULTIPLE_NODES extern void HeapInsertTsStore(Relation relation, ResultRelInfo* resultRelInfo, HeapTuple tup, int option); +static TupleTableSlot* fill_slot_with_oldvals(TupleTableSlot* slot, HeapTupleHeader oldtuphd, Bitmapset* modifiedCols); #endif /* ENABLE_MULTIPLE_NODES */ /* check if set_dummy_tlist_references has set the dummy targetlist */ @@ -1081,7 +1081,7 @@ TupleTableSlot* ExecInsertT(ModifyTableState* state, TupleTableSlot* slot, Tuple */ tuple = tableam_tslot_get_tuple_from_slot(result_rel_info->ri_RelationDesc, slot); -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NDOES result_remote_rel = (RemoteQueryState*)estate->es_result_remoterel; #endif /* @@ -1657,7 +1657,7 @@ TupleTableSlot* ExecDelete(ItemPointer tupleid, Oid deletePartitionOid, int2 buc */ result_rel_info = estate->es_result_relation_info; result_relation_desc = result_rel_info->ri_RelationDesc; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES result_remote_rel = (RemoteQueryState*)estate->es_result_remoterel; #endif @@ -2074,7 +2074,7 @@ TupleTableSlot* ExecUpdate(ItemPointer tupleid, (errcode(ERRCODE_E_R_E_MODIFYING_SQL_DATA_NOT_PERMITTED), errmsg("cannot UPDATE during bootstrap")))); } -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES result_remote_rel = (RemoteQueryState*)estate->es_result_remoterel; /* @@ -3373,7 +3373,7 @@ static TupleTableSlot* ExecModifyTable(PlanState* state) ResultRelInfo* result_rel_info = NULL; PlanState* subPlanState = NULL; char* partExprKeyStr = NULL; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES PlanState* remote_rel_state = NULL; PlanState* insert_remote_rel_state = NULL; PlanState* update_remote_rel_state = NULL; @@ -3438,7 +3438,7 @@ static TupleTableSlot* ExecModifyTable(PlanState* state) /* Preload local variables */ result_rel_info = node->resultRelInfo + estate->result_rel_index; subPlanState = node->mt_plans[node->mt_whichplan]; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES /* Initialize remote plan state */ remote_rel_state = node->mt_remoterels[node->mt_whichplan]; insert_remote_rel_state = node->mt_insert_remoterels[node->mt_whichplan]; @@ -3453,12 +3453,12 @@ static TupleTableSlot* ExecModifyTable(PlanState* state) * CTE). So we have to save and restore the caller's value. */ saved_result_rel_info = estate->es_result_relation_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES saved_result_remote_rel = estate->es_result_remoterel; #endif estate->es_result_relation_info = result_rel_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = remote_rel_state; estate->es_result_insert_remoterel = insert_remote_rel_state; estate->es_result_update_remoterel = update_remote_rel_state; @@ -3532,7 +3532,7 @@ static TupleTableSlot* ExecModifyTable(PlanState* state) Assert(estate->result_rel_index == 0); if (node->mt_whichplan < node->mt_nplans) { subPlanState = node->mt_plans[node->mt_whichplan]; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES /* Move to next remote plan */ estate->es_result_remoterel = node->mt_remoterels[node->mt_whichplan]; remote_rel_state = node->mt_remoterels[node->mt_whichplan]; @@ -3691,7 +3691,7 @@ static TupleTableSlot* ExecModifyTable(PlanState* state) slot = ExecFilterJunk(junk_filter, slot); } -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = remote_rel_state; estate->es_result_insert_remoterel = insert_remote_rel_state; estate->es_result_update_remoterel = update_remote_rel_state; @@ -3745,7 +3745,7 @@ static TupleTableSlot* ExecModifyTable(PlanState* state) */ if (slot != NULL) { estate->es_result_relation_info = saved_result_rel_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = saved_result_remote_rel; #endif return slot; @@ -3757,7 +3757,7 @@ static TupleTableSlot* ExecModifyTable(PlanState* state) /* Restore es_result_relation_info before exiting */ estate->es_result_relation_info = saved_result_rel_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = saved_result_remote_rel; #endif @@ -3890,7 +3890,7 @@ ModifyTableState* ExecInitModifyTable(ModifyTable* node, EState* estate, int efl mt_state->mt_done = false; mt_state->mt_plans = (PlanState**)palloc0(sizeof(PlanState*) * nplans); -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NDOES mt_state->mt_remoterels = (PlanState**)palloc0(sizeof(PlanState*) * nplans); mt_state->mt_insert_remoterels = (PlanState**)palloc0(sizeof(PlanState*) * nplans); mt_state->mt_update_remoterels = (PlanState**)palloc0(sizeof(PlanState*) * nplans); @@ -3921,7 +3921,7 @@ ModifyTableState* ExecInitModifyTable(ModifyTable* node, EState* estate, int efl * sub-plan; ExecContextForcesOids depends on that! */ saved_result_rel_info = estate->es_result_relation_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NDOES saved_remote_rel_info = estate->es_result_remoterel; #endif @@ -4029,7 +4029,7 @@ ModifyTableState* ExecInitModifyTable(ModifyTable* node, EState* estate, int efl i++; } -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NDOES i = 0; foreach (l, node->plans) { @@ -4060,7 +4060,7 @@ ModifyTableState* ExecInitModifyTable(ModifyTable* node, EState* estate, int efl EvalPlanQualInit(&mt_state->mt_epqstate, estate, NULL, NIL, node->epqParam); estate->es_result_relation_info = saved_result_rel_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NDOES estate->es_result_remoterel = saved_remote_rel_info; #endif @@ -4450,7 +4450,7 @@ void ExecEndModifyTable(ModifyTableState* node) */ for (i = 0; i < node->mt_nplans; i++) { ExecEndNode(node->mt_plans[i]); -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NDOES ExecEndNode(node->mt_remoterels[i]); #endif } @@ -4467,7 +4467,7 @@ void ExecReScanModifyTable(ModifyTableState* node) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("ExecReScanModifyTable is not implemented")))); } -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NDOES /* * fill_slot_with_oldvals: diff --git a/src/gausskernel/runtime/opfusion/opfusion_indexscan.cpp b/src/gausskernel/runtime/opfusion/opfusion_indexscan.cpp index 03fc8b244..a61c0b6df 100644 --- a/src/gausskernel/runtime/opfusion/opfusion_indexscan.cpp +++ b/src/gausskernel/runtime/opfusion/opfusion_indexscan.cpp @@ -142,14 +142,15 @@ void IndexScanFusion::Init(long max_rows) *m_direction = NoMovementScanDirection; } - ScanState* scanstate = makeNode(ScanState); // need release - - scanstate->ps.plan = (Plan *)m_node; +#ifdef ENABLE_MULTIPLE_NODES /* * for hash bucket pruning with Global Plan cache, we should build a temp EState object * to passing param info which is used to cal buckets in further hbkt_idx_beginscan. */ if (ENABLE_GPC && RELATION_CREATE_BUCKET(m_rel)) { + ScanState* scanstate = makeNode(ScanState); // need release + + scanstate->ps.plan = (Plan *)m_node; EState tmpstate; tmpstate.es_param_list_info = m_params; scanstate->ps.state = &tmpstate; @@ -158,10 +159,12 @@ void IndexScanFusion::Init(long max_rows) m_scandesc = scan_handler_idx_beginscan(m_rel, m_index, GetActiveSnapshot(), m_keyNum, 0, scanstate); scanstate->ps.state = NULL; } else { +#endif /* add scanstate pointer ? */ - m_scandesc = scan_handler_idx_beginscan(m_rel, m_index, GetActiveSnapshot(), m_keyNum, 0, scanstate); + m_scandesc = scan_handler_idx_beginscan(m_rel, m_index, GetActiveSnapshot(), m_keyNum, 0, NULL); +#ifdef ENABLE_MULTIPLE_NODES } - +#endif if (m_scandesc) { scan_handler_idx_rescan_local(m_scandesc, m_keyNum > 0 ? m_scanKeys : NULL, m_keyNum, NULL, 0); diff --git a/src/gausskernel/runtime/opfusion/opfusion_update.cpp b/src/gausskernel/runtime/opfusion/opfusion_update.cpp index 355eb4cc2..abdb92ad4 100644 --- a/src/gausskernel/runtime/opfusion/opfusion_update.cpp +++ b/src/gausskernel/runtime/opfusion/opfusion_update.cpp @@ -598,7 +598,7 @@ bool UpdateFusion::execute(long max_rows, char *completionTag) Relation rel = ((m_local.m_scan->m_parentRel) == NULL ? m_local.m_scan->m_rel : m_local.m_scan->m_parentRel); - ResultRelInfo *result_rel_info = makeNode(ResultRelInfo); + ResultRelInfo *result_rel_info = makeNodeFast(ResultRelInfo); InitResultRelInfo(result_rel_info, rel, 1, 0); m_c_local.m_estate->es_result_relation_info = result_rel_info; m_c_local.m_estate->es_output_cid = GetCurrentCommandId(true); diff --git a/src/gausskernel/runtime/vecexecutor/vecnode/vecmergeinto.cpp b/src/gausskernel/runtime/vecexecutor/vecnode/vecmergeinto.cpp index 72552e1e4..49c901db5 100644 --- a/src/gausskernel/runtime/vecexecutor/vecnode/vecmergeinto.cpp +++ b/src/gausskernel/runtime/vecexecutor/vecnode/vecmergeinto.cpp @@ -176,8 +176,10 @@ void ExecVecMerge(VecModifyTableState* mtstate) result_rel_info = mtstate->resultRelInfo + mtstate->mt_whichplan; sub_plan_state = mtstate->mt_plans[mtstate->mt_whichplan]; +#ifdef ENABLE_MULTIPLE_NDOES /* Initialize remote plan state */ remote_rel_state = mtstate->mt_remoterels[mtstate->mt_whichplan]; +#endif junkfilter = result_rel_info->ri_junkFilter; result_relation_desc = result_rel_info->ri_RelationDesc; diff --git a/src/gausskernel/runtime/vecexecutor/vecnode/vecmodifytable.cpp b/src/gausskernel/runtime/vecexecutor/vecnode/vecmodifytable.cpp index 44db5d017..a74ec2c53 100644 --- a/src/gausskernel/runtime/vecexecutor/vecnode/vecmodifytable.cpp +++ b/src/gausskernel/runtime/vecexecutor/vecnode/vecmodifytable.cpp @@ -469,7 +469,7 @@ VectorBatch* ExecVecModifyTable(VecModifyTableState* node) Relation result_rel_desc; bool is_partitioned = false; PlanState* sub_plan_stat = NULL; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES PlanState* remote_rel_stat = NULL; PlanState* saved_result_remote_rel = NULL; #endif @@ -525,7 +525,7 @@ VectorBatch* ExecVecModifyTable(VecModifyTableState* node) /* Preload local variables */ result_rel_info = node->resultRelInfo + node->mt_whichplan; sub_plan_stat = node->mt_plans[node->mt_whichplan]; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES /* Initialize remote plan state */ remote_rel_stat = node->mt_remoterels[node->mt_whichplan]; #endif @@ -543,12 +543,12 @@ VectorBatch* ExecVecModifyTable(VecModifyTableState* node) * CTE). So we have to save and restore the caller's value. */ saved_result_rel_info = estate->es_result_relation_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES saved_result_remote_rel = estate->es_result_remoterel; #endif estate->es_result_relation_info = result_rel_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = remote_rel_stat; #endif @@ -605,7 +605,7 @@ VectorBatch* ExecVecModifyTable(VecModifyTableState* node) } } -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = remote_rel_stat; #endif switch (operation) { @@ -686,7 +686,7 @@ VectorBatch* ExecVecModifyTable(VecModifyTableState* node) */ if (batch != NULL) { estate->es_result_relation_info = saved_result_rel_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = saved_result_remote_rel; #endif return batch; @@ -757,7 +757,7 @@ VectorBatch* ExecVecModifyTable(VecModifyTableState* node) /* Restore es_result_relation_info before exiting */ estate->es_result_relation_info = saved_result_rel_info; -#ifdef PGXC +#ifdef ENABLE_MULTIPLE_NODES estate->es_result_remoterel = saved_result_remote_rel; #endif diff --git a/src/gausskernel/storage/access/heap/heapam.cpp b/src/gausskernel/storage/access/heap/heapam.cpp index e520de787..8ce9d05c3 100755 --- a/src/gausskernel/storage/access/heap/heapam.cpp +++ b/src/gausskernel/storage/access/heap/heapam.cpp @@ -4994,7 +4994,9 @@ TM_Result heap_update(Relation relation, Relation parentRelation, ItemPointer ot uint16 infomask_new_tuple; uint16 infomask2_new_tuple; int options = 0; +#ifdef ENABLE_MULTI_NODES bool rel_in_redis = RelationInClusterResizing(relation); +#endif OffsetNumber maxoff; BlockNumber rel_end_block = InvalidBlockNumber; char relreplident; @@ -5480,11 +5482,12 @@ l2: #ifdef PGXC newtup->t_xc_node_id = u_sess->pgxc_cxt.PGXCNodeIdentifier; #endif +#ifdef ENABLE_MULTIPLE_NODES if (rel_in_redis && !RelationInClusterResizingReadOnly(relation)) { options |= HEAP_INSERT_SKIP_FSM; rel_end_block = RelationGetEndBlock(relation); } - +#endif /* * Replace cid with a combo cid if necessary. Note that we already put * the plain cid into the new tuple. @@ -5515,7 +5518,11 @@ l2: pagefree = PageGetHeapFreeSpace(page); new_tup_size = MAXALIGN(newtup->t_len); - if (need_toast || new_tup_size > pagefree || rel_in_redis) { + if (need_toast || new_tup_size > pagefree +#ifdef ENABLE_MULTIPLE_NODES + || rel_in_redis +#endif + ) { /* Clear obsolete visibility flags ... */ oldtup.t_data->t_infomask &= ~HEAP_XMAX_BITS; oldtup.t_data->t_infomask2 &= ~(HEAP_XMAX_LOCK_ONLY | HEAP_KEYS_UPDATED); @@ -5566,7 +5573,12 @@ l2: * while not holding the lock on the old page, and we must rely on it * to get the locks on both pages in the correct order. */ - if (new_tup_size > pagefree || rel_in_redis) { + if (new_tup_size > pagefree +#ifdef ENABLE_MULTIPLE_NODES + || rel_in_redis +#endif + ) { + /* Assume there's no chance to put heaptup on same page. */ newbuf = RelationGetBufferForTuple( relation, heaptup->t_len, buffer, options, NULL, &vmbuffer_new, &vmbuffer, rel_end_block); diff --git a/src/include/fmgr.h b/src/include/fmgr.h index 62f2cab4f..1d8f64621 100644 --- a/src/include/fmgr.h +++ b/src/include/fmgr.h @@ -98,7 +98,7 @@ typedef struct FmgrInfo { * number of prealloced arguments to a function. * In deepsql (SVM and elastic_net), we cannot explicitly set all elements to false. */ -#define FUNC_PREALLOCED_ARGS 20 +#define FUNC_PREALLOCED_ARGS 10 typedef struct UDFInfoType { UDFArgsFuncType* UDFArgsHandlerPtr; /* UDF send/recv argument function */ diff --git a/src/include/knl/knl_guc/knl_session_attr_common.h b/src/include/knl/knl_guc/knl_session_attr_common.h index 357655cf5..3d11fe68e 100644 --- a/src/include/knl/knl_guc/knl_session_attr_common.h +++ b/src/include/knl/knl_guc/knl_session_attr_common.h @@ -233,6 +233,7 @@ typedef struct knl_session_attr_common { #ifndef ENABLE_MULTIPLE_NODES bool plsql_show_all_error; bool enable_seqscan_fusion; + bool enable_iud_fusion; #endif uint32 extension_session_vars_array_size; void** extension_session_vars_array; diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index 9136dbb9a..821f618b3 100755 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -868,6 +868,16 @@ typedef struct Node { _result->type = (tag); \ _result; \ }) + +#define newNodeNotZero(size, tag) \ + ({ \ + Node* _result; \ + AssertMacro((size) >= sizeof(Node)); /* need the tag, at least */ \ + _result = (Node*)palloc(size); \ + _result->type = (tag); \ + _result; \ + }) + #else // !FRONTEND_PARSER #define newNode(size, tag) \ ({ \ @@ -877,6 +887,8 @@ typedef struct Node { _result->type = (tag); \ _result; \ }) +#define newNodeNotZero(size, tag) newNode(size, tag) + #endif // !FRONTEND_PARSER #else @@ -885,9 +897,13 @@ typedef struct Node { t_thrd.utils_cxt.newNodeMacroHolder = (Node*)palloc0fast(size), \ t_thrd.utils_cxt.newNodeMacroHolder->type = (tag), \ t_thrd.utils_cxt.newNodeMacroHolder) + +#define newNodeNotZero(size, tag) newNode(size, tag) + #endif /* __GNUC__ */ #define makeNode(_type_) ((_type_*)newNode(sizeof(_type_), T_##_type_)) +#define makeNodeFast(_type_) ((_type_*)newNodeNotZero(sizeof(_type_), T_##_type_)) #define makeNodeWithSize(_type_, _size) ((_type_*)newNode(_size, T_##_type_)) #define NodeSetTag(nodeptr, t) (((Node*)(nodeptr))->type = (t)) diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index 737cc06be..983a7a30f 100755 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -465,6 +465,7 @@ typedef struct PlannerInfo { Bitmapset *param_upper; bool hasRownumQual; + bool hasRownumCheck; List *origin_tlist; struct PlannerTargets *planner_targets; } PlannerInfo; diff --git a/src/include/pgxc/pgxc.h b/src/include/pgxc/pgxc.h index 33eee922a..2659e5b19 100644 --- a/src/include/pgxc/pgxc.h +++ b/src/include/pgxc/pgxc.h @@ -48,7 +48,11 @@ typedef enum { #define IS_SERVICE_NODE (g_instance.role == VCOORDINATOR || g_instance.role == VSINGLENODE) #define IsConnFromApp() (u_sess->attr.attr_common.remoteConnType == REMOTE_CONN_APP) +#ifdef ENABLE_MULTIPLE_NODES #define IsConnFromCoord() (u_sess->attr.attr_common.remoteConnType == REMOTE_CONN_COORD) +#else +#define IsConnFromCoord() false +#endif #define IsConnFromDatanode() (u_sess->attr.attr_common.remoteConnType == REMOTE_CONN_DATANODE) #define IsConnFromGtm() (u_sess->attr.attr_common.remoteConnType == REMOTE_CONN_GTM) #define IsConnFromGtmProxy() (u_sess->attr.attr_common.remoteConnType == REMOTE_CONN_GTM_PROXY) diff --git a/src/include/utils/rel_gs.h b/src/include/utils/rel_gs.h index ae7f54507..130b1b5f8 100644 --- a/src/include/utils/rel_gs.h +++ b/src/include/utils/rel_gs.h @@ -376,9 +376,13 @@ static inline RedisHtlAction RelationGetAppendMode(Relation rel) * RelationIsPAXFormat * Return the relations' orientation. Pax format includes ORC format. */ +#ifdef ENABLE_MULTIPLE_NONDES #define RelationIsPAXFormat(relation) \ ((RELKIND_RELATION == relation->rd_rel->relkind) && \ pg_strcasecmp(RelationGetOrientation(relation), ORIENTATION_ORC) == 0) +#else +#define RelationIsPAXFormat(relation) (false) +#endif /* RelationIsColStore * Return relation whether is column store, which includes CU format and PAX format. @@ -386,9 +390,13 @@ static inline RedisHtlAction RelationGetAppendMode(Relation rel) #define RelationIsColStore(relation) \ ((RELKIND_RELATION == relation->rd_rel->relkind) && (RelationIsCUFormat(relation) || RelationIsPAXFormat(relation))) +#ifdef ENABLE_MULTIPLE_NODES #define RelationIsTsStore(relation) \ ((RELKIND_RELATION == relation->rd_rel->relkind) && \ pg_strcasecmp(RelationGetOrientation(relation), ORIENTATION_TIMESERIES) == 0) +#else +#define RelationIsTsStore(relation) (false) +#endif #define TsRelWithImplDistColumn(attribute, pos) \ (((attribute)[pos].attkvtype == ATT_KV_HIDE) && \ @@ -743,8 +751,10 @@ static inline bool IsCompressedByCmprsInPgclass(const RelCompressType cmprInPgcl #define RelationGetEndCtidInternal(relation) StdRdOptionsGetStringData((relation)->rd_options, end_ctid_internal, NULL) +#ifdef ENABLE_MULTIPLE_NODES #define RelationInRedistribute(relation) (REDIS_REL_NORMAL < (RelationGetAppendMode(relation)) ? true : false) + #define RelationInRedistributeReadOnly(relation) \ (REDIS_REL_READ_ONLY == (RelationGetAppendMode(relation)) ? true : false) @@ -753,7 +763,16 @@ static inline bool IsCompressedByCmprsInPgclass(const RelCompressType cmprInPgcl #define RelationIsRedistributeDest(relation) \ (REDIS_REL_DESTINATION == (RelationGetAppendMode(relation)) ? true : false) +#else +#define RelationInRedistribute(relation) (false) +#define RelationInRedistributeReadOnly(relation) (false) + +#define RelationInRedistributeEndCatchup(relation) (false) + +#define RelationIsRedistributeDest(relation) (false) + +#endif /* Get info */ #define RelationGetRelCnOid(relation) \ ((relation)->rd_options ? ((StdRdOptions*)(relation)->rd_options)->rel_cn_oid : InvalidOid) diff --git a/src/test/regress/expected/auto_explain.out b/src/test/regress/expected/auto_explain.out index afce8fca2..dd910747e 100644 --- a/src/test/regress/expected/auto_explain.out +++ b/src/test/regress/expected/auto_explain.out @@ -89,27 +89,20 @@ Query Text: prepare get_stu_info(varchar) as select stu.name,course.name,teache Name: datanode1 --?.* Output: stu.name, course.name, teacher.name ---?.* Hash Cond: (teacher.cno = course.cno) --?.* Output: teacher.tno, teacher.name, teacher.sex, teacher.cno - Exec Nodes: All datanodes --?.* Output: stu.name, course.name, course.cno - Exec Nodes: All datanodes --?.* Output: stu.name, course.name, course.cno - Exec Nodes: All datanodes Hash Cond: (course.cno = stu.cno) --?.* Output: course.cno, course.name - Exec Nodes: All datanodes --?.* Output: stu.name, stu.cno - Exec Nodes: All datanodes --?.* Output: stu.name, stu.cno - Exec Nodes: All datanodes Filter: ((stu.name)::text = ($1)::text) Parameter1 value: null @@ -197,10 +190,8 @@ Query Text: select count(1) from stu Name: datanode1 --?.* --?.* - Exec Nodes: All datanodes --?.* Output: sno, name, sex, cno - Exec Nodes: All datanodes CONTEXT: SQL statement "select count(1) from stu" @@ -227,10 +218,8 @@ Query Text: select count(2) from teacher Name: datanode1 --?.* --?.* - Exec Nodes: All datanodes --?.* Output: tno, name, sex, cno - Exec Nodes: All datanodes CONTEXT: SQL statement "select count(2) from teacher" @@ -258,7 +247,6 @@ Name: datanode1 --?.* --?.* Output: 4, 'liu'::character varying, 'F'::character varying, 1 - Exec Nodes: All datanodes CONTEXT: SQL statement "insert into stu values(4,'liu','F',1)" @@ -286,7 +274,6 @@ Name: datanode1 --?.* --?.* Output: 4, 'li'::character varying, '4'::character varying, NULL::integer - Exec Nodes: All datanodes CONTEXT: SQL statement "insert into teacher values(4,'li',4)" @@ -314,7 +301,6 @@ Name: datanode1 --?.* --?.* Output: 100, name, sex, cno, ctid - Exec Nodes: All datanodes Filter: (teacher.tno = 3) @@ -368,27 +354,20 @@ Query Text: select teacher.name,stu.name from teacher left join course on course Name: datanode1 --?.* Output: teacher.name, stu.name - Exec Nodes: All datanodes Hash Cond: (course.cno = stu.cno) --?.* Output: teacher.name, course.cno - Exec Nodes: All datanodes Hash Cond: (course.cno = teacher.cno) --?.* Output: course.cno, course.name - Exec Nodes: All datanodes --?.* Output: teacher.name, teacher.cno - Exec Nodes: All datanodes --?.* Output: teacher.name, teacher.cno - Exec Nodes: All datanodes --?.* Output: stu.name, stu.cno - Exec Nodes: All datanodes --?.* Output: stu.name, stu.cno - Exec Nodes: All datanodes CONTEXT: PL/pgSQL function complicate_process() line 22 at FETCH @@ -689,18 +668,14 @@ Name: datanode1 Update Cond: (t1.id = ($15)::numeric) --?.* Output: (count(*)), t1.id, t1.val, t1.ctid, (count(*)) - Exec Nodes: All datanodes Join Filter: ((count(*)) <> 0) --?.* Output: count(*) - Exec Nodes: All datanodes --?.* Output: test1.id, test1.val - Exec Nodes: All datanodes Filter: (test1.id = ($15)::numeric) --?.* Output: t1.id, t1.val, t1.ctid - Exec Nodes: All datanodes param1 value: 103 type: int4 diff --git a/src/test/regress/output/recovery_2pc_tools.source b/src/test/regress/output/recovery_2pc_tools.source index 9a40c0474..6bfb91a40 100644 --- a/src/test/regress/output/recovery_2pc_tools.source +++ b/src/test/regress/output/recovery_2pc_tools.source @@ -278,6 +278,7 @@ select name,vartype,unit,min_val,max_val from pg_settings where name <> 'qunit_c enable_instr_cpu_timer | bool | | | enable_instr_rt_percentile | bool | | | enable_instr_track_wait | bool | | | + enable_iud_fusion | bool | | | enable_kill_query | bool | | | enable_logical_io_statistics | bool | | | enable_material | bool | | | diff --git a/src/test/regress/pg_regress.cpp b/src/test/regress/pg_regress.cpp index a89937d0b..ed1d65b75 100644 --- a/src/test/regress/pg_regress.cpp +++ b/src/test/regress/pg_regress.cpp @@ -5461,7 +5461,7 @@ static void check_global_variables() } } -#define BASE_PGXC_LIKE_MACRO_NUM 1419 +#define BASE_PGXC_LIKE_MACRO_NUM 1392 static void check_pgxc_like_macros() { #ifdef BUILD_BY_CMAKE