Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd2a2ce

Browse files
committed
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 usingjoin clauses. This avoids uselessly (and expensively) considering a lot ofreally stupid join paths when there is a join restriction with a largefootprint, that is, lots of relations inside its LHS or RHS. My patch of15-Feb-2007 had been causing the code to consider joining *every* combinationof rels inside such a group, which is exponentially bad :-(. With thisbehavior, clauseless bushy joins will be done if necessary, but they'll beput 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.1does not have the problem for OUTER JOIN nests, only for IN-clauses, so it'snot clear anyone's very likely to hit it in practice; and the current patchdoesn't apply cleanly to 8.1.
1 parent462227d commitcd2a2ce

File tree

2 files changed

+180
-63
lines changed

2 files changed

+180
-63
lines changed

‎src/backend/optimizer/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ than applying a sort to the cheapest other path).
174174
If the query contains one-sided outer joins (LEFT or RIGHT joins), or
175175
"IN (sub-select)" WHERE clauses that were converted to joins, then some of
176176
the possible join orders may be illegal. These are excluded by having
177-
make_join_rel consult side lists of outer joins and IN joins to see
177+
join_is_legal consult side lists of outer joins and IN joins to see
178178
whether a proposed join is illegal. (The same consultation allows it
179179
to see which join style should be applied for a valid join, ie,
180180
JOIN_INNER, JOIN_LEFT, etc.)
@@ -217,7 +217,7 @@ FULL JOIN ordering is enforced by not collapsing FULL JOIN nodes when
217217
translating the jointree to "joinlist" representation. LEFT and RIGHT
218218
JOIN nodes are normally collapsed so that they participate fully in the
219219
join order search. To avoid generating illegal join orders, the planner
220-
creates an OuterJoinInfo node for each outer join, andmake_join_rel
220+
creates an OuterJoinInfo node for each outer join, andjoin_is_legal
221221
checks this list to decide if a proposed join is legal.
222222

223223
What we store in OuterJoinInfo nodes are the minimum sets of Relids
@@ -226,7 +226,7 @@ these are minimums; there's no explicit maximum, since joining other
226226
rels to the OJ's syntactic rels may be legal. Per identities 1 and 2,
227227
non-FULL joins can be freely associated into the lefthand side of an
228228
OJ, but in general they can't be associated into the righthand side.
229-
So the restriction enforced bymake_join_rel is that a proposed join
229+
So the restriction enforced byjoin_is_legal is that a proposed join
230230
can't join a rel within or partly within an RHS boundary to one outside
231231
the boundary, unless the join validly implements some outer join.
232232
(To support use of identity 3, we have to allow cases where an apparent

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp