pgsql: Change have_join_order_restriction() so that we do not force a

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change have_join_order_restriction() so that we do not force a
Date: 2007-10-26 18:10:58
Message-ID: 20071026181058.68C85754229@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
pgsql/src/backend/optimizer:
README (r1.35.2.1 -> r1.35.2.2)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/README?r1=1.35.2.1&r2=1.35.2.2)
pgsql/src/backend/optimizer/path:
joinrels.c (r1.81.2.3 -> r1.81.2.4)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/joinrels.c?r1=1.81.2.3&r2=1.81.2.4)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2007-10-26 19:04:37 pgsql: Remove use of "Postgres" aliases in the FAQ in
Previous Message Tom Lane 2007-10-26 18:10:50 pgsql: Change have_join_order_restriction() so that we do not force a