postgresql/src/include/optimizer
Tom Lane 9ff79b9d4e Fix up planner infrastructure to support LATERAL properly.
This patch takes care of a number of problems having to do with failure
to choose valid join orders and incorrect handling of lateral references
pulled up from subqueries.  Notable changes:

* Add a LateralJoinInfo data structure similar to SpecialJoinInfo, to
represent join ordering constraints created by lateral references.
(I first considered extending the SpecialJoinInfo structure, but the
semantics are different enough that a separate data structure seems
better.)  Extend join_is_legal() and related functions to prevent trying
to form unworkable joins, and to ensure that we will consider joins that
satisfy lateral references even if the joins would be clauseless.

* Fill in the infrastructure needed for the last few types of relation scan
paths to support parameterization.  We'd have wanted this eventually
anyway, but it is necessary now because a relation that gets pulled up out
of a UNION ALL subquery may acquire a reltargetlist containing lateral
references, meaning that its paths *have* to be parameterized whether or
not we have any code that can push join quals down into the scan.

* Compute data about lateral references early in query_planner(), and save
in RelOptInfo nodes, to avoid repetitive calculations later.

* Assorted corner-case bug fixes.

There's probably still some bugs left, but this is a lot closer to being
real than it was before.
2012-08-26 22:50:23 -04:00
..
clauses.h Account for SRFs in targetlists in planner rowcount estimates. 2012-07-21 17:45:07 -04:00
cost.h Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
geqo_copy.h
geqo_gene.h
geqo_misc.h
geqo_mutation.h
geqo_pool.h
geqo_random.h
geqo_recombination.h
geqo_selection.h
geqo.h
joininfo.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
pathnode.h Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
paths.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
placeholder.h Revisit handling of UNION ALL subqueries with non-Var output columns. 2012-03-16 13:11:55 -04:00
plancat.h Fix planner to pass correct collation to operator selectivity estimators. 2012-07-08 23:51:08 -04:00
planmain.h Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
planner.h Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
predtest.h
prep.h More fixes for planner's handling of LATERAL. 2012-08-12 16:01:26 -04:00
restrictinfo.h Revise parameterized-path mechanism to fix assorted issues. 2012-04-19 15:53:47 -04:00
subselect.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
tlist.h
var.h Centralize the logic for detecting misplaced aggregates, window funcs, etc. 2012-08-10 11:36:15 -04:00