]> granicus.if.org Git - postgresql/commit
Fix another semijoin-ordering bug. We already knew that we couldn't
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Jul 2009 02:02:51 +0000 (02:02 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Jul 2009 02:02:51 +0000 (02:02 +0000)
commit10e8b3fae373caa7ade131947b1e271cf9d0e25f
treeed1d08e43a7c63f6470dd094cf970a1781dfc88d
parent323e3fc2aacbdaf35793083eb9ce6a998b0d41ae
Fix another semijoin-ordering bug.  We already knew that we couldn't
reorder a semijoin into or out of the righthand side of another semijoin,
but actually it doesn't work to reorder it into or out of the righthand
side of a left or antijoin, either.  Per bug #4906 from Mathieu Fenniak.

This was sloppy thinking on my part.  This identity does work:

( A left join B on (Pab) ) semijoin C on (Pac)
==
( A semijoin C on (Pac) ) left join B on (Pab)

but I failed to see that that doesn't mean this does:

( A left join B on (Pab) ) semijoin C on (Pbc)
!=
A left join ( B semijoin C on (Pbc) ) on (Pab)
src/backend/optimizer/README
src/backend/optimizer/plan/initsplan.c