@@ -113,30 +113,27 @@ typedef struct PartitionTupleRouting
113
113
} PartitionTupleRouting ;
114
114
115
115
/*-----------------------
116
- * PartitionPruningData - Encapsulates all information required to support
117
- * elimination of partitions in plan types which support arbitrary Lists of
118
- * subplans. Information stored here allows the partition pruning functions
119
- * to be called and the return value of partition indexes translated into the
120
- * subpath indexes of plan types such as Append, thus allowing us to bypass a
121
- * subplan when we can prove that no tuple matching the 'pruning_steps' will
122
- * be found within.
116
+ * PartitionPruningData - Per-partitioned-table data for run-time pruning
117
+ * of partitions. For a multilevel partitioned table, we have one of these
118
+ * for the topmost partition plus one for each non-leaf child partition,
119
+ * ordered such that parents appear before their children.
123
120
*
124
- * subplan_map An array containing the subplan index which
125
- * matches this partition index, or -1 if the
126
- * subplan has been pruned already .
127
- * subpart_map An array containing the index into the
128
- * partprunedata array in PartitionPruneState , or
129
- * -1 if there is no such element in that array .
121
+ * subplan_map[] and subpart_map[] have the same definitions as in
122
+ * PartitionPruneInfo (see plannodes.h); though note that here,
123
+ * subpart_map contains indexes into PartitionPruneState.partprunedata[] .
124
+ *
125
+ * subplan_map Subplan index by partition index , or -1.
126
+ * subpart_map Subpart index by partition index, or -1 .
130
127
* present_parts A Bitmapset of the partition indexes that we
131
- * have subplans mapped for.
128
+ * have subplans or subparts for.
132
129
* context Contains the context details required to call
133
130
* the partition pruning code.
134
131
* pruning_steps List of PartitionPruneSteps used to
135
132
* perform the actual pruning.
136
133
* do_initial_prune true if pruning should be performed during
137
- * executor startup.
134
+ * executor startup (for this partitioning level) .
138
135
* do_exec_prune true if pruning should be performed during
139
- * executor run.
136
+ * executor run (for this partitioning level) .
140
137
*-----------------------
141
138
*/
142
139
typedef struct PartitionPruningData
@@ -152,16 +149,18 @@ typedef struct PartitionPruningData
152
149
153
150
/*-----------------------
154
151
* PartitionPruneState - State object required for plan nodes to perform
155
- * partition pruning elimination of their subplans. This encapsulates a
156
- * flattened hierarchy of PartitionPruningData structs.
152
+ * run-time partition pruning.
153
+ *
157
154
* This struct can be attached to plan types which support arbitrary Lists of
158
155
* subplans containing partitions to allow subplans to be eliminated due to
159
156
* the clauses being unable to match to any tuple that the subplan could
160
- * possibly produce.
157
+ * possibly produce. Note that we currently support only one partitioned
158
+ * table per parent plan node, hence partprunedata[] need describe only one
159
+ * partitioning hierarchy.
161
160
*
162
- * partprunedata Array of PartitionPruningData for the plan's target
163
- * partitioned relation. First element contains the
164
- * details for the target partitioned table.
161
+ * partprunedata Array of PartitionPruningData for the plan's
162
+ * partitioned relation, ordered such that parent tables
163
+ * appear before children (hence, topmost table is first) .
165
164
* num_partprunedata Number of items in 'partprunedata' array.
166
165
* do_initial_prune true if pruning should be performed during executor
167
166
* startup (at any hierarchy level).
0 commit comments