postgresql/src
Tom Lane 5f129cf942 Fix thinko in previous patch for optimizing EXISTS-within-EXISTS.
When recursing after an optimization in pull_up_sublinks_qual_recurse, the
available_rels value passed down must include only the relations that are
in the righthand side of the new SEMI or ANTI join; it's incorrect to pull
up a sub-select that refers to other relations, as seen in the added test
case.  Per report from BangarRaju Vadapalli.

While at it, rethink the idea of recursing below a NOT EXISTS.  That is
essentially the same situation as pulling up ANY/EXISTS sub-selects that
are in the ON clause of an outer join, and it has the same disadvantage:
we'd force the two joins to be evaluated according to the syntactic nesting
order, because the lower join will most likely not be able to commute with
the ANTI join.  That could result in having to form a rather large join
product, whereas the handling of a correlated subselect is not quite that
dumb.  So until we can handle those cases better, #ifdef NOT_USED that
case.  (I think it's okay to pull up in the EXISTS/ANY cases, because SEMI
joins aren't so inflexible about ordering.)

Back-patch to 8.4, same as for previous patch in this area.  Fortunately
that patch hadn't made it into any shipped releases yet.
2011-06-20 14:33:54 -04:00
..
backend Fix thinko in previous patch for optimizing EXISTS-within-EXISTS. 2011-06-20 14:33:54 -04:00
bin Obtain table locks as soon as practical during pg_dump. 2011-06-17 18:19:14 -04:00
include Work around gcc 4.6.0 bug that breaks WAL replay. 2011-06-10 17:03:11 -04:00
interfaces Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
makefiles Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
pl Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
port Tag 9.0.4. 2011-04-15 00:15:53 -03:00
template Don't try to force use of -no-cpp-precomp on OS X. It's been five years 2010-08-02 04:51:25 +00:00
test Fix thinko in previous patch for optimizing EXISTS-within-EXISTS. 2011-06-20 14:33:54 -04:00
timezone Update time zone data files to tzdata release 2011f. 2011-04-13 18:04:07 -04:00
tools Avoid use of mixed slash style paths in arguments to xcopy in MSVC builds. 2011-04-07 22:16:56 -04:00
tutorial Remove copyright mention of Andrew Yu, per author's permission. 2010-02-02 18:52:02 +00:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Rethink the way walreceiver is linked into the backend. Instead than shoving 2010-01-20 09:16:24 +00:00
Makefile.global.in Accept slightly grotty coding in Makefile.global in order to keep the -L 2010-07-06 22:03:05 +00:00
Makefile.shlib Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
nls-global.mk Avoid error from mkdir if no languages are to be installed 2010-05-13 14:35:28 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00