This is an automated email from the ASF dual-hosted git repository.

chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this 
push:
     new a37795b5152 Do not use sortref to compare group lists and distkey
a37795b5152 is described below

commit a37795b5152348054014ce6fd85cf96dc123ab2b
Author: Jinbao Chen <[email protected]>
AuthorDate: Fri Dec 26 10:42:35 2025 +0800

    Do not use sortref to compare group lists and distkey
---
 src/backend/cdb/cdbpathlocus.c | 42 +++++++++++++-----------------------------
 1 file changed, 13 insertions(+), 29 deletions(-)

diff --git a/src/backend/cdb/cdbpathlocus.c b/src/backend/cdb/cdbpathlocus.c
index af6cbe0bd45..bb3ed0ab83a 100644
--- a/src/backend/cdb/cdbpathlocus.c
+++ b/src/backend/cdb/cdbpathlocus.c
@@ -1058,40 +1058,24 @@ cdbpathlocus_is_hashed_on_tlist(CdbPathLocus locus, 
List *tlist,
                                if (ignore_constants && 
CdbEquivClassIsConstant(dk_eclass))
                                        continue;
 
-//                             if (dk_eclass->ec_sortref != 0)
-//                             {
-//                                     foreach(i, tlist)
-//                                     {
-//                                             TargetEntry *tle = (TargetEntry 
*) lfirst(i);
-//
-//                                             if (tle->ressortgroupref == 
dk_eclass->ec_sortref)
-//                                             {
-//                                                     found = true;
-//                                                     break;
-//                                             }
-//                                     }
-//                             }
-//                             else
-//                             {
-                                       foreach(i, dk_eclass->ec_members)
+                               foreach(i, dk_eclass->ec_members)
+                               {
+                                       EquivalenceMember *em = 
(EquivalenceMember *) lfirst(i);
+                                       ListCell *ltl;
+
+                                       foreach(ltl, tlist)
                                        {
-                                               EquivalenceMember *em = 
(EquivalenceMember *) lfirst(i);
-                                               ListCell *ltl;
+                                               TargetEntry *tle = (TargetEntry 
*) lfirst(ltl);
 
-                                               foreach(ltl, tlist)
+                                               if (equal(tle->expr, 
em->em_expr))
                                                {
-                                                       TargetEntry *tle = 
(TargetEntry *) lfirst(ltl);
-
-                                                       if (equal(tle->expr, 
em->em_expr))
-                                                       {
-                                                               found = true;
-                                                               break;
-                                                       }
-                                               }
-                                               if (found)
+                                                       found = true;
                                                        break;
+                                               }
                                        }
-//                             }
+                                       if (found)
+                                               break;
+                               }
                                if (!found)
                                        return false;
                        }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to