You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ch...@apache.org on 2025/12/26 02:42:49 UTC

(cloudberry) branch cbdb-postgres-merge updated: Do not use sortref to compare group lists and distkey

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 <ch...@gmail.com>
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: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org