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

Commit3f36070

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 parent368e44f commit3f36070

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
@@ -2810,12 +2810,20 @@ adjust_semi_join(PlannerInfo *root, JoinPath *path, SpecialJoinInfo *sjinfo,
28102810
*/
28112811
if (indexed_join_quals)
28122812
{
2813-
List*nrclauses;
2813+
if (path->joinrestrictinfo!=NIL)
2814+
{
2815+
List*nrclauses;
28142816

2815-
nrclauses=select_nonredundant_join_clauses(root,
2816-
path->joinrestrictinfo,
2817-
path->innerjoinpath);
2818-
*indexed_join_quals= (nrclauses==NIL);
2817+
nrclauses=select_nonredundant_join_clauses(root,
2818+
path->joinrestrictinfo,
2819+
path->innerjoinpath);
2820+
*indexed_join_quals= (nrclauses==NIL);
2821+
}
2822+
else
2823+
{
2824+
/* a clauseless join does NOT qualify */
2825+
*indexed_join_quals= false;
2826+
}
28192827
}
28202828

28212829
return true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp