postgresql/src/backend/optimizer/util
Tom Lane 1b1d3d92c3 Remove ph_may_need from PlaceHolderInfo, with attendant simplifications.
The planner logic that attempted to make a preliminary estimate of the
ph_needed levels for PlaceHolderVars seems to be completely broken by
lateral references.  Fortunately, the potential join order optimization
that this code supported seems to be of relatively little value in
practice; so let's just get rid of it rather than trying to fix it.

Getting rid of this allows fairly substantial simplifications in
placeholder.c, too, so planning in such cases should be a bit faster.

Issue noted while pursuing bugs reported by Jeremy Evans and Antonin
Houska, though this doesn't in itself fix either of their reported cases.
What this does do is prevent an Assert crash in the kind of query
illustrated by the added regression test.  (I'm not sure that the plan for
that query is stable enough across platforms to be usable as a regression
test output ... but we'll soon find out from the buildfarm.)

Back-patch to 9.3.  The problem case can't arise without LATERAL, so
no need to touch older branches.
2013-08-14 18:38:47 -04:00
..
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
clauses.c Add SQL Standard WITH ORDINALITY support for UNNEST (and any other SRF) 2013-07-29 16:38:01 +01:00
joininfo.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pathnode.c pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
placeholder.c Remove ph_may_need from PlaceHolderInfo, with attendant simplifications. 2013-08-14 18:38:47 -04:00
plancat.c Arrange to cache FdwRoutine structs in foreign tables' relcache entries. 2013-03-06 23:48:09 -05:00
predtest.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
relnode.c Simplify query_planner's API by having it return the top-level RelOptInfo. 2013-08-05 15:01:09 -04:00
restrictinfo.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tlist.c Avoid inserting Result nodes that only compute identity projections. 2013-03-14 13:43:18 -04:00
var.c Change post-rewriter representation of dropped columns in joinaliasvars. 2013-07-23 16:23:45 -04:00