]> granicus.if.org Git - postgresql/commit
Suppress creation of backwardly-indexed paths for LATERAL join clauses.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Aug 2012 18:32:22 +0000 (14:32 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 30 Aug 2012 18:33:00 +0000 (14:33 -0400)
commit77387f0ac859c099c6ab669db1e7a852524696c4
treebd1de1f24e2b5b9f90e5c11eb18d11ba041eab77
parent35738b5906bb80bc4bb77ce1adea7dfbd3f64274
Suppress creation of backwardly-indexed paths for LATERAL join clauses.

Given a query such as

SELECT * FROM foo JOIN LATERAL (SELECT foo.var1) ss(x) ON ss.x = foo.var2

the existence of the join clause "ss.x = foo.var2" encourages indxpath.c to
build a parameterized path for foo using any index available for foo.var2.
This is completely useless activity, though, since foo has got to be on the
outside not the inside of any nestloop join with ss.  It's reasonably
inexpensive to add tests that prevent creation of such paths, so let's do
that.
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/path/indxpath.c
src/include/optimizer/paths.h