diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-06-10 16:30:14 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-06-10 16:30:14 -0400 |
commit | 939449de0e571b8c0b07674bb7095e06e93cc059 (patch) | |
tree | c0d6bd447ba9cebaccf5e4ecaa3e3c7f34a443d1 /src/backend/nodes/readfuncs.c | |
parent | 73b7f48f78d27b1baf1a6541cbaae0fe6bd6186d (diff) | |
download | postgresql-939449de0e571b8c0b07674bb7095e06e93cc059.tar.gz postgresql-939449de0e571b8c0b07674bb7095e06e93cc059.zip |
Relocate partition pruning structs to a saner place.
These struct definitions were originally dropped into primnodes.h,
which is a poor choice since that's mainly intended for primitive
expression node types; these are not in that category. What they
are is auxiliary info in Plan trees, so move them to plannodes.h.
For consistency, also relocate some related code that was apparently
placed with the aid of a dartboard.
There's no interesting code changes in this commit, just reshuffling.
David Rowley and Tom Lane
Discussion: https://postgr.es/m/CAFj8pRBjrufA3ocDm8o4LPGNye9Y+pm1b9kCwode4X04CULG3g@mail.gmail.com
Diffstat (limited to 'src/backend/nodes/readfuncs.c')
-rw-r--r-- | src/backend/nodes/readfuncs.c | 110 |
1 files changed, 57 insertions, 53 deletions
diff --git a/src/backend/nodes/readfuncs.c b/src/backend/nodes/readfuncs.c index da58aad4b32..f41e590a155 100644 --- a/src/backend/nodes/readfuncs.c +++ b/src/backend/nodes/readfuncs.c @@ -1328,52 +1328,6 @@ _readOnConflictExpr(void) READ_DONE(); } -static PartitionPruneStepOp * -_readPartitionPruneStepOp(void) -{ - READ_LOCALS(PartitionPruneStepOp); - - READ_INT_FIELD(step.step_id); - READ_INT_FIELD(opstrategy); - READ_NODE_FIELD(exprs); - READ_NODE_FIELD(cmpfns); - READ_BITMAPSET_FIELD(nullkeys); - - READ_DONE(); -} - -static PartitionPruneStepCombine * -_readPartitionPruneStepCombine(void) -{ - READ_LOCALS(PartitionPruneStepCombine); - - READ_INT_FIELD(step.step_id); - READ_ENUM_FIELD(combineOp, PartitionPruneCombineOp); - READ_NODE_FIELD(source_stepids); - - READ_DONE(); -} - -static PartitionPruneInfo * -_readPartitionPruneInfo(void) -{ - READ_LOCALS(PartitionPruneInfo); - - READ_OID_FIELD(reloid); - READ_NODE_FIELD(pruning_steps); - READ_BITMAPSET_FIELD(present_parts); - READ_INT_FIELD(nparts); - READ_INT_FIELD(nexprs); - READ_INT_ARRAY(subnode_map, local_node->nparts); - READ_INT_ARRAY(subpart_map, local_node->nparts); - READ_BOOL_ARRAY(hasexecparam, local_node->nexprs); - READ_BOOL_FIELD(do_initial_prune); - READ_BOOL_FIELD(do_exec_prune); - READ_BITMAPSET_FIELD(execparamids); - - READ_DONE(); -} - /* * Stuff from parsenodes.h. */ @@ -1506,6 +1460,10 @@ _readDefElem(void) } /* + * Stuff from plannodes.h. + */ + +/* * _readPlannedStmt */ static PlannedStmt * @@ -1651,9 +1609,9 @@ _readAppend(void) ReadCommonPlan(&local_node->plan); - READ_NODE_FIELD(partitioned_rels); READ_NODE_FIELD(appendplans); READ_INT_FIELD(first_partial_plan); + READ_NODE_FIELD(partitioned_rels); READ_NODE_FIELD(part_prune_infos); READ_DONE(); @@ -2365,6 +2323,52 @@ _readPlanRowMark(void) READ_DONE(); } +static PartitionPruneInfo * +_readPartitionPruneInfo(void) +{ + READ_LOCALS(PartitionPruneInfo); + + READ_OID_FIELD(reloid); + READ_NODE_FIELD(pruning_steps); + READ_BITMAPSET_FIELD(present_parts); + READ_INT_FIELD(nparts); + READ_INT_FIELD(nexprs); + READ_INT_ARRAY(subnode_map, local_node->nparts); + READ_INT_ARRAY(subpart_map, local_node->nparts); + READ_BOOL_ARRAY(hasexecparam, local_node->nexprs); + READ_BOOL_FIELD(do_initial_prune); + READ_BOOL_FIELD(do_exec_prune); + READ_BITMAPSET_FIELD(execparamids); + + READ_DONE(); +} + +static PartitionPruneStepOp * +_readPartitionPruneStepOp(void) +{ + READ_LOCALS(PartitionPruneStepOp); + + READ_INT_FIELD(step.step_id); + READ_INT_FIELD(opstrategy); + READ_NODE_FIELD(exprs); + READ_NODE_FIELD(cmpfns); + READ_BITMAPSET_FIELD(nullkeys); + + READ_DONE(); +} + +static PartitionPruneStepCombine * +_readPartitionPruneStepCombine(void) +{ + READ_LOCALS(PartitionPruneStepCombine); + + READ_INT_FIELD(step.step_id); + READ_ENUM_FIELD(combineOp, PartitionPruneCombineOp); + READ_NODE_FIELD(source_stepids); + + READ_DONE(); +} + /* * _readPlanInvalItem */ @@ -2619,12 +2623,6 @@ parseNodeString(void) return_value = _readFromExpr(); else if (MATCH("ONCONFLICTEXPR", 14)) return_value = _readOnConflictExpr(); - else if (MATCH("PARTITIONPRUNESTEPOP", 20)) - return_value = _readPartitionPruneStepOp(); - else if (MATCH("PARTITIONPRUNESTEPCOMBINE", 25)) - return_value = _readPartitionPruneStepCombine(); - else if (MATCH("PARTITIONPRUNEINFO", 18)) - return_value = _readPartitionPruneInfo(); else if (MATCH("RTE", 3)) return_value = _readRangeTblEntry(); else if (MATCH("RANGETBLFUNCTION", 16)) @@ -2725,6 +2723,12 @@ parseNodeString(void) return_value = _readNestLoopParam(); else if (MATCH("PLANROWMARK", 11)) return_value = _readPlanRowMark(); + else if (MATCH("PARTITIONPRUNEINFO", 18)) + return_value = _readPartitionPruneInfo(); + else if (MATCH("PARTITIONPRUNESTEPOP", 20)) + return_value = _readPartitionPruneStepOp(); + else if (MATCH("PARTITIONPRUNESTEPCOMBINE", 25)) + return_value = _readPartitionPruneStepCombine(); else if (MATCH("PLANINVALITEM", 13)) return_value = _readPlanInvalItem(); else if (MATCH("SUBPLAN", 7)) |