Skip to content

Commit e349eb6

Browse files
committed
Bug (yet unfixed but not fatal) found: Re-moving index clauses from the
nestloop's join clauses doesn't work in some cases: * 1. fix_indxqual_references may change varattno-s in * inner_indxqual; * 2. clauses may be commuted
1 parent a1ac198 commit e349eb6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/backend/optimizer/plan/createplan.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.10 1997/04/22 03:30:36 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/createplan.c,v 1.11 1997/04/24 15:59:58 vadim Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -432,7 +432,7 @@ create_nestloop_node(JoinPath *best_path,
432432

433433
foreach (inner_qual, inner_indxqual)
434434
{
435-
if ( !(qual_clause_p ((Node*)inner_qual)) )
435+
if ( !qual_clause_p ((Node*)lfirst(inner_qual)) )
436436
{
437437
found = true;
438438
break;
@@ -443,12 +443,18 @@ create_nestloop_node(JoinPath *best_path,
443443
* index clauses from the nestloop's join clauses and reset the
444444
* inner(index) scan's qualification so that the var nodes refer to
445445
* the proper outer join relation attributes.
446+
*
447+
* XXX Re-moving index clauses doesn't work properly:
448+
* 1. fix_indxqual_references may change varattno-s in
449+
* inner_indxqual;
450+
* 2. clauses may be commuted
451+
* I havn't time to fix it at the moment. - vadim 04/24/97
446452
*/
447453
if ( found )
448454
{
449455
List *new_inner_qual = NIL;
450456

451-
clauses = set_difference(clauses,inner_indxqual);
457+
clauses = set_difference(clauses,inner_indxqual); /* XXX */
452458
new_inner_qual =
453459
index_outerjoin_references(inner_indxqual,
454460
outer_node->targetlist,

0 commit comments

Comments
 (0)