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

pgsql: Improve sublink pullup code to handle ANY/EXISTS sublinks that

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve sublink pullup code to handle ANY/EXISTS sublinks that
Date: 2008-08-17 01:20:00
Message-ID: 20080817012000.A6753755315@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Improve sublink pullup code to handle ANY/EXISTS sublinks that are at top
level of a JOIN/ON clause, not only at top level of WHERE.  (However, we
can't do this in an outer join's ON clause, unless the ANY/EXISTS refers
only to the nullable side of the outer join, so that it can effectively
be pushed down into the nullable side.)  Per request from Kevin Grittner.

In passing, fix a bug in the initial implementation of EXISTS pullup:
it would Assert if the EXIST's WHERE clause used a join alias variable.
Since we haven't yet flattened join aliases when this transformation
happens, it's necessary to include join relids in the computed set of
RHS relids.

Modified Files:
--------------
    pgsql/src/backend/optimizer/plan:
        initsplan.c (r1.141 -> r1.142)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/initsplan.c?r1=1.141&r2=1.142)
        planner.c (r1.241 -> r1.242)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c?r1=1.241&r2=1.242)
        subselect.c (r1.133 -> r1.134)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/subselect.c?r1=1.133&r2=1.134)
    pgsql/src/backend/optimizer/prep:
        prepjointree.c (r1.52 -> r1.53)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepjointree.c?r1=1.52&r2=1.53)
    pgsql/src/include/optimizer:
        prep.h (r1.61 -> r1.62)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/prep.h?r1=1.61&r2=1.62)
        subselect.h (r1.32 -> r1.33)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/subselect.h?r1=1.32&r2=1.33)

pgsql-committers by date

Next:From: Tom LaneDate: 2008-08-17 02:19:20
Subject: pgsql: Remove prohibition against SubLinks in the WHERE clause of an
Previous:From: Jaime CasanovaDate: 2008-08-16 23:46:27
Subject: Re: pgsql: Make the pg_stat_activity view call a SRF

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