Skip to content

Commit a37795b

Browse files
committed
Do not use sortref to compare group lists and distkey
1 parent 7032f42 commit a37795b

File tree

1 file changed

+13
-29
lines changed

1 file changed

+13
-29
lines changed

src/backend/cdb/cdbpathlocus.c

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,40 +1058,24 @@ cdbpathlocus_is_hashed_on_tlist(CdbPathLocus locus, List *tlist,
10581058
if (ignore_constants && CdbEquivClassIsConstant(dk_eclass))
10591059
continue;
10601060

1061-
// if (dk_eclass->ec_sortref != 0)
1062-
// {
1063-
// foreach(i, tlist)
1064-
// {
1065-
// TargetEntry *tle = (TargetEntry *) lfirst(i);
1066-
//
1067-
// if (tle->ressortgroupref == dk_eclass->ec_sortref)
1068-
// {
1069-
// found = true;
1070-
// break;
1071-
// }
1072-
// }
1073-
// }
1074-
// else
1075-
// {
1076-
foreach(i, dk_eclass->ec_members)
1061+
foreach(i, dk_eclass->ec_members)
1062+
{
1063+
EquivalenceMember *em = (EquivalenceMember *) lfirst(i);
1064+
ListCell *ltl;
1065+
1066+
foreach(ltl, tlist)
10771067
{
1078-
EquivalenceMember *em = (EquivalenceMember *) lfirst(i);
1079-
ListCell *ltl;
1068+
TargetEntry *tle = (TargetEntry *) lfirst(ltl);
10801069

1081-
foreach(ltl, tlist)
1070+
if (equal(tle->expr, em->em_expr))
10821071
{
1083-
TargetEntry *tle = (TargetEntry *) lfirst(ltl);
1084-
1085-
if (equal(tle->expr, em->em_expr))
1086-
{
1087-
found = true;
1088-
break;
1089-
}
1090-
}
1091-
if (found)
1072+
found = true;
10921073
break;
1074+
}
10931075
}
1094-
// }
1076+
if (found)
1077+
break;
1078+
}
10951079
if (!found)
10961080
return false;
10971081
}

0 commit comments

Comments
 (0)