postgresql/src
Tom Lane 6c560bef76 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:42 -04:00
..
backend Fix thinko in previous patch for optimizing EXISTS-within-EXISTS. 2011-06-20 14:33:42 -04:00
bin Obtain table locks as soon as practical during pg_dump. 2011-06-17 18:19:09 -04:00
include pgindent run of recent SSI changes. Also, remove an unnecessary #include. 2011-06-16 16:17:16 +03:00
interfaces Capitalization fixes 2011-06-19 00:39:19 +03:00
makefiles Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
pl Translation updates for 9.1beta2 2011-06-09 23:02:48 +03:00
port Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Fix thinko in previous patch for optimizing EXISTS-within-EXISTS. 2011-06-20 14:33:42 -04:00
timezone Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
tools Add comment about pg_ctl stop 2011-06-10 15:27:38 -04:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02: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 Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
nls-global.mk Fix makefile logic to not break the build when xgettext is missing 2010-10-14 23:16:46 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00