postgresql/src/backend/optimizer/path
Tom Lane 3b8968f252 Rethink heuristics for choosing index quals for parameterized paths.
Some experimentation with examples similar to bug #7539 has convinced me
that indxpath.c's original implementation of parameterized-path generation
was several bricks shy of a load.  In general, if we are relying on a
particular outer rel or set of outer rels for a parameterized path, the
path should use every indexable join clause that's available from that rel
or rels.  Any join clauses that get left out of the indexqual will end up
getting applied as plain filter quals (qpquals), and that's generally a
significant loser compared to having the index AM enforce them.  (This is
particularly true with btree, which can skip the index scan entirely if
it can see that the given indexquals are mutually contradictory.)  The
original heuristics failed to ensure this, though, and were overly
complicated anyway.  Rewrite to make the code explicitly identify each
useful set of outer rels and then select all applicable join clauses for
each one.  The one plan that changes in the regression tests is in fact
for the better according to the planner's cost estimates.

(Note: this is not a correctness issue but just a matter of plan quality.
I don't yet know what is going on in bug #7539, but I don't expect this
change to fix that.)
2012-09-16 17:58:09 -04:00
..
allpaths.c Fix PARAM_EXEC assignment mechanism to be safe in the presence of WITH. 2012-09-05 12:55:01 -04:00
clausesel.c Fix planner to pass correct collation to operator selectivity estimators. 2012-07-08 23:51:08 -04:00
costsize.c Split tuple struct defs from htup.h to htup_details.h 2012-08-30 16:52:35 -04:00
equivclass.c Suppress creation of backwardly-indexed paths for LATERAL join clauses. 2012-08-30 14:33:00 -04:00
indxpath.c Rethink heuristics for choosing index quals for parameterized paths. 2012-09-16 17:58:09 -04:00
joinpath.c Adjust definition of cheapest_total_path to work better with LATERAL. 2012-08-29 22:06:07 -04:00
joinrels.c Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
orindxpath.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pathkeys.c Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
tidpath.c Fix up planner infrastructure to support LATERAL properly. 2012-08-26 22:50:23 -04:00