summaryrefslogtreecommitdiff
path: root/src/include/nodes/relation.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-12-09 18:54:25 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-12-09 18:54:25 -0500
commit7145d35c1727e12cc492c60a2c34392b5ed0dfa5 (patch)
treed94bbeffd28b31c334546f347a38231eaafeab25 /src/include/nodes/relation.h
parent56a79a5ae9fe1426b07f8ad986777829f19b4437 (diff)
Simplify LATERAL-related calculations within add_paths_to_joinrel().
While convincing myself that commit 7e19db0c09719d79 would solve both of the problems recently reported by Andreas Seltenreich, I realized that add_paths_to_joinrel's handling of LATERAL restrictions could be made noticeably simpler and faster if we were to retain the minimum possible parameterization for each joinrel (that is, the set of relids supplying unsatisfied lateral references in it). We already retain that for baserels, in RelOptInfo.lateral_relids, so we can use that field for joinrels too. This is a back-port of commit edca44b1525b3d591263d032dc4fe500ea771e0e. I originally intended not to back-patch that, but additional hacking in this area turns out to be needed, making it necessary not optional to compute lateral_relids for joinrels. In preparation for those fixes, sync the relevant code with HEAD as much as practical. (I did not risk rearranging fields of RelOptInfo in released branches, however.)
Diffstat (limited to 'src/include/nodes/relation.h')
-rw-r--r--src/include/nodes/relation.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index d5513ffb316..1cbc6b2ea9a 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -349,7 +349,7 @@ typedef struct PlannerInfo
* lateral_vars - lateral cross-references of rel, if any (list of
* Vars and PlaceHolderVars)
* lateral_relids - required outer rels for LATERAL, as a Relids set
- * (for child rels this can be more than lateral_vars)
+ * (this is now used for join rels too, but we won't move it till 9.5)
* lateral_referencers - relids of rels that reference this one laterally
* indexlist - list of IndexOptInfo nodes for relation's indexes
* (always NIL if it's not a table)
@@ -368,7 +368,7 @@ typedef struct PlannerInfo
* and fdw_private are filled during initial path creation.
*
* For otherrels that are appendrel members, these fields are filled
- * in just as for a baserel.
+ * in just as for a baserel, except we don't bother with lateral_vars.
*
* The presence of the remaining fields depends on the restrictions
* and joins that the relation participates in: