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

pgsql: Fix pull_up_sublinks' failure to handle nested pull-upopportuni

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix pull_up_sublinks' failure to handle nested pull-upopportuni
Date: 2011-05-02 19:57:40
Message-ID: E1QGzFU-000895-LR@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix pull_up_sublinks' failure to handle nested pull-up opportunities.

After finding an EXISTS or ANY sub-select that can be converted to a
semi-join or anti-join, we should recurse into the body of the sub-select.
This allows cases such as EXISTS-within-EXISTS to be optimized properly.
The original coding would leave the lower sub-select as a SubLink, which
is no better and often worse than what we can do with a join.  Per example
from Wayne Conrad.

Back-patch to 8.4.  There is a related issue in older versions' handling
of pull_up_IN_clauses, but they're lame enough anyway about the whole area
that it seems not worth the extra work to try to fix.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/dcc685debb02c507b88aa8052f9e6334a7c3f830

Modified Files
--------------
src/backend/optimizer/plan/subselect.c    |    5 +++
src/backend/optimizer/prep/prepjointree.c |   41 ++++++++++++++++++++++++++--
2 files changed, 43 insertions(+), 3 deletions(-)

pgsql-committers by date

Next:From: Alvaro HerreraDate: 2011-05-03 02:43:26
Subject: pgsql: Add ID attribute to some sect2's missing it
Previous:From: Alvaro HerreraDate: 2011-05-02 16:41:25
Subject: pgsql: Update some ALTER USER cross-references to ALTER ROLE

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