aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/pathnode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r--src/backend/optimizer/util/pathnode.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c
index d465b9e2137..7aea30b306d 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -1230,15 +1230,14 @@ create_append_path(PlannerInfo *root,
/*
* When generating an Append path for a partitioned table, there may be
- * parameters that are useful so we can eliminate certain partitions
- * during execution. Here we'll go all the way and fully populate the
- * parameter info data as we do for normal base relations. However, we
- * need only bother doing this for RELOPT_BASEREL rels, as
- * RELOPT_OTHER_MEMBER_REL's Append paths are merged into the base rel's
- * Append subpaths. It would do no harm to do this, we just avoid it to
- * save wasting effort.
+ * parameterized quals that are useful for run-time pruning. Hence,
+ * compute path.param_info the same way as for any other baserel, so that
+ * such quals will be available for make_partition_pruneinfo(). (This
+ * would not work right for a non-baserel, ie a scan on a non-leaf child
+ * partition, and it's not necessary anyway in that case. Must skip it if
+ * we don't have "root", too.)
*/
- if (partitioned_rels != NIL && root && rel->reloptkind == RELOPT_BASEREL)
+ if (root && rel->reloptkind == RELOPT_BASEREL && IS_PARTITIONED_REL(rel))
pathnode->path.param_info = get_baserel_parampathinfo(root,
rel,
required_outer);