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

pgsql: Fix another thinko in join_is_legal's handling of semijoins: we

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix another thinko in join_is_legal's handling of semijoins: we
Date: 2009-07-23 17:42:06
Message-ID: 20090723174206.4AEBD75331E@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix another thinko in join_is_legal's handling of semijoins: we have to test
for the case that the semijoin was implemented within either input by
unique-ifying its RHS before we test to see if it appears to match the current
join situation.  The previous coding would select semijoin logic in situations
where we'd already unique-ified the RHS and joined it to some unrelated
relation(s), and then came to join it to the semijoin's LHS.  That still gave
the right answer as far as the semijoin itself was concerned, but would lead
to incorrectly examining only an arbitrary one of the matchable rows from the
unrelated relation(s).  The cause of this thinko was incorrect unification of
the pre-8.4 logic for IN joins and OUTER joins --- the comparable case for
outer joins can be handled after making the match test, but that's because
there is nothing like the unique-ification escape hatch for outer joins.
Per bug #4934 from Benjamin Reed.

Modified Files:
--------------
    pgsql/src/backend/optimizer/path:
        joinrels.c (r1.101 -> r1.102)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/joinrels.c?r1=1.101&r2=1.102)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-07-23 17:42:13
Subject: pgsql: Fix another thinko in join_is_legal's handling of semijoins: we
Previous:From: Andrew DunstanDate: 2009-07-23 17:06:48
Subject: pgsql: Update location to download flex for building on Windows.

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