pgsql: Improve sublink pullup code to handle ANY/EXISTS sublinks that - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Improve sublink pullup code to handle ANY/EXISTS sublinks that
Date
Msg-id 20080817012000.A6753755315@cvs.postgresql.org
Whole thread Raw
List 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:

Previous
From: "Jaime Casanova"
Date:
Subject: Re: pgsql: Make the pg_stat_activity view call a SRF
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Remove prohibition against SubLinks in the WHERE clause of an