diff --git a/src/backend/partitioning/partprune.c b/src/backend/partitioning/partprune.c index 58ec2a684d..c39b618cee 100644 --- a/src/backend/partitioning/partprune.c +++ b/src/backend/partitioning/partprune.c @@ -188,7 +188,7 @@ static bool partkey_datum_from_expr(PartitionPruneContext *context, * pruning would be useless. */ List * -make_partition_pruneinfo(PlannerInfo *root, List *partition_rels, +make_partition_pruneinfo(PlannerInfo *root, List *partitioned_rels, List *subpaths, List *prunequal) { RelOptInfo *targetpart = NULL; @@ -218,9 +218,9 @@ make_partition_pruneinfo(PlannerInfo *root, List *partition_rels, relid_subnode_map[pathrel->relid] = i++; } - /* Likewise for the partition_rels */ + /* Likewise for the partitioned_rels */ i = 1; - foreach(lc, partition_rels) + foreach(lc, partitioned_res) { Index rti = lfirst_int(lc); @@ -229,8 +229,8 @@ make_partition_pruneinfo(PlannerInfo *root, List *partition_rels, relid_subpart_map[rti] = i++; } - /* We now build a PartitionPruneInfo for each partition_rels */ - foreach(lc, partition_rels) + /* We now build a PartitionPruneInfo for each partitioned_rels */ + foreach(lc, partitioned_rels) { Index rti = lfirst_int(lc); RelOptInfo *subpart = find_base_rel(root, rti); diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index f90aa7b2a1..6bec45a2a3 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -1593,7 +1593,7 @@ typedef struct PartitionPruneStepCombine typedef struct PartitionPruneInfo { NodeTag type; - Oid reloid; /* Oid of partition rel */ + Oid reloid; /* Oid of the partitioned table */ List *pruning_steps; /* List of PartitionPruneStep */ Bitmapset *present_parts; /* Indexes of all partitions which subnodes * are present for. */ diff --git a/src/include/partitioning/partprune.h b/src/include/partitioning/partprune.h index 3d114b4c71..ff034206f7 100644 --- a/src/include/partitioning/partprune.h +++ b/src/include/partitioning/partprune.h @@ -62,7 +62,8 @@ typedef struct PartitionPruneContext #define PruneCxtStateIdx(partnatts, step_id, keyno) \ ((partnatts) * (step_id) + (keyno)) -extern List *make_partition_pruneinfo(PlannerInfo *root, List *partition_rels, +extern List *make_partition_pruneinfo(PlannerInfo *root, + List *partitioned_rels, List *subpaths, List *prunequal); extern Relids prune_append_rel_partitions(RelOptInfo *rel); extern Bitmapset *get_matching_partitions(PartitionPruneContext *context,