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

Commit61d6dd0

Browse files
committed
Fix adjust_semi_join to be more cautious about clauseless joins.
It was reporting that these were fully indexed (hence cheap), when ofcourse they're the exact opposite of that. I'm not certain if the casewould arise in practice, since a clauseless semijoin is hard to producein SQL, but if it did happen we'd make some dumb decisions.
1 parent71baff1 commit61d6dd0

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

‎src/backend/optimizer/path/costsize.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,12 +2897,20 @@ adjust_semi_join(PlannerInfo *root, JoinPath *path, SpecialJoinInfo *sjinfo,
28972897
*/
28982898
if (indexed_join_quals)
28992899
{
2900-
List*nrclauses;
2900+
if (path->joinrestrictinfo!=NIL)
2901+
{
2902+
List*nrclauses;
29012903

2902-
nrclauses=select_nonredundant_join_clauses(root,
2903-
path->joinrestrictinfo,
2904-
path->innerjoinpath);
2905-
*indexed_join_quals= (nrclauses==NIL);
2904+
nrclauses=select_nonredundant_join_clauses(root,
2905+
path->joinrestrictinfo,
2906+
path->innerjoinpath);
2907+
*indexed_join_quals= (nrclauses==NIL);
2908+
}
2909+
else
2910+
{
2911+
/* a clauseless join does NOT qualify */
2912+
*indexed_join_quals= false;
2913+
}
29062914
}
29072915

29082916
return true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp