]> granicus.if.org Git - postgresql/commit
Remove the "last ditch" code path in join_search_one_level().
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Apr 2012 20:03:16 +0000 (16:03 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 13 Apr 2012 20:07:18 +0000 (16:07 -0400)
commite54b10a62db2991235fe800c629baef4531a6d67
tree5b6fc186d9f0a83866883ae539d7052204f91150
parente3ffd05b02468b1a53de31a322cedf195576a625
Remove the "last ditch" code path in join_search_one_level().

So far as I can tell, it is no longer possible for this heuristic to do
anything useful, because the new weaker definition of
have_relevant_joinclause means that any relation with a joinclause must be
considered joinable to at least one other relation.  It would still be
possible for the code block to be entered, for example if there are join
order restrictions that prevent any join of the current level from being
formed; but in that case it's just a waste of cycles to attempt to form
cartesian joins, since the restrictions will still apply.

Furthermore, IMO the existence of this code path can mask bugs elsewhere;
we would have noticed the problem with cartesian joins a lot sooner if
this code hadn't compensated for it in the simplest case.

Accordingly, let's remove it and see what happens.  I'm committing this
separately from the prerequisite changes in have_relevant_joinclause,
just to make the question easier to revisit if there is some fault in
my logic.
src/backend/optimizer/path/joinrels.c