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

Commitd7e4fd9

Browse files
committed
Fix bug introduced into indexable_outerrelids() by an ill-considered
"optimization". When we find a potentially useful joinclause, wehave to add all its other required_relids to the result, not only theother clause_relids. They are different in the case of a joinclausewhose applicability has to be postponed due to outer join. We haveto include the extra rels because otherwise, after best_inner_indexscanmasks the join rels with index_outer_relids, it will always fail tofind the joinclause as applicable. Per report from Husam Tomeh.
1 parent8a64ec6 commitd7e4fd9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.188 2005/08/28 22:47:20 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.189 2005/09/22 23:25:07 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -955,15 +955,13 @@ indexable_outerrelids(RelOptInfo *rel)
955955
/*
956956
* Examine each joinclause in the joininfo list to see if it matches any
957957
* key of any index. If so, add the clause's other rels to the result.
958-
* (Note: we consider only actual participants, not extraneous rels
959-
* possibly mentioned in required_relids.)
960958
*/
961959
foreach(l,rel->joininfo)
962960
{
963961
RestrictInfo*joininfo= (RestrictInfo*)lfirst(l);
964962
Relidsother_rels;
965963

966-
other_rels=bms_difference(joininfo->clause_relids,rel->relids);
964+
other_rels=bms_difference(joininfo->required_relids,rel->relids);
967965
if (matches_any_index(joininfo,rel,other_rels))
968966
outer_relids=bms_join(outer_relids,other_rels);
969967
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp