summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/allpaths.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-06-10 16:20:03 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-06-10 16:20:03 -0400
commit3303ea1a327b41d3b406d7be7a5ce2901e561066 (patch)
treed3efb62c93fa191a290e101a7766b2e0f58f27dd /src/backend/optimizer/path/allpaths.c
parent2f153ddfdd318b211590dd5585f65f357d85c2de (diff)
Remove reltarget_has_non_vars flag.
Commit b12fd41c6 added a "reltarget_has_non_vars" field to RelOptInfo, but failed to maintain it accurately. Since its only purpose was to skip calls to has_parallel_hazard() in the simple case where a rel's targetlist is all Vars, and that call is really pretty cheap in that case anyway, it seems like this is just a case of premature optimization. Let's drop the flag and do the calls unconditionally until it's proven that we need more smarts here.
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r--src/backend/optimizer/path/allpaths.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index ff5e39c1aad..cc8ba61bb0c 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -613,12 +613,10 @@ set_rel_consider_parallel(PlannerInfo *root, RelOptInfo *rel,
return;
/*
- * If the relation's outputs are not parallel-safe, we must give up. In
- * the common case where the relation only outputs Vars, this check is
- * very cheap; otherwise, we have to do more work.
+ * Likewise, if the relation's outputs are not parallel-safe, give up.
+ * (Usually, they're just Vars, but sometimes they're not.)
*/
- if (rel->reltarget_has_non_vars &&
- has_parallel_hazard((Node *) rel->reltarget->exprs, false))
+ if (has_parallel_hazard((Node *) rel->reltarget->exprs, false))
return;
/* We have a winner. */
@@ -984,7 +982,6 @@ set_append_rel_size(PlannerInfo *root, RelOptInfo *rel,
adjust_appendrel_attrs(root,
(Node *) rel->reltarget->exprs,
appinfo);
- childrel->reltarget_has_non_vars = rel->reltarget_has_non_vars;
/*
* We have to make child entries in the EquivalenceClass data