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

Commit97cfb9d

Browse files
committed
Make sure make_rels_by_clause_joins doesn't return multiple references
to same joinrel. Although make_rels_by_joins doesn't mind, GEQO hasan Assert that doesn't like this.
1 parentcf35a70 commit97cfb9d

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

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

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.48 2000/09/29 18:21:32 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/joinrels.c,v 1.49 2000/12/18 06:50:51 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -262,9 +262,18 @@ make_rels_by_clause_joins(Query *root,
262262
RelOptInfo*other_rel= (RelOptInfo*)lfirst(j);
263263

264264
if (is_subseti(unjoined_relids,other_rel->relids))
265-
result=lcons(make_join_rel(root,old_rel,other_rel,
266-
JOIN_INNER),
267-
result);
265+
{
266+
RelOptInfo*jrel;
267+
268+
jrel=make_join_rel(root,old_rel,other_rel,JOIN_INNER);
269+
/*
270+
* Avoid entering same joinrel into our output list more
271+
* than once. (make_rels_by_joins doesn't really care,
272+
* but GEQO does.)
273+
*/
274+
if (!ptrMember(jrel,result))
275+
result=lcons(jrel,result);
276+
}
268277
}
269278
}
270279

@@ -297,9 +306,16 @@ make_rels_by_clauseless_joins(Query *root,
297306
RelOptInfo*other_rel= (RelOptInfo*)lfirst(i);
298307

299308
if (nonoverlap_setsi(other_rel->relids,old_rel->relids))
300-
result=lcons(make_join_rel(root,old_rel,other_rel,
301-
JOIN_INNER),
302-
result);
309+
{
310+
RelOptInfo*jrel;
311+
312+
jrel=make_join_rel(root,old_rel,other_rel,JOIN_INNER);
313+
/*
314+
* As long as given other_rels are distinct, don't need
315+
* to test to see if jrel is already part of output list.
316+
*/
317+
result=lcons(jrel,result);
318+
}
303319
}
304320

305321
returnresult;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp