postgresql/src/include/optimizer
Tom Lane e6ae3b5dbf Add a concept of "placeholder" variables to the planner. These are variables
that represent some expression that we desire to compute below the top level
of the plan, and then let that value "bubble up" as though it were a plain
Var (ie, a column value).

The immediate application is to allow sub-selects to be flattened even when
they are below an outer join and have non-nullable output expressions.
Formerly we couldn't flatten because such an expression wouldn't properly
go to NULL when evaluated above the outer join.  Now, we wrap it in a
PlaceHolderVar and arrange for the actual evaluation to occur below the outer
join.  When the resulting Var bubbles up through the join, it will be set to
NULL if necessary, yielding the correct results.  This fixes a planner
limitation that's existed since 7.1.

In future we might want to use this mechanism to re-introduce some form of
Hellerstein's "expensive functions" optimization, ie place the evaluation of
an expensive function at the most suitable point in the plan tree.
2008-10-21 20:42:53 +00:00
..
clauses.h Improve the recently-added code for inlining set-returning functions so that 2008-10-09 19:27:40 +00:00
cost.h Implement SQL-standard WITH clauses, including WITH RECURSIVE. 2008-10-04 21:56:55 +00:00
geqo.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_copy.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_gene.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_misc.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_mutation.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_pool.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_random.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_recombination.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geqo_selection.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
joininfo.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
pathnode.h Implement SQL-standard WITH clauses, including WITH RECURSIVE. 2008-10-04 21:56:55 +00:00
paths.h Implement SEMI and ANTI joins in the planner and executor. (Semijoins replace 2008-08-14 18:48:00 +00:00
placeholder.h Add a concept of "placeholder" variables to the planner. These are variables 2008-10-21 20:42:53 +00:00
plancat.h Clean up the loose ends in selectivity estimation left by my patch for semi 2008-08-16 00:01:38 +00:00
planmain.h Extend CTE patch to support recursive UNION (ie, without ALL). The 2008-10-07 19:27:04 +00:00
planner.h Implement SQL-standard WITH clauses, including WITH RECURSIVE. 2008-10-04 21:56:55 +00:00
predtest.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
prep.h Improve sublink pullup code to handle ANY/EXISTS sublinks that are at top 2008-08-17 01:20:00 +00:00
restrictinfo.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
subselect.h Implement SQL-standard WITH clauses, including WITH RECURSIVE. 2008-10-04 21:56:55 +00:00
tlist.h Improve INTERSECT/EXCEPT hashing by realizing that we don't need to make any 2008-08-07 19:35:02 +00:00
var.h Add a concept of "placeholder" variables to the planner. These are variables 2008-10-21 20:42:53 +00:00