forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3b8968f
committed
Rethink heuristics for choosing index quals for parameterized paths.
Some experimentation with examples similar to bug #7539 has convinced methat indxpath.c's original implementation of parameterized-path generationwas several bricks shy of a load. In general, if we are relying on aparticular outer rel or set of outer rels for a parameterized path, thepath should use every indexable join clause that's available from that relor rels. Any join clauses that get left out of the indexqual will end upgetting applied as plain filter quals (qpquals), and that's generally asignificant loser compared to having the index AM enforce them. (This isparticularly true with btree, which can skip the index scan entirely ifit can see that the given indexquals are mutually contradictory.) Theoriginal heuristics failed to ensure this, though, and were overlycomplicated anyway. Rewrite to make the code explicitly identify eachuseful set of outer rels and then select all applicable join clauses foreach one. The one plan that changes in the regression tests is in factfor 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 thischange to fix that.)1 parent64e196b commit3b8968f
File tree
3 files changed
+219
-160
lines changed- src
- backend/optimizer/path
- test/regress
- expected
- sql
3 files changed
+219
-160
lines changed0 commit comments
Comments
(0)