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

pgsql: Implement SEMI and ANTI joins in the planner and executor.

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Implement SEMI and ANTI joins in the planner and executor.
Date: 2008-08-14 18:48:00
Message-ID: 20080814184800.6091C755315@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Implement SEMI and ANTI joins in the planner and executor.  (Semijoins replace
the old JOIN_IN code, but antijoins are new functionality.)  Teach the planner
to convert appropriate EXISTS and NOT EXISTS subqueries into semi and anti
joins respectively.  Also, LEFT JOINs with suitable upper-level IS NULL
filters are recognized as being anti joins.  Unify the InClauseInfo and
OuterJoinInfo infrastructure into "SpecialJoinInfo".  With that change,
it becomes possible to associate a SpecialJoinInfo with every join attempt,
which permits some cleanup of join selectivity estimation.  That needs to be
taken much further than this patch does, but the next step is to change the
API for oprjoin selectivity functions, which seems like material for a
separate patch.  So for the moment the output size estimates for semi and
especially anti joins are quite bogus.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        indexam.sgml (r2.26 -> r2.27)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/indexam.sgml?r1=2.26&r2=2.27)
    pgsql/src/backend/commands:
        explain.c (r1.176 -> r1.177)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/explain.c?r1=1.176&r2=1.177)
    pgsql/src/backend/executor:
        nodeHashjoin.c (r1.93 -> r1.94)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeHashjoin.c?r1=1.93&r2=1.94)
        nodeMergejoin.c (r1.91 -> r1.92)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeMergejoin.c?r1=1.91&r2=1.92)
        nodeNestloop.c (r1.46 -> r1.47)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeNestloop.c?r1=1.46&r2=1.47)
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.399 -> r1.400)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.399&r2=1.400)
        equalfuncs.c (r1.326 -> r1.327)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c?r1=1.326&r2=1.327)
        list.c (r1.69 -> r1.70)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/list.c?r1=1.69&r2=1.70)
        outfuncs.c (r1.333 -> r1.334)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.333&r2=1.334)
    pgsql/src/backend/optimizer:
        README (r1.47 -> r1.48)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/README?r1=1.47&r2=1.48)
    pgsql/src/backend/optimizer/path:
        clausesel.c (r1.90 -> r1.91)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/clausesel.c?r1=1.90&r2=1.91)
        costsize.c (r1.192 -> r1.193)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/costsize.c?r1=1.192&r2=1.193)
        indxpath.c (r1.231 -> r1.232)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/indxpath.c?r1=1.231&r2=1.232)
        joinpath.c (r1.116 -> r1.117)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/joinpath.c?r1=1.116&r2=1.117)
        joinrels.c (r1.92 -> r1.93)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/joinrels.c?r1=1.92&r2=1.93)
        orindxpath.c (r1.84 -> r1.85)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/orindxpath.c?r1=1.84&r2=1.85)
    pgsql/src/backend/optimizer/plan:
        createplan.c (r1.244 -> r1.245)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/createplan.c?r1=1.244&r2=1.245)
        initsplan.c (r1.140 -> r1.141)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/initsplan.c?r1=1.140&r2=1.141)
        planmain.c (r1.109 -> r1.110)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planmain.c?r1=1.109&r2=1.110)
        planner.c (r1.240 -> r1.241)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c?r1=1.240&r2=1.241)
        subselect.c (r1.132 -> r1.133)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/subselect.c?r1=1.132&r2=1.133)
    pgsql/src/backend/optimizer/prep:
        prepjointree.c (r1.50 -> r1.51)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepjointree.c?r1=1.50&r2=1.51)
        prepunion.c (r1.152 -> r1.153)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/prep/prepunion.c?r1=1.152&r2=1.153)
    pgsql/src/backend/optimizer/util:
        clauses.c (r1.261 -> r1.262)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c?r1=1.261&r2=1.262)
        pathnode.c (r1.145 -> r1.146)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/pathnode.c?r1=1.145&r2=1.146)
        relnode.c (r1.89 -> r1.90)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/relnode.c?r1=1.89&r2=1.90)
        var.c (r1.74 -> r1.75)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/var.c?r1=1.74&r2=1.75)
    pgsql/src/backend/rewrite:
        rewriteManip.c (r1.107 -> r1.108)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/rewrite/rewriteManip.c?r1=1.107&r2=1.108)
    pgsql/src/backend/utils/adt:
        selfuncs.c (r1.250 -> r1.251)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/selfuncs.c?r1=1.250&r2=1.251)
    pgsql/src/include/nodes:
        nodes.h (r1.207 -> r1.208)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/nodes.h?r1=1.207&r2=1.208)
        pg_list.h (r1.58 -> r1.59)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/pg_list.h?r1=1.58&r2=1.59)
        relation.h (r1.157 -> r1.158)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h?r1=1.157&r2=1.158)
    pgsql/src/include/optimizer:
        clauses.h (r1.91 -> r1.92)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/clauses.h?r1=1.91&r2=1.92)
        cost.h (r1.90 -> r1.91)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/cost.h?r1=1.90&r2=1.91)
        pathnode.h (r1.77 -> r1.78)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/pathnode.h?r1=1.77&r2=1.78)
        paths.h (r1.104 -> r1.105)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/paths.h?r1=1.104&r2=1.105)
        planmain.h (r1.110 -> r1.111)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planmain.h?r1=1.110&r2=1.111)
        prep.h (r1.60 -> r1.61)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/prep.h?r1=1.60&r2=1.61)
        subselect.h (r1.31 -> r1.32)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/subselect.h?r1=1.31&r2=1.32)
    pgsql/src/include/utils:
        selfuncs.h (r1.44 -> r1.45)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/selfuncs.h?r1=1.44&r2=1.45)

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2008-08-14 20:31:29
Subject: pgsql: Fix pull_up_simple_union_all to copy all rtable entries from
Previous:From: Dave PageDate: 2008-08-14 16:04:29
Subject: stackbuilder - wizard: Use popen to execute installers on *nix, to avoid

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