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

pgsql: Teach planner about some cases where a restriction clause can be

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Teach planner about some cases where a restriction clause can be
Date: 2005-07-02 23:00:43
Message-ID: 20050702230043.5A23E5296E@svr1.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Teach planner about some cases where a restriction clause can be
propagated inside an outer join.  In particular, given
LEFT JOIN ON (A = B) WHERE A = constant, we cannot conclude that
B = constant at the top level (B might be null instead), but we
can nonetheless put a restriction B = constant into the quals for
B's relation, since no inner-side rows not meeting that condition
can contribute to the final result.  Similarly, given
FULL JOIN USING (J) WHERE J = constant, we can't directly conclude
that either input J variable = constant, but it's OK to push such
quals into each input rel.  Per recent gripe from Kim Bisgaard.
Along the way, remove 'valid_everywhere' flag from RestrictInfo,
as on closer analysis it was not being used for anything, and was
defined backwards anyway.

Modified Files:
--------------
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.310 -> r1.311)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c.diff?r1=1.310&r2=1.311)
        equalfuncs.c (r1.247 -> r1.248)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c.diff?r1=1.247&r2=1.248)
        outfuncs.c (r1.257 -> r1.258)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c.diff?r1=1.257&r2=1.258)
    pgsql/src/backend/optimizer/path:
        indxpath.c (r1.185 -> r1.186)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/indxpath.c.diff?r1=1.185&r2=1.186)
        orindxpath.c (r1.72 -> r1.73)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/orindxpath.c.diff?r1=1.72&r2=1.73)
        pathkeys.c (r1.68 -> r1.69)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/pathkeys.c.diff?r1=1.68&r2=1.69)
    pgsql/src/backend/optimizer/plan:
        createplan.c (r1.192 -> r1.193)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c.diff?r1=1.192&r2=1.193)
        initsplan.c (r1.107 -> r1.108)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/initsplan.c.diff?r1=1.107&r2=1.108)
        planmain.c (r1.85 -> r1.86)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planmain.c.diff?r1=1.85&r2=1.86)
        planner.c (r1.189 -> r1.190)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c.diff?r1=1.189&r2=1.190)
    pgsql/src/backend/optimizer/util:
        restrictinfo.c (r1.37 -> r1.38)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/restrictinfo.c.diff?r1=1.37&r2=1.38)
    pgsql/src/include/nodes:
        relation.h (r1.115 -> r1.116)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h.diff?r1=1.115&r2=1.116)
    pgsql/src/include/optimizer:
        restrictinfo.h (r1.31 -> r1.32)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/restrictinfo.h.diff?r1=1.31&r2=1.32)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2005-07-02 23:28:22
Subject: pgsql: > A quick look shows that when you use --with-libraries=/foo/bar
Previous:From: Bruce MomjianDate: 2005-07-02 20:08:28
Subject: pgsql: Remove GIST concurrency limitations section.

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