pgsql: Switch the planner over to treating qualifications of a JOIN_SEMI

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Switch the planner over to treating qualifications of a JOIN_SEMI
Date: 2008-11-22 22:47:06
Message-ID: 20081122224706.5F98A7545A4@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Switch the planner over to treating qualifications of a JOIN_SEMI join as
though it is an inner rather than outer join type. This essentially means
that we don't bother to separate "pushed down" qual conditions from actual
join quals at a semijoin plan node; which is okay because the restrictions of
SQL syntax make it impossible to have a pushed-down qual that references the
inner side of a semijoin. This allows noticeably better optimization of
IN/EXISTS cases than we had before, since the equivalence-class machinery can
now use those quals. Also fix a couple of other mistakes that had essentially
disabled the ability to unique-ify the inner relation and then join it to just
a subset of the left-hand relations. An example case using the regression
database is

select * from tenk1 a, tenk1 b
where (a.unique1,b.unique2) in (select unique1,unique2 from tenk1 c);

which is planned reasonably well by 8.3 and earlier but had been forcing a
cartesian join of a/b in CVS HEAD.

Modified Files:
--------------
pgsql/src/backend/optimizer/path:
costsize.c (r1.200 -> r1.201)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/costsize.c?r1=1.200&r2=1.201)
indxpath.c (r1.233 -> r1.234)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/indxpath.c?r1=1.233&r2=1.234)
joinpath.c (r1.118 -> r1.119)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/joinpath.c?r1=1.118&r2=1.119)
joinrels.c (r1.94 -> r1.95)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/joinrels.c?r1=1.94&r2=1.95)
pgsql/src/backend/optimizer/plan:
initsplan.c (r1.144 -> r1.145)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/initsplan.c?r1=1.144&r2=1.145)
pgsql/src/include/nodes:
nodes.h (r1.214 -> r1.215)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/nodes.h?r1=1.214&r2=1.215)

Browse pgsql-committers by date

  From Date Subject
Next Message User Hinoue 2008-11-23 01:00:53 psqlodbc - psqlodbc: The version is now 8.3.0401.
Previous Message User Mkz 2008-11-22 09:41:32 pgbouncer - pgbouncer: Make crypt authentication optional.