postgresql/src/backend
Tom Lane e3ffd05b02 Weaken the planner's tests for relevant joinclauses.
We should be willing to cross-join two small relations if that allows us
to use an inner indexscan on a large relation (that is, the potential
indexqual for the large table requires both smaller relations).  This
worked in simple cases but fell apart as soon as there was a join clause
to a fourth relation, because the existence of any two-relation join clause
caused the planner to not consider clauseless joins between other base
relations.  The added regression test shows an example case adapted from
a recent complaint from Benoit Delbosc.

Adjust have_relevant_joinclause, have_relevant_eclass_joinclause, and
has_relevant_eclass_joinclause to consider that a join clause mentioning
three or more relations is sufficient grounds for joining any subset of
those relations, even if we have to do so via a cartesian join.  Since such
clauses are relatively uncommon, this shouldn't affect planning speed on
typical queries; in fact it should help a bit, because the latter two
functions in particular get significantly simpler.

Although this is arguably a bug fix, I'm not going to risk back-patching
it, since it might have currently-unforeseen consequences.
2012-04-13 16:07:17 -04:00
..
access Teach SLRU code to avoid replacing I/O-busy pages. 2012-04-08 23:05:55 -04:00
bootstrap Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
catalog Silently ignore any nonexistent schemas that are listed in search_path. 2012-04-11 12:02:50 -04:00
commands Consistently quote encoding and locale names in messages 2012-04-13 20:37:07 +03:00
executor New GUC, track_iotiming, to track I/O timings. 2012-03-27 14:55:02 -04:00
foreign Add GetForeignColumnOptions() to foreign.c, and add some documentation. 2012-03-07 18:20:58 -05:00
lib Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
libpq Clean up compiler warnings from unused variables with asserts disabled 2012-03-21 23:33:10 +02:00
main Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
nodes Don't bother copying empty support arrays in a zero-column MergeJoin. 2012-04-09 11:41:54 -04:00
optimizer Weaken the planner's tests for relevant joinclauses. 2012-04-13 16:07:17 -04:00
parser Add DROP INDEX CONCURRENTLY [IF EXISTS], uses ShareUpdateExclusiveLock 2012-04-06 10:21:40 +01:00
po Translation updates 2011-08-17 14:07:46 +03:00
port Unbreak Windows builds broken by pgpipe removal. 2012-03-29 04:11:57 -04:00
postmaster Do stack-depth checking in all postmaster children. 2012-04-08 19:07:55 +03:00
regex Merge dissect() into cdissect() to remove a pile of near-duplicate code. 2012-02-24 18:40:31 -05:00
replication Cast some printf arguments to avoid possibly-nonportable behavior. 2012-03-23 20:18:04 -04:00
rewrite Add some infrastructure for contrib/pg_stat_statements. 2012-03-27 15:17:40 -04:00
snowball Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
storage Publish checkpoint timing information to pg_stat_bgwriter. 2012-04-05 14:04:37 -04:00
tcop set_stack_base() no longer needs to be called in PostgresMain. 2012-04-08 19:39:12 +03:00
tsearch Collect and use element-frequency statistics for arrays. 2012-03-03 20:20:57 -05:00
utils Rename bytea_agg to string_agg and add delimiter argument 2012-04-13 21:36:59 +03:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
Makefile Fix incorrect make maintainer-clean rule. 2012-04-07 18:16:50 -04:00
nls.mk Sort file list when creating gettext-files 2011-12-27 20:20:56 +02:00