Merge pull request !3201 from cc_db_dev/iud_pr
This commit is contained in:
opengauss-bot
2023-05-24 01:56:36 +00:00
committed by Gitee
35 changed files with 352 additions and 220 deletions

View File

@ -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 */

View File

@ -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;

View File

@ -872,6 +872,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) \
({ \
@ -881,6 +891,8 @@ typedef struct Node {
_result->type = (tag); \
_result; \
})
#define newNodeNotZero(size, tag) newNode(size, tag)
#endif // !FRONTEND_PARSER
#else
@ -889,9 +901,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))

View File

@ -465,6 +465,7 @@ typedef struct PlannerInfo {
Bitmapset *param_upper;
bool hasRownumQual;
bool hasRownumCheck;
List *origin_tlist;
struct PlannerTargets *planner_targets;
} PlannerInfo;

View File

@ -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)

View File

@ -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)