Skip site navigation (1) Skip section navigation (2)

pgsql: Suppress creation of backwardly-indexed paths for LATERAL joinc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Suppress creation of backwardly-indexed paths for LATERAL joinc
Date: 2012-08-30 18:33:20
Message-ID: E1T79YO-0006cQ-JI@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/77387f0ac859c099c6ab669db1e7a852524696c4

Modified Files
--------------
src/backend/optimizer/path/equivclass.c |   10 +++++++-
src/backend/optimizer/path/indxpath.c   |   41 ++++++++++++++++++++++++++----
src/include/optimizer/paths.h           |    3 +-
3 files changed, 46 insertions(+), 8 deletions(-)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2012-08-30 18:44:49
Subject: pgsql: Document that log_autovacuum_min_duration can be used tomonitor
Previous:From: Robert HaasDate: 2012-08-30 18:25:31
Subject: pgsql: Document how to prevent PostgreSQL itself from exhaustingmemory

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group