diff options
Diffstat (limited to 'src/include/nodes/plannodes.h')
-rw-r--r-- | src/include/nodes/plannodes.h | 117 |
1 files changed, 72 insertions, 45 deletions
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index d5c0ebe859..6ed765cbe4 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -38,10 +38,15 @@ * nodes; in such cases, commandType == CMD_UTILITY, the statement itself * is in the utilityStmt field, and the rest of the struct is mostly dummy. * (We do use canSetTag, stmt_location, stmt_len, and possibly queryId.) + * + * PlannedStmt, as well as all varieties of Plan, do not support equal(), + * not because it's not sensible but because we currently have no need. * ---------------- */ typedef struct PlannedStmt { + pg_node_attr(no_equal) + NodeTag type; CmdType commandType; /* select|insert|update|delete|merge|utility */ @@ -110,6 +115,8 @@ typedef struct PlannedStmt */ typedef struct Plan { + pg_node_attr(abstract, no_equal) + NodeTag type; /* @@ -286,16 +293,16 @@ typedef struct MergeAppend int numCols; /* their indexes in the target list */ - AttrNumber *sortColIdx; + AttrNumber *sortColIdx pg_node_attr(array_size(numCols)); /* OIDs of operators to sort them by */ - Oid *sortOperators; + Oid *sortOperators pg_node_attr(array_size(numCols)); /* OIDs of collations */ - Oid *collations; + Oid *collations pg_node_attr(array_size(numCols)); /* NULLS FIRST/LAST directions */ - bool *nullsFirst; + bool *nullsFirst pg_node_attr(array_size(numCols)); /* Info for run-time subplan pruning; NULL if we're not doing that */ struct PartitionPruneInfo *part_prune_info; @@ -322,11 +329,11 @@ typedef struct RecursiveUnion int numCols; /* their indexes in the target list */ - AttrNumber *dupColIdx; + AttrNumber *dupColIdx pg_node_attr(array_size(numCols)); /* equality operators to compare with */ - Oid *dupOperators; - Oid *dupCollations; + Oid *dupOperators pg_node_attr(array_size(numCols)); + Oid *dupCollations pg_node_attr(array_size(numCols)); /* estimated number of groups in input */ long numGroups; @@ -725,6 +732,12 @@ typedef struct CustomScan List *custom_private; /* private data for custom code */ List *custom_scan_tlist; /* optional tlist describing scan tuple */ Bitmapset *custom_relids; /* RTIs generated by this scan */ + + /* + * NOTE: The method field of CustomScan is required to be a pointer to a + * static table of callback functions. So we don't copy the table itself, + * just reference the original one. + */ const struct CustomScanMethods *methods; } CustomScan; @@ -758,6 +771,8 @@ typedef struct CustomScan */ typedef struct Join { + pg_node_attr(abstract) + Plan plan; JoinType jointype; bool inner_unique; @@ -783,6 +798,8 @@ typedef struct NestLoop typedef struct NestLoopParam { + pg_node_attr(no_equal) + NodeTag type; int paramno; /* number of the PARAM_EXEC Param to set */ Var *paramval; /* outer-relation Var to assign to Param */ @@ -812,16 +829,16 @@ typedef struct MergeJoin /* these are arrays, but have the same length as the mergeclauses list: */ /* per-clause OIDs of btree opfamilies */ - Oid *mergeFamilies; + Oid *mergeFamilies pg_node_attr(array_size(mergeclauses)); /* per-clause OIDs of collations */ - Oid *mergeCollations; + Oid *mergeCollations pg_node_attr(array_size(mergeclauses)); /* per-clause ordering (ASC or DESC) */ - int *mergeStrategies; + int *mergeStrategies pg_node_attr(array_size(mergeclauses)); /* per-clause nulls ordering */ - bool *mergeNullsFirst; + bool *mergeNullsFirst pg_node_attr(array_size(mergeclauses)); } MergeJoin; /* ---------------- @@ -863,10 +880,10 @@ typedef struct Memoize int numKeys; /* hash operators for each key */ - Oid *hashOperators; + Oid *hashOperators pg_node_attr(array_size(numKeys)); /* collations for each key */ - Oid *collations; + Oid *collations pg_node_attr(array_size(numKeys)); /* cache keys in the form of exprs containing parameters */ List *param_exprs; @@ -905,16 +922,16 @@ typedef struct Sort int numCols; /* their indexes in the target list */ - AttrNumber *sortColIdx; + AttrNumber *sortColIdx pg_node_attr(array_size(numCols)); /* OIDs of operators to sort them by */ - Oid *sortOperators; + Oid *sortOperators pg_node_attr(array_size(numCols)); /* OIDs of collations */ - Oid *collations; + Oid *collations pg_node_attr(array_size(numCols)); /* NULLS FIRST/LAST directions */ - bool *nullsFirst; + bool *nullsFirst pg_node_attr(array_size(numCols)); } Sort; /* ---------------- @@ -941,11 +958,11 @@ typedef struct Group int numCols; /* their indexes in the target list */ - AttrNumber *grpColIdx; + AttrNumber *grpColIdx pg_node_attr(array_size(numCols)); /* equality operators to compare with */ - Oid *grpOperators; - Oid *grpCollations; + Oid *grpOperators pg_node_attr(array_size(numCols)); + Oid *grpCollations pg_node_attr(array_size(numCols)); } Group; /* --------------- @@ -976,11 +993,11 @@ typedef struct Agg int numCols; /* their indexes in the target list */ - AttrNumber *grpColIdx; + AttrNumber *grpColIdx pg_node_attr(array_size(numCols)); /* equality operators to compare with */ - Oid *grpOperators; - Oid *grpCollations; + Oid *grpOperators pg_node_attr(array_size(numCols)); + Oid *grpCollations pg_node_attr(array_size(numCols)); /* estimated number of groups in input */ long numGroups; @@ -1015,25 +1032,25 @@ typedef struct WindowAgg int partNumCols; /* their indexes in the target list */ - AttrNumber *partColIdx; + AttrNumber *partColIdx pg_node_attr(array_size(partNumCols)); /* equality operators for partition columns */ - Oid *partOperators; + Oid *partOperators pg_node_attr(array_size(partNumCols)); /* collations for partition columns */ - Oid *partCollations; + Oid *partCollations pg_node_attr(array_size(partNumCols)); /* number of columns in ordering clause */ int ordNumCols; /* their indexes in the target list */ - AttrNumber *ordColIdx; + AttrNumber *ordColIdx pg_node_attr(array_size(ordNumCols)); /* equality operators for ordering columns */ - Oid *ordOperators; + Oid *ordOperators pg_node_attr(array_size(ordNumCols)); /* collations for ordering columns */ - Oid *ordCollations; + Oid *ordCollations pg_node_attr(array_size(ordNumCols)); /* frame_clause options, see WindowDef */ int frameOptions; @@ -1086,13 +1103,13 @@ typedef struct Unique int numCols; /* their indexes in the target list */ - AttrNumber *uniqColIdx; + AttrNumber *uniqColIdx pg_node_attr(array_size(numCols)); /* equality operators to compare with */ - Oid *uniqOperators; + Oid *uniqOperators pg_node_attr(array_size(numCols)); /* collations for equality comparisons */ - Oid *uniqCollations; + Oid *uniqCollations pg_node_attr(array_size(numCols)); } Unique; /* ------------ @@ -1137,16 +1154,16 @@ typedef struct GatherMerge int numCols; /* their indexes in the target list */ - AttrNumber *sortColIdx; + AttrNumber *sortColIdx pg_node_attr(array_size(numCols)); /* OIDs of operators to sort them by */ - Oid *sortOperators; + Oid *sortOperators pg_node_attr(array_size(numCols)); /* OIDs of collations */ - Oid *collations; + Oid *collations pg_node_attr(array_size(numCols)); /* NULLS FIRST/LAST directions */ - bool *nullsFirst; + bool *nullsFirst pg_node_attr(array_size(numCols)); /* * param id's of initplans which are referred at gather merge or one of @@ -1197,11 +1214,11 @@ typedef struct SetOp int numCols; /* their indexes in the target list */ - AttrNumber *dupColIdx; + AttrNumber *dupColIdx pg_node_attr(array_size(numCols)); /* equality operators to compare with */ - Oid *dupOperators; - Oid *dupCollations; + Oid *dupOperators pg_node_attr(array_size(numCols)); + Oid *dupCollations pg_node_attr(array_size(numCols)); /* where is the flag column, if any */ AttrNumber flagColIdx; @@ -1253,13 +1270,13 @@ typedef struct Limit int uniqNumCols; /* their indexes in the target list */ - AttrNumber *uniqColIdx; + AttrNumber *uniqColIdx pg_node_attr(array_size(uniqNumCols)); /* equality operators to compare with */ - Oid *uniqOperators; + Oid *uniqOperators pg_node_attr(array_size(uniqNumCols)); /* collations for equality comparisons */ - Oid *uniqCollations; + Oid *uniqCollations pg_node_attr(array_size(uniqNumCols)); } Limit; @@ -1345,6 +1362,8 @@ typedef enum RowMarkType */ typedef struct PlanRowMark { + pg_node_attr(no_equal) + NodeTag type; Index rti; /* range table index of markable relation */ Index prti; /* range table index of parent relation */ @@ -1389,6 +1408,8 @@ typedef struct PlanRowMark */ typedef struct PartitionPruneInfo { + pg_node_attr(no_equal) + NodeTag type; List *prune_infos; Bitmapset *other_subplans; @@ -1413,6 +1434,8 @@ typedef struct PartitionPruneInfo */ typedef struct PartitionedRelPruneInfo { + pg_node_attr(no_equal) + NodeTag type; /* RT index of partition rel for this level */ @@ -1425,13 +1448,13 @@ typedef struct PartitionedRelPruneInfo int nparts; /* subplan index by partition index, or -1 */ - int *subplan_map; + int *subplan_map pg_node_attr(array_size(nparts)); /* subpart index by partition index, or -1 */ - int *subpart_map; + int *subpart_map pg_node_attr(array_size(nparts)); /* relation OID by partition index, or 0 */ - Oid *relid_map; + Oid *relid_map pg_node_attr(array_size(nparts)); /* * initial_pruning_steps shows how to prune during executor startup (i.e., @@ -1454,6 +1477,8 @@ typedef struct PartitionedRelPruneInfo */ typedef struct PartitionPruneStep { + pg_node_attr(abstract, no_equal) + NodeTag type; int step_id; } PartitionPruneStep; @@ -1527,6 +1552,8 @@ typedef struct PartitionPruneStepCombine */ typedef struct PlanInvalItem { + pg_node_attr(no_equal) + NodeTag type; int cacheId; /* a syscache ID, see utils/syscache.h */ uint32 hashValue; /* hash value of object's cache lookup key */ |