postgresql/src/backend/optimizer/path
Tom Lane e3ffd05b02 Weaken the planner's tests for relevant joinclauses.
We should be willing to cross-join two small relations if that allows us
to use an inner indexscan on a large relation (that is, the potential
indexqual for the large table requires both smaller relations).  This
worked in simple cases but fell apart as soon as there was a join clause
to a fourth relation, because the existence of any two-relation join clause
caused the planner to not consider clauseless joins between other base
relations.  The added regression test shows an example case adapted from
a recent complaint from Benoit Delbosc.

Adjust have_relevant_joinclause, have_relevant_eclass_joinclause, and
has_relevant_eclass_joinclause to consider that a join clause mentioning
three or more relations is sufficient grounds for joining any subset of
those relations, even if we have to do so via a cartesian join.  Since such
clauses are relatively uncommon, this shouldn't affect planning speed on
typical queries; in fact it should help a bit, because the latter two
functions in particular get significantly simpler.

Although this is arguably a bug fix, I'm not going to risk back-patching
it, since it might have currently-unforeseen consequences.
2012-04-13 16:07:17 -04:00
..
allpaths.c Revise FDW planning API, again. 2012-03-09 12:49:25 -05:00
clausesel.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
costsize.c Fix cost estimation for indexscan filter conditions. 2012-04-11 20:24:17 -04:00
equivclass.c Weaken the planner's tests for relevant joinclauses. 2012-04-13 16:07:17 -04:00
indxpath.c Improve commentary in match_pathkeys_to_index(). 2012-03-16 14:07:21 -04:00
joinpath.c Use parameterized paths to generate inner indexscans more flexibly. 2012-01-27 19:26:38 -05:00
joinrels.c Weaken the planner's tests for relevant joinclauses. 2012-04-13 16:07:17 -04:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
orindxpath.c Use parameterized paths to generate inner indexscans more flexibly. 2012-01-27 19:26:38 -05:00
pathkeys.c Revisit handling of UNION ALL subqueries with non-Var output columns. 2012-03-16 13:11:55 -04:00
tidpath.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00