]> granicus.if.org Git - postgresql/commit
Change have_join_order_restriction() so that we do not force a clauseless join
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 26 Oct 2007 18:10:50 +0000 (18:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 26 Oct 2007 18:10:50 +0000 (18:10 +0000)
commitcd2a2ce904bdf2756e8ba50e926ab9859d2d9498
treea3578235d848ecb6256752bd7146eca01f9932f8
parent462227dc007d7fa002eca38c010d95d458fa1aef
Change have_join_order_restriction() so that we do not force a clauseless join
if either of the input relations can legally be joined to any other rels using
join clauses.  This avoids uselessly (and expensively) considering a lot of
really stupid join paths when there is a join restriction with a large
footprint, that is, lots of relations inside its LHS or RHS.  My patch of
15-Feb-2007 had been causing the code to consider joining *every* combination
of rels inside such a group, which is exponentially bad :-(.  With this
behavior, clauseless bushy joins will be done if necessary, but they'll be
put off as long as possible.  Per report from Jakub Ouhrabka.

Backpatch to 8.2.  We might someday want to backpatch to 8.1 as well, but 8.1
does not have the problem for OUTER JOIN nests, only for IN-clauses, so it's
not clear anyone's very likely to hit it in practice; and the current patch
doesn't apply cleanly to 8.1.
src/backend/optimizer/README
src/backend/optimizer/path/joinrels.c