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

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 911635fac61 [feature](nereids) judge if the join is at bottom of join 
cluster (#29383)
911635fac61 is described below

commit 911635fac61b56062148a8f24c882505fff01ec4
Author: minghong <[email protected]>
AuthorDate: Sat Jan 6 17:15:19 2024 +0800

    [feature](nereids) judge if the join is at bottom of join cluster (#29383)
---
 .../org/apache/doris/nereids/CascadesContext.java  |   3 +-
 .../processor/post/RuntimeFilterContext.java       |  16 +++
 .../processor/post/RuntimeFilterGenerator.java     |  54 +++++----
 .../rules/exploration/join/JoinCommute.java        |  10 +-
 .../doris/nereids/stats/FilterEstimation.java      |   2 +-
 .../doris/nereids/stats/StatsCalculator.java       |  38 ++++---
 .../trees/plans/physical/AbstractPhysicalPlan.java |  11 +-
 .../trees/plans/physical/PhysicalDistribute.java   |   6 +-
 .../plans/physical/PhysicalHashAggregate.java      |   5 +-
 .../trees/plans/physical/PhysicalHashJoin.java     |   5 +-
 .../trees/plans/physical/PhysicalProject.java      |   7 +-
 .../org/apache/doris/statistics/Statistics.java    |  25 +++--
 .../apache/doris/statistics/StatisticsBuilder.java |  10 +-
 .../push_down_count_through_join.out               |  44 ++++----
 .../eager_aggregate/push_down_sum_through_join.out |  22 ++--
 .../noStatsRfPrune/query10.out                     |  40 +++----
 .../noStatsRfPrune/query35.out                     |  26 ++---
 .../noStatsRfPrune/query44.out                     | 121 ++++++++++-----------
 .../noStatsRfPrune/query59.out                     |  37 ++++---
 .../noStatsRfPrune/query69.out                     |  75 ++++++-------
 .../noStatsRfPrune/query95.out                     |  62 +++++------
 .../no_stats_shape/query10.out                     |  40 +++----
 .../no_stats_shape/query35.out                     |  28 ++---
 .../no_stats_shape/query44.out                     | 121 ++++++++++-----------
 .../no_stats_shape/query59.out                     |  37 ++++---
 .../no_stats_shape/query69.out                     |  75 ++++++-------
 .../no_stats_shape/query95.out                     |  60 +++++-----
 27 files changed, 499 insertions(+), 481 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java
index 3c6eaa5999f..fecdbf650c3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/CascadesContext.java
@@ -64,6 +64,7 @@ import org.apache.doris.qe.ConnectContext;
 import org.apache.doris.qe.SessionVariable;
 import org.apache.doris.statistics.ColumnStatistic;
 import org.apache.doris.statistics.Statistics;
+import org.apache.doris.statistics.StatisticsBuilder;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
@@ -619,7 +620,7 @@ public class CascadesContext implements ScheduleContext {
         List<Pair<Map<Slot, Slot>, Group>> consumerGroups = 
this.statementContext.getCteIdToConsumerGroup().get(cteId);
         for (Pair<Map<Slot, Slot>, Group> p : consumerGroups) {
             Map<Slot, Slot> producerSlotToConsumerSlot = p.first;
-            Statistics updatedConsumerStats = new Statistics(statistics);
+            Statistics updatedConsumerStats = new 
StatisticsBuilder(statistics).build();
             for (Entry<Expression, ColumnStatistic> entry : 
statistics.columnStatistics().entrySet()) {
                 
updatedConsumerStats.addColumnStats(producerSlotToConsumerSlot.get(entry.getKey()),
 entry.getValue());
             }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterContext.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterContext.java
index 4360e5659c5..9fa23462219 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterContext.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterContext.java
@@ -238,6 +238,22 @@ public class RuntimeFilterContext {
         return aliasTransferMap;
     }
 
+    public Pair<PhysicalRelation, Slot> aliasTransferMapRemove(NamedExpression 
slot) {
+        return aliasTransferMap.remove(slot);
+    }
+
+    public Pair<PhysicalRelation, Slot> getAliasTransferPair(NamedExpression 
slot) {
+        return aliasTransferMap.get(slot);
+    }
+
+    public Pair<PhysicalRelation, Slot> aliasTransferMapPut(NamedExpression 
slot, Pair<PhysicalRelation, Slot> pair) {
+        return aliasTransferMap.put(slot, pair);
+    }
+
+    public boolean aliasTransferMapContains(NamedExpression slot) {
+        return aliasTransferMap.containsKey(slot);
+    }
+
     public Map<Slot, ScanNode> getScanNodeOfLegacyRuntimeFilterTarget() {
         return scanNodeOfLegacyRuntimeFilterTarget;
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
index 12db27793d0..0d9471287d7 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/RuntimeFilterGenerator.java
@@ -122,7 +122,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
         join.left().accept(this, context);
         if 
(RuntimeFilterGenerator.DENIED_JOIN_TYPES.contains(join.getJoinType()) || 
join.isMarkJoin()) {
             join.right().getOutput().forEach(slot ->
-                    
context.getRuntimeFilterContext().getAliasTransferMap().remove(slot));
+                    
context.getRuntimeFilterContext().aliasTransferMapRemove(slot));
         }
         collectPushDownCTEInfos(join, context);
         if (!getPushDownCTECandidates(ctx).isEmpty()) {
@@ -136,7 +136,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
     @Override
     public PhysicalCTEConsumer visitPhysicalCTEConsumer(PhysicalCTEConsumer 
scan, CascadesContext context) {
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
-        scan.getOutput().forEach(slot -> ctx.getAliasTransferMap().put(slot, 
Pair.of(scan, slot)));
+        scan.getOutput().forEach(slot -> ctx.aliasTransferMapPut(slot, 
Pair.of(scan, slot)));
         return scan;
     }
 
@@ -158,7 +158,6 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
         if (join.getJoinType() != JoinType.LEFT_SEMI_JOIN && 
join.getJoinType() != JoinType.CROSS_JOIN) {
             return;
         }
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
         List<Slot> leftSlots = join.left().getOutput();
         List<Slot> rightSlots = join.right().getOutput();
         List<Expression> bitmapRuntimeFilterConditions = 
JoinUtils.extractBitmapRuntimeFilterConditions(leftSlots,
@@ -183,15 +182,15 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
                 if (!checkPushDownPreconditionsForJoin(join, ctx, targetSlot)) 
{
                     continue;
                 }
-                Slot scanSlot = aliasTransferMap.get(targetSlot).second;
-                PhysicalRelation scan = aliasTransferMap.get(targetSlot).first;
+                Slot scanSlot = ctx.getAliasTransferPair(targetSlot).second;
+                PhysicalRelation scan = 
ctx.getAliasTransferPair(targetSlot).first;
                 RuntimeFilter filter = new RuntimeFilter(generator.getNextId(),
                         bitmapContains.child(0), ImmutableList.of(scanSlot),
                         ImmutableList.of(bitmapContains.child(1)), type, i, 
join, isNot, -1L);
                 scan.addAppliedRuntimeFilter(filter);
                 ctx.addJoinToTargetMap(join, scanSlot.getExprId());
                 ctx.setTargetExprIdToFilter(scanSlot.getExprId(), filter);
-                
ctx.setTargetsOnScanNode(aliasTransferMap.get(targetSlot).first,
+                
ctx.setTargetsOnScanNode(ctx.getAliasTransferPair(targetSlot).first,
                         scanSlot);
                 
join.addBitmapRuntimeFilterCondition(bitmapRuntimeFilterCondition);
             }
@@ -246,7 +245,6 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
      */
     private void generateMinMaxRuntimeFilter(AbstractPhysicalJoin<? extends 
Plan, ? extends Plan> join,
                                                    RuntimeFilterContext ctx) {
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
         int hashCondionSize = join.getHashJoinConjuncts().size();
         for (int idx = 0; idx < join.getOtherJoinConjuncts().size(); idx++) {
             int exprOrder = idx + hashCondionSize;
@@ -257,7 +255,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
                 if (unwrappedSlot == null) {
                     continue;
                 }
-                Pair<PhysicalRelation, Slot> pair = 
aliasTransferMap.get(unwrappedSlot);
+                Pair<PhysicalRelation, Slot> pair = 
ctx.getAliasTransferPair(unwrappedSlot);
                 if (pair == null) {
                     continue;
                 }
@@ -286,7 +284,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
 
         if 
(RuntimeFilterGenerator.DENIED_JOIN_TYPES.contains(join.getJoinType()) || 
join.isMarkJoin()) {
             join.right().getOutput().forEach(slot ->
-                    
context.getRuntimeFilterContext().getAliasTransferMap().remove(slot));
+                    
context.getRuntimeFilterContext().aliasTransferMapRemove(slot));
             return join;
         }
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
@@ -310,8 +308,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
     @Override
     public PhysicalPlan visitPhysicalProject(PhysicalProject<? extends Plan> 
project, CascadesContext context) {
         project.child().accept(this, context);
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap
-                = context.getRuntimeFilterContext().getAliasTransferMap();
+        RuntimeFilterContext ctx = context.getRuntimeFilterContext();
         // change key when encounter alias.
         // TODO: same action will be taken for set operation
         for (Expression expression : project.getProjects()) {
@@ -319,10 +316,11 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
                 continue;
             }
             Expression expr = 
ExpressionUtils.getExpressionCoveredByCast(expression.child(0));
-            if (expr instanceof NamedExpression && 
aliasTransferMap.containsKey((NamedExpression) expr)) {
+            if (expr instanceof NamedExpression
+                    && ctx.aliasTransferMapContains((NamedExpression) expr)) {
                 if (expression instanceof Alias) {
                     Alias alias = ((Alias) expression);
-                    aliasTransferMap.put(alias.toSlot(), 
aliasTransferMap.get(expr));
+                    ctx.aliasTransferMapPut(alias.toSlot(), 
ctx.getAliasTransferPair((NamedExpression) expr));
                 }
             }
         }
@@ -340,7 +338,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
     public PhysicalRelation visitPhysicalRelation(PhysicalRelation relation, 
CascadesContext context) {
         // add all the slots in map.
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
-        relation.getOutput().forEach(slot -> 
ctx.getAliasTransferMap().put(slot, Pair.of(relation, slot)));
+        relation.getOutput().forEach(slot -> ctx.aliasTransferMapPut(slot, 
Pair.of(relation, slot)));
         return relation;
     }
 
@@ -579,7 +577,6 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
 
     private void doPushDownIntoCTEProducerInternal(PhysicalHashJoin<? extends 
Plan, ? extends Plan> join,
             RuntimeFilterContext ctx, EqualTo equalTo, TRuntimeFilterType 
type, PhysicalCTEProducer cteProducer) {
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
         PhysicalPlan inputPlanNode = (PhysicalPlan) cteProducer.child(0);
         Slot unwrappedSlot = checkTargetChild(equalTo.left());
         // aliasTransMap doesn't contain the key, means that the path from the 
scan to the join
@@ -587,8 +584,8 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
         if (!checkPushDownPreconditionsForJoin(join, ctx, unwrappedSlot)) {
             return;
         }
-        Slot cteSlot = aliasTransferMap.get(unwrappedSlot).second;
-        PhysicalRelation cteNode = aliasTransferMap.get(unwrappedSlot).first;
+        Slot cteSlot = ctx.getAliasTransferPair(unwrappedSlot).second;
+        PhysicalRelation cteNode = 
ctx.getAliasTransferPair(unwrappedSlot).first;
         long buildSideNdv = getBuildSideNdv(join, equalTo);
         if (cteNode instanceof PhysicalCTEConsumer && inputPlanNode instanceof 
PhysicalProject) {
             PhysicalProject project = (PhysicalProject) inputPlanNode;
@@ -608,7 +605,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
                 return;
             } else {
                 Map<Slot, PhysicalRelation> pushDownBasicTableInfos = 
getPushDownBasicTablesInfos(project,
-                        (SlotReference) targetExpr, aliasTransferMap);
+                        (SlotReference) targetExpr, ctx);
                 if (!pushDownBasicTableInfos.isEmpty()) {
                     List<Slot> targetList = new ArrayList<>();
                     List<PhysicalRelation> targetNodes = new ArrayList<>();
@@ -642,7 +639,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
         topN.child().accept(this, context);
         PhysicalPlan child = (PhysicalPlan) topN.child();
         for (Slot slot : child.getOutput()) {
-            
context.getRuntimeFilterContext().getAliasTransferMap().remove(slot);
+            context.getRuntimeFilterContext().aliasTransferMapRemove(slot);
         }
         return topN;
     }
@@ -652,7 +649,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
         window.child().accept(this, context);
         Set<SlotReference> commonPartitionKeys = 
window.getCommonPartitionKeyFromWindowExpressions();
         window.child().getOutput().stream().filter(slot -> 
!commonPartitionKeys.contains(slot)).forEach(
-                slot -> 
context.getRuntimeFilterContext().getAliasTransferMap().remove(slot)
+                slot -> 
context.getRuntimeFilterContext().aliasTransferMapRemove(slot)
         );
         return window;
     }
@@ -662,8 +659,7 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
      */
     public static boolean 
checkPushDownPreconditionsForJoin(AbstractPhysicalJoin physicalJoin,
                                                        RuntimeFilterContext 
ctx, Slot slot) {
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
-        if (slot == null || !aliasTransferMap.containsKey(slot)) {
+        if (slot == null || !ctx.aliasTransferMapContains(slot)) {
             return false;
         } else if (DENIED_JOIN_TYPES.contains(physicalJoin.getJoinType()) || 
physicalJoin.isMarkJoin()) {
             return false;
@@ -695,12 +691,12 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
     }
 
     private Map<Slot, PhysicalRelation> 
getPushDownBasicTablesInfos(PhysicalPlan root, SlotReference slot,
-            Map<NamedExpression, Pair<PhysicalRelation, Slot>> 
aliasTransferMap) {
+            RuntimeFilterContext ctx) {
         Map<Slot, PhysicalRelation> basicTableInfos = new HashMap<>();
         Set<PhysicalHashJoin> joins = new HashSet<>();
         ExprId exprId = slot.getExprId();
-        if (aliasTransferMap.get(slot) != null) {
-            basicTableInfos.put(slot, aliasTransferMap.get(slot).first);
+        if (ctx.getAliasTransferPair(slot) != null) {
+            basicTableInfos.put(slot, ctx.getAliasTransferPair(slot).first);
         }
         // try to find propagation condition from join
         getAllJoinInfo(root, joins);
@@ -710,13 +706,13 @@ public class RuntimeFilterGenerator extends 
PlanPostProcessor {
                 if (equalTo instanceof EqualTo) {
                     SlotReference leftSlot = (SlotReference) ((EqualTo) 
equalTo).left();
                     SlotReference rightSlot = (SlotReference) ((EqualTo) 
equalTo).right();
-                    if (leftSlot.getExprId() == exprId && 
aliasTransferMap.get(rightSlot) != null) {
-                        PhysicalRelation rightTable = 
aliasTransferMap.get(rightSlot).first;
+                    if (leftSlot.getExprId() == exprId && 
ctx.getAliasTransferPair(rightSlot) != null) {
+                        PhysicalRelation rightTable = 
ctx.getAliasTransferPair(rightSlot).first;
                         if (rightTable != null) {
                             basicTableInfos.put(rightSlot, rightTable);
                         }
-                    } else if (rightSlot.getExprId() == exprId && 
aliasTransferMap.get(leftSlot) != null) {
-                        PhysicalRelation leftTable = 
aliasTransferMap.get(leftSlot).first;
+                    } else if (rightSlot.getExprId() == exprId && 
ctx.getAliasTransferPair(leftSlot) != null) {
+                        PhysicalRelation leftTable = 
ctx.getAliasTransferPair(leftSlot).first;
                         if (leftTable != null) {
                             basicTableInfos.put(leftSlot, leftTable);
                         }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/JoinCommute.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/JoinCommute.java
index 0491abd8f82..85ad5a54181 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/JoinCommute.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/join/JoinCommute.java
@@ -114,9 +114,13 @@ public class JoinCommute extends OneExplorationRuleFactory 
{
     }
 
     private static boolean containJoin(GroupPlan groupPlan) {
-        // TODO: tmp way to judge containJoin
-        List<Slot> output = groupPlan.getOutput();
-        return 
!output.stream().map(Slot::getQualifier).allMatch(output.get(0).getQualifier()::equals);
+        if (groupPlan.getGroup().getStatistics() != null) {
+            return 
groupPlan.getGroup().getStatistics().getWidthInJoinCluster() > 1;
+        } else {
+            // tmp way to judge containJoin, just used for test case where 
stats is null
+            List<Slot> output = groupPlan.getOutput();
+            return 
!output.stream().map(Slot::getQualifier).allMatch(output.get(0).getQualifier()::equals);
+        }
     }
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java
index c086aaef5c8..496a66f745b 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java
@@ -332,7 +332,7 @@ public class FilterEstimation extends 
ExpressionVisitor<Statistics, EstimationCo
             }
         }
         compareExprStatsBuilder.setNumNulls(0);
-        Statistics estimated = new Statistics(context.statistics);
+        Statistics estimated = new 
StatisticsBuilder(context.statistics).build();
         ColumnStatistic stats = compareExprStatsBuilder.build();
         selectivity = getNotNullSelectivity(stats, selectivity);
         estimated = estimated.withSel(selectivity);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java
index a475d716fdb..52c44e3f570 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java
@@ -358,8 +358,12 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
 
     @Override
     public Statistics visitLogicalJoin(LogicalJoin<? extends Plan, ? extends 
Plan> join, Void context) {
-        return JoinEstimation.estimate(groupExpression.childStatistics(0),
+        Statistics joinStats = 
JoinEstimation.estimate(groupExpression.childStatistics(0),
                 groupExpression.childStatistics(1), join);
+        joinStats = new StatisticsBuilder(joinStats).setWidthInJoinCluster(
+                groupExpression.childStatistics(0).getWidthInJoinCluster()
+                        + 
groupExpression.childStatistics(1).getWidthInJoinCluster()).build();
+        return joinStats;
     }
 
     @Override
@@ -555,6 +559,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
     private Statistics computeAssertNumRows(long desiredNumOfRows) {
         Statistics statistics = groupExpression.childStatistics(0);
         statistics.withRowCountAndEnforceValid(Math.min(1, 
statistics.getRowCount()));
+        statistics = new 
StatisticsBuilder(statistics).setWidthInJoinCluster(1).build();
         return statistics;
     }
 
@@ -764,7 +769,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
             builder.setDataSize(rowCount * 
outputExpression.getDataType().width());
             slotToColumnStats.put(outputExpression.toSlot(), columnStat);
         }
-        return new Statistics(rowCount, slotToColumnStats);
+        return new Statistics(rowCount, 1, slotToColumnStats);
         // TODO: Update ColumnStats properly, add new mapping from output slot 
to ColumnStats
     }
 
@@ -783,7 +788,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
                             .setDataSize(stats.dataSize < 0 ? stats.dataSize : 
stats.dataSize * groupingSetNum);
                     return Pair.of(kv.getKey(), 
columnStatisticBuilder.build());
                 }).collect(Collectors.toMap(Pair::key, Pair::value));
-        return new Statistics(rowCount < 0 ? rowCount : rowCount * 
groupingSetNum, columnStatisticMap);
+        return new Statistics(rowCount < 0 ? rowCount : rowCount * 
groupingSetNum, 1, columnStatisticMap);
     }
 
     private Statistics computeProject(Project project) {
@@ -793,7 +798,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
             ColumnStatistic columnStatistic = 
ExpressionEstimation.estimate(projection, childStats);
             return new SimpleEntry<>(projection.toSlot(), columnStatistic);
         }).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, 
(item1, item2) -> item1));
-        return new Statistics(childStats.getRowCount(), columnsStats);
+        return new Statistics(childStats.getRowCount(), 
childStats.getWidthInJoinCluster(), columnsStats);
     }
 
     private Statistics computeOneRowRelation(List<NamedExpression> projects) {
@@ -805,7 +810,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
                 })
                 .collect(Collectors.toMap(Pair::key, Pair::value));
         int rowCount = 1;
-        return new Statistics(rowCount, columnStatsMap);
+        return new Statistics(rowCount, 1, columnStatsMap);
     }
 
     private Statistics computeEmptyRelation(EmptyRelation emptyRelation) {
@@ -820,7 +825,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
                 })
                 .collect(Collectors.toMap(Pair::key, Pair::value));
         int rowCount = 0;
-        return new Statistics(rowCount, columnStatsMap);
+        return new Statistics(rowCount, 1, columnStatsMap);
     }
 
     private Statistics computeUnion(Union union) {
@@ -863,7 +868,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
             statisticsBuilder.setRowCount(leftRowCount);
             statisticsBuilder.putColumnStatistics(unionOutput.get(i), 
headStats.findColumnStatistics(headSlot));
         }
-        return statisticsBuilder.build();
+        return statisticsBuilder.setWidthInJoinCluster(1).build();
     }
 
     private Statistics computeExcept(SetOperation setOperation) {
@@ -876,7 +881,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
             statisticsBuilder.putColumnStatistics(operatorOutput.get(i), 
columnStatistic);
         }
         statisticsBuilder.setRowCount(leftStats.getRowCount());
-        return statisticsBuilder.build();
+        return statisticsBuilder.setWidthInJoinCluster(1).build();
     }
 
     private Statistics computeIntersect(SetOperation setOperation) {
@@ -903,7 +908,8 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
             leftChildStats.addColumnStats(outputs.get(i),
                     
leftChildStats.findColumnStatistics(leftChildOutputs.get(i)));
         }
-        return leftChildStats.withRowCountAndEnforceValid(rowCount);
+        return new 
StatisticsBuilder(leftChildStats.withRowCountAndEnforceValid(rowCount))
+                .setWidthInJoinCluster(1).build();
     }
 
     private Statistics computeGenerate(Generate generate) {
@@ -925,7 +931,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
                     .build();
             columnStatsMap.put(output, columnStatistic);
         }
-        return new Statistics(count, columnStatsMap);
+        return new Statistics(count, 1, columnStatsMap);
     }
 
     private Statistics computeWindow(Window windowOperator) {
@@ -994,7 +1000,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
                     return Pair.of(expr.toSlot(), colStatsBuilder.build());
                 }).collect(Collectors.toMap(Pair::key, Pair::value));
         columnStatisticMap.putAll(childColumnStats);
-        return new Statistics(childStats.getRowCount(), columnStatisticMap);
+        return new Statistics(childStats.getRowCount(), 1, columnStatisticMap);
     }
 
     private ColumnStatistic unionColumn(ColumnStatistic leftStats, double 
leftRowCount, ColumnStatistic rightStats,
@@ -1033,7 +1039,8 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
 
     @Override
     public Statistics visitLogicalCTEProducer(LogicalCTEProducer<? extends 
Plan> cteProducer, Void context) {
-        Statistics statistics = groupExpression.childStatistics(0);
+        StatisticsBuilder builder = new 
StatisticsBuilder(groupExpression.childStatistics(0));
+        Statistics statistics = builder.setWidthInJoinCluster(1).build();
         cteIdToStats.put(cteProducer.getCteId(), statistics);
         return statistics;
     }
@@ -1045,7 +1052,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
                 cteConsumer.getProducerToConsumerOutputMap());
         Statistics prodStats = cteIdToStats.get(cteId);
         Preconditions.checkArgument(prodStats != null, String.format("Stats 
for CTE: %s not found", cteId));
-        Statistics consumerStats = new Statistics(prodStats.getRowCount(), new 
HashMap<>());
+        Statistics consumerStats = new Statistics(prodStats.getRowCount(), 1, 
new HashMap<>());
         for (Slot slot : cteConsumer.getOutput()) {
             Slot prodSlot = cteConsumer.getProducerSlot(slot);
             ColumnStatistic colStats = 
prodStats.columnStatistics().get(prodSlot);
@@ -1065,7 +1072,8 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
     @Override
     public Statistics visitPhysicalCTEProducer(PhysicalCTEProducer<? extends 
Plan> cteProducer,
             Void context) {
-        Statistics statistics = groupExpression.childStatistics(0);
+        Statistics statistics = new 
StatisticsBuilder(groupExpression.childStatistics(0))
+                .setWidthInJoinCluster(1).build();
         cteIdToStats.put(cteProducer.getCteId(), statistics);
         cascadesContext.updateConsumerStats(cteProducer.getCteId(), 
statistics);
         return statistics;
@@ -1081,7 +1089,7 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
             prodStats = groupExpression.getOwnerGroup().getStatistics();
         }
         Preconditions.checkArgument(prodStats != null, String.format("Stats 
for CTE: %s not found", cteId));
-        Statistics consumerStats = new Statistics(prodStats.getRowCount(), new 
HashMap<>());
+        Statistics consumerStats = new Statistics(prodStats.getRowCount(), 1, 
new HashMap<>());
         for (Slot slot : cteConsumer.getOutput()) {
             Slot prodSlot = cteConsumer.getProducerSlot(slot);
             ColumnStatistic colStats = 
prodStats.columnStatistics().get(prodSlot);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/AbstractPhysicalPlan.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/AbstractPhysicalPlan.java
index 14aa44e7943..5b668c01355 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/AbstractPhysicalPlan.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/AbstractPhysicalPlan.java
@@ -18,7 +18,6 @@
 package org.apache.doris.nereids.trees.plans.physical;
 
 import org.apache.doris.common.IdGenerator;
-import org.apache.doris.common.Pair;
 import org.apache.doris.nereids.CascadesContext;
 import org.apache.doris.nereids.memo.GroupExpression;
 import org.apache.doris.nereids.processor.post.RuntimeFilterContext;
@@ -43,7 +42,6 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 
 import java.util.List;
-import java.util.Map;
 import java.util.Optional;
 import javax.annotation.Nullable;
 
@@ -85,7 +83,6 @@ public abstract class AbstractPhysicalPlan extends 
AbstractPlan implements Physi
             Expression src, Expression probeExpr,
             TRuntimeFilterType type, long buildSideNdv, int exprOrder) {
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
         // currently, we can ensure children in the two side are corresponding 
to the equal_to's.
         // so right maybe an expression and left is a slot
         Slot probeSlot = RuntimeFilterGenerator.checkTargetChild(probeExpr);
@@ -106,8 +103,8 @@ public abstract class AbstractPhysicalPlan extends 
AbstractPlan implements Physi
             return true;
         }
 
-        Slot scanSlot = aliasTransferMap.get(probeSlot).second;
-        PhysicalRelation scan = aliasTransferMap.get(probeSlot).first;
+        Slot scanSlot = ctx.getAliasTransferPair(probeSlot).second;
+        PhysicalRelation scan = ctx.getAliasTransferPair(probeSlot).first;
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForRelation(this, scan)) {
             return false;
         }
@@ -127,14 +124,14 @@ public abstract class AbstractPhysicalPlan extends 
AbstractPlan implements Physi
             filter.addTargetExpression(scanSlot);
             ctx.addJoinToTargetMap(builderNode, scanSlot.getExprId());
             ctx.setTargetExprIdToFilter(scanSlot.getExprId(), filter);
-            ctx.setTargetsOnScanNode(aliasTransferMap.get(probeExpr).first, 
scanSlot);
+            
ctx.setTargetsOnScanNode(ctx.getAliasTransferPair((NamedExpression) 
probeExpr).first, scanSlot);
         } else {
             filter = new RuntimeFilter(generator.getNextId(),
                     src, ImmutableList.of(scanSlot), type, exprOrder, 
builderNode, buildSideNdv);
             this.addAppliedRuntimeFilter(filter);
             ctx.addJoinToTargetMap(builderNode, scanSlot.getExprId());
             ctx.setTargetExprIdToFilter(scanSlot.getExprId(), filter);
-            ctx.setTargetsOnScanNode(aliasTransferMap.get(probeExpr).first, 
scanSlot);
+            
ctx.setTargetsOnScanNode(ctx.getAliasTransferPair((NamedExpression) 
probeExpr).first, scanSlot);
             ctx.setRuntimeFilterIdentityToFilter(src, type, builderNode, 
filter);
         }
         return true;
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java
index 21833aa3c0e..0a9955feb25 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalDistribute.java
@@ -18,7 +18,6 @@
 package org.apache.doris.nereids.trees.plans.physical;
 
 import org.apache.doris.common.IdGenerator;
-import org.apache.doris.common.Pair;
 import org.apache.doris.nereids.CascadesContext;
 import org.apache.doris.nereids.memo.GroupExpression;
 import org.apache.doris.nereids.processor.post.RuntimeFilterContext;
@@ -27,7 +26,6 @@ import org.apache.doris.nereids.properties.DistributionSpec;
 import org.apache.doris.nereids.properties.LogicalProperties;
 import org.apache.doris.nereids.properties.PhysicalProperties;
 import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.expressions.NamedExpression;
 import org.apache.doris.nereids.trees.expressions.Slot;
 import org.apache.doris.nereids.trees.plans.Plan;
 import org.apache.doris.nereids.trees.plans.PlanType;
@@ -42,7 +40,6 @@ import com.google.common.collect.ImmutableList;
 import org.json.JSONObject;
 
 import java.util.List;
-import java.util.Map;
 import java.util.Optional;
 
 /**
@@ -134,7 +131,6 @@ public class PhysicalDistribute<CHILD_TYPE extends Plan> 
extends PhysicalUnary<C
             AbstractPhysicalJoin<?, ?> builderNode, Expression src, Expression 
probeExpr,
             TRuntimeFilterType type, long buildSideNdv, int exprOrder) {
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
         // currently, we can ensure children in the two side are corresponding 
to the equal_to's.
         // so right maybe an expression and left is a slot
         Slot probeSlot = RuntimeFilterGenerator.checkTargetChild(probeExpr);
@@ -144,7 +140,7 @@ public class PhysicalDistribute<CHILD_TYPE extends Plan> 
extends PhysicalUnary<C
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForJoin(builderNode, ctx, 
probeSlot)) {
             return false;
         }
-        PhysicalRelation scan = aliasTransferMap.get(probeSlot).first;
+        PhysicalRelation scan = ctx.getAliasTransferPair(probeSlot).first;
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForRelation(this, scan)) {
             return false;
         }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java
index a8ca551bea1..9d81831d897 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashAggregate.java
@@ -18,7 +18,6 @@
 package org.apache.doris.nereids.trees.plans.physical;
 
 import org.apache.doris.common.IdGenerator;
-import org.apache.doris.common.Pair;
 import org.apache.doris.nereids.CascadesContext;
 import org.apache.doris.nereids.memo.GroupExpression;
 import org.apache.doris.nereids.processor.post.RuntimeFilterContext;
@@ -46,7 +45,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 
@@ -298,7 +296,6 @@ public class PhysicalHashAggregate<CHILD_TYPE extends Plan> 
extends PhysicalUnar
             AbstractPhysicalJoin<?, ?> builderNode, Expression src, Expression 
probeExpr,
             TRuntimeFilterType type, long buildSideNdv, int exprOrder) {
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
         // currently, we can ensure children in the two side are corresponding 
to the equal_to's.
         // so right maybe an expression and left is a slot
         Slot probeSlot = RuntimeFilterGenerator.checkTargetChild(probeExpr);
@@ -308,7 +305,7 @@ public class PhysicalHashAggregate<CHILD_TYPE extends Plan> 
extends PhysicalUnar
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForJoin(builderNode, ctx, 
probeSlot)) {
             return false;
         }
-        PhysicalRelation scan = aliasTransferMap.get(probeSlot).first;
+        PhysicalRelation scan = ctx.getAliasTransferPair(probeSlot).first;
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForRelation(this, scan)) {
             return false;
         }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java
index b62f0ff759f..b1dd9a329c1 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHashJoin.java
@@ -30,7 +30,6 @@ import 
org.apache.doris.nereids.trees.expressions.EqualPredicate;
 import org.apache.doris.nereids.trees.expressions.ExprId;
 import org.apache.doris.nereids.trees.expressions.Expression;
 import org.apache.doris.nereids.trees.expressions.MarkJoinSlotReference;
-import org.apache.doris.nereids.trees.expressions.NamedExpression;
 import org.apache.doris.nereids.trees.expressions.Slot;
 import org.apache.doris.nereids.trees.plans.JoinType;
 import org.apache.doris.nereids.trees.plans.Plan;
@@ -47,7 +46,6 @@ import com.google.common.collect.Sets;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
@@ -188,7 +186,6 @@ public class PhysicalHashJoin<
             }
         }
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
 
         // if rf built between plan nodes containing cte both, for example 
both src slot and target slot are from cte,
         // or two sub-queries both containing cte, disable this rf since this 
kind of cross-cte rf will make one side
@@ -239,7 +236,7 @@ public class PhysicalHashJoin<
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForJoin(builderNode, ctx, 
probeSlot)) {
             return false;
         }
-        PhysicalRelation scan = aliasTransferMap.get(probeSlot).first;
+        PhysicalRelation scan = ctx.getAliasTransferPair(probeSlot).first;
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForRelation(this, scan)) {
             return false;
         }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalProject.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalProject.java
index 5066d2ad912..663bc265955 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalProject.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalProject.java
@@ -18,7 +18,6 @@
 package org.apache.doris.nereids.trees.plans.physical;
 
 import org.apache.doris.common.IdGenerator;
-import org.apache.doris.common.Pair;
 import org.apache.doris.nereids.CascadesContext;
 import org.apache.doris.nereids.memo.GroupExpression;
 import org.apache.doris.nereids.processor.post.RuntimeFilterContext;
@@ -42,7 +41,6 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
 
@@ -162,7 +160,6 @@ public class PhysicalProject<CHILD_TYPE extends Plan> 
extends PhysicalUnary<CHIL
             AbstractPhysicalJoin<?, ?> builderNode, Expression src, Expression 
probeExpr,
             TRuntimeFilterType type, long buildSideNdv, int exprOrder) {
         RuntimeFilterContext ctx = context.getRuntimeFilterContext();
-        Map<NamedExpression, Pair<PhysicalRelation, Slot>> aliasTransferMap = 
ctx.getAliasTransferMap();
         // currently, we can ensure children in the two side are corresponding 
to the equal_to's.
         // so right maybe an expression and left is a slot
         Slot probeSlot = RuntimeFilterGenerator.checkTargetChild(probeExpr);
@@ -172,7 +169,7 @@ public class PhysicalProject<CHILD_TYPE extends Plan> 
extends PhysicalUnary<CHIL
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForJoin(builderNode, ctx, 
probeSlot)) {
             return false;
         }
-        PhysicalRelation scan = aliasTransferMap.get(probeSlot).first;
+        PhysicalRelation scan = ctx.getAliasTransferPair(probeSlot).first;
         Preconditions.checkState(scan != null, "scan is null");
         if (scan instanceof PhysicalCTEConsumer) {
             // update the probeExpr
@@ -196,7 +193,7 @@ public class PhysicalProject<CHILD_TYPE extends Plan> 
extends PhysicalUnary<CHIL
             if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForJoin(builderNode, ctx, 
newProbeSlot)) {
                 return false;
             }
-            scan = aliasTransferMap.get(newProbeSlot).first;
+            scan = ctx.getAliasTransferPair(newProbeSlot).first;
             probeExpr = newProbeExpr;
         }
         if 
(!RuntimeFilterGenerator.checkPushDownPreconditionsForRelation(this, scan)) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java 
b/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java
index 5afcdae0665..00a32f64356 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/Statistics.java
@@ -33,18 +33,19 @@ public class Statistics {
     private final double rowCount;
 
     private final Map<Expression, ColumnStatistic> expressionToColumnStats;
+    private final int widthInJoinCluster;
 
     // the byte size of one tuple
     private double tupleSize;
 
-    public Statistics(Statistics another) {
-        this.rowCount = another.rowCount;
-        this.expressionToColumnStats = new 
HashMap<>(another.expressionToColumnStats);
-        this.tupleSize = another.tupleSize;
+    public Statistics(double rowCount, Map<Expression, ColumnStatistic> 
expressionToColumnStats) {
+        this(rowCount, 1, expressionToColumnStats);
     }
 
-    public Statistics(double rowCount, Map<Expression, ColumnStatistic> 
expressionToColumnStats) {
+    public Statistics(double rowCount, int widthInJoinCluster,
+                      Map<Expression, ColumnStatistic> 
expressionToColumnStats) {
         this.rowCount = rowCount;
+        this.widthInJoinCluster = widthInJoinCluster;
         this.expressionToColumnStats = expressionToColumnStats;
     }
 
@@ -61,14 +62,14 @@ public class Statistics {
     }
 
     public Statistics withRowCount(double rowCount) {
-        return new Statistics(rowCount, new 
HashMap<>(expressionToColumnStats));
+        return new Statistics(rowCount, widthInJoinCluster, new 
HashMap<>(expressionToColumnStats));
     }
 
     /**
      * Update by count.
      */
     public Statistics withRowCountAndEnforceValid(double rowCount) {
-        Statistics statistics = new Statistics(rowCount, 
expressionToColumnStats);
+        Statistics statistics = new Statistics(rowCount, widthInJoinCluster, 
expressionToColumnStats);
         statistics.enforceValid();
         return statistics;
     }
@@ -99,7 +100,7 @@ public class Statistics {
             return this;
         }
         double newCount = rowCount * sel;
-        return new Statistics(newCount, new 
HashMap<>(expressionToColumnStats));
+        return new Statistics(newCount, widthInJoinCluster, new 
HashMap<>(expressionToColumnStats));
     }
 
     public Statistics addColumnStats(Expression expression, ColumnStatistic 
columnStatistic) {
@@ -146,7 +147,7 @@ public class Statistics {
             return "-Infinite";
         }
         DecimalFormat format = new DecimalFormat("#,###.##");
-        return format.format(rowCount);
+        return format.format(rowCount) + " " + widthInJoinCluster;
     }
 
     public int getBENumber() {
@@ -181,10 +182,14 @@ public class Statistics {
         StringBuilder builder = new StringBuilder();
         builder.append(prefix).append("rows=").append(rowCount).append("\n");
         
builder.append(prefix).append("tupleSize=").append(computeTupleSize()).append("\n");
-
+        
builder.append(prefix).append("width=").append(widthInJoinCluster).append("\n");
         for (Entry<Expression, ColumnStatistic> entry : 
expressionToColumnStats.entrySet()) {
             builder.append(prefix).append(entry.getKey()).append(" -> 
").append(entry.getValue()).append("\n");
         }
         return builder.toString();
     }
+
+    public int getWidthInJoinCluster() {
+        return widthInJoinCluster;
+    }
 }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsBuilder.java 
b/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsBuilder.java
index a0e75f7df38..53d8f49cb14 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsBuilder.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticsBuilder.java
@@ -25,7 +25,7 @@ import java.util.Map;
 public class StatisticsBuilder {
 
     private double rowCount;
-
+    private int widthInJoinCluster;
     private final Map<Expression, ColumnStatistic> expressionToColumnStats;
 
     public StatisticsBuilder() {
@@ -34,6 +34,7 @@ public class StatisticsBuilder {
 
     public StatisticsBuilder(Statistics statistics) {
         this.rowCount = statistics.getRowCount();
+        this.widthInJoinCluster = statistics.getWidthInJoinCluster();
         expressionToColumnStats = new HashMap<>();
         expressionToColumnStats.putAll(statistics.columnStatistics());
     }
@@ -43,6 +44,11 @@ public class StatisticsBuilder {
         return this;
     }
 
+    public StatisticsBuilder setWidthInJoinCluster(int widthInJoinCluster) {
+        this.widthInJoinCluster = widthInJoinCluster;
+        return this;
+    }
+
     public StatisticsBuilder putColumnStatistics(
             Map<Expression, ColumnStatistic> expressionToColumnStats) {
         this.expressionToColumnStats.putAll(expressionToColumnStats);
@@ -55,6 +61,6 @@ public class StatisticsBuilder {
     }
 
     public Statistics build() {
-        return new Statistics(rowCount, expressionToColumnStats);
+        return new Statistics(rowCount, widthInJoinCluster, 
expressionToColumnStats);
     }
 }
diff --git 
a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
 
b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
index dcec484dfd6..135190f5ceb 100644
--- 
a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
+++ 
b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_count_through_join.out
@@ -89,12 +89,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((count_t.score > 10))
 ----------------PhysicalOlapScan[count_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -112,12 +112,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((count_t.score > 10))
 ----------------PhysicalOlapScan[count_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -226,12 +226,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((t1.score > 50))
 ----------------PhysicalOlapScan[count_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -297,10 +297,10 @@ PhysicalResultSink
 --------hashAgg[LOCAL]
 ----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
 ------------hashAgg[LOCAL]
---------------filter((count_t.score > 20) and (t1.id < 100))
+--------------filter((count_t.id < 100))
 ----------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
---------------filter((count_t.id < 100))
+--------------filter((count_t.score > 20) and (t1.id < 100))
 ----------------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_basic --
@@ -395,12 +395,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((count_t.score > 10))
 ----------------PhysicalOlapScan[count_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -418,12 +418,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((count_t.score > 10))
 ----------------PhysicalOlapScan[count_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -500,12 +500,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((t1.score > 50))
 ----------------PhysicalOlapScan[count_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[count_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -549,9 +549,9 @@ PhysicalResultSink
 --------hashAgg[LOCAL]
 ----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
 ------------hashAgg[LOCAL]
---------------filter((count_t.score > 20) and (t1.id < 100))
+--------------filter((count_t.id < 100))
 ----------------PhysicalOlapScan[count_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
---------------filter((count_t.id < 100))
+--------------filter((count_t.score > 20) and (t1.id < 100))
 ----------------PhysicalOlapScan[count_t]
 
diff --git 
a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
 
b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
index d74b311df9f..1e497ebd80e 100644
--- 
a/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
+++ 
b/regression-test/data/nereids_rules_p0/eager_aggregate/push_down_sum_through_join.out
@@ -89,12 +89,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[sum_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((sum_t.score > 10))
 ----------------PhysicalOlapScan[sum_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[sum_t]
 
 -- !groupby_pushdown_outer_join --
 PhysicalResultSink
@@ -112,12 +112,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[sum_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((sum_t.score > 10))
 ----------------PhysicalOlapScan[sum_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[sum_t]
 
 -- !groupby_pushdown_having --
 PhysicalResultSink
@@ -224,12 +224,12 @@ PhysicalResultSink
 ----hashAgg[GLOBAL]
 ------PhysicalDistribute[DistributionSpecHash]
 --------hashAgg[LOCAL]
-----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
+------------hashAgg[LOCAL]
+--------------PhysicalOlapScan[sum_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
 --------------filter((t1.score > 50))
 ----------------PhysicalOlapScan[sum_t]
-------------hashAgg[LOCAL]
---------------PhysicalOlapScan[sum_t]
 
 -- !groupby_pushdown_varied_aggregates --
 PhysicalResultSink
@@ -295,9 +295,9 @@ PhysicalResultSink
 --------hashAgg[LOCAL]
 ----------hashJoin[INNER_JOIN] hashCondition=((t1.id = t2.id)) 
otherCondition=() build RFs:RF0 id->[id]
 ------------hashAgg[LOCAL]
---------------filter((sum_t.score > 20) and (t1.id < 100))
+--------------filter((sum_t.id < 100))
 ----------------PhysicalOlapScan[sum_t] apply RFs: RF0
 ------------hashAgg[LOCAL]
---------------filter((sum_t.id < 100))
+--------------filter((sum_t.score > 20) and (t1.id < 100))
 ----------------PhysicalOlapScan[sum_t]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query10.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query10.out
index 73add015413..49d24a004db 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query10.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query10.out
@@ -13,28 +13,28 @@ PhysicalResultSink
 --------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)) otherCondition=()
 ----------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk 
= web_sales.ws_bill_customer_sk)) otherCondition=()
 ------------------------PhysicalProject
---------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF5 c_customer_sk->[ss_customer_sk]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 d_date_sk->[ss_sold_date_sk]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[store_sales] apply RFs: 
RF4 RF5
-----------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF5 ca_address_sk->[c_current_addr_sk]
+----------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=()
+------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
 ------------------------------------PhysicalProject
---------------------------------------filter((date_dim.d_moy <= 4) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2001))
-----------------------------------------PhysicalOlapScan[date_dim]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=()
---------------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF2 ca_address_sk->[c_current_addr_sk]
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF2 RF3
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------------PhysicalProject
+--------------------------------------------filter((date_dim.d_moy <= 4) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2001))
+----------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
 ------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[customer] apply RFs: RF2
-------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------PhysicalProject
-----------------------------------------filter(ca_county IN ('Cochran County', 
'Kandiyohi County', 'Marquette County', 'Storey County', 'Warren County'))
-------------------------------------------PhysicalOlapScan[customer_address]
---------------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------------PhysicalOlapScan[customer_demographics]
+--------------------------------------PhysicalOlapScan[customer] apply RFs: RF5
+------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------PhysicalOlapScan[customer_demographics]
+----------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------PhysicalProject
+--------------------------------filter(ca_county IN ('Cochran County', 
'Kandiyohi County', 'Marquette County', 'Storey County', 'Warren County'))
+----------------------------------PhysicalOlapScan[customer_address]
 ------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------PhysicalProject
 ----------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query35.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query35.out
index b6c9c4373e6..a849eb675a5 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query35.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query35.out
@@ -13,29 +13,29 @@ PhysicalResultSink
 --------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)) otherCondition=()
 ----------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk 
= web_sales.ws_bill_customer_sk)) otherCondition=()
 ------------------------PhysicalProject
---------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=()
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 d_date_sk->[ss_sold_date_sk]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[store_sales] apply RFs: 
RF4
-----------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------PhysicalProject
---------------------------------------filter((date_dim.d_qoy < 4) and 
(date_dim.d_year = 2001))
-----------------------------------------PhysicalOlapScan[date_dim]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=()
 ----------------------------PhysicalDistribute[DistributionSpecHash]
 ------------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=()
 --------------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=()
+----------------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) otherCondition=()
 ------------------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[customer]
+----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+------------------------------------------PhysicalProject
+--------------------------------------------PhysicalOlapScan[store_sales] 
apply RFs: RF2
+------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------------------PhysicalProject
+----------------------------------------------filter((date_dim.d_qoy < 4) and 
(date_dim.d_year = 2001))
+------------------------------------------------PhysicalOlapScan[date_dim]
 ------------------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[customer_address]
+----------------------------------------PhysicalOlapScan[customer]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------------------PhysicalProject
 ------------------------------------PhysicalOlapScan[customer_demographics]
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[customer_address]
 ------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------PhysicalProject
 ----------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out
index 3f377d4f21e..069f7230ce0 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query44.out
@@ -5,71 +5,68 @@ PhysicalResultSink
 ----PhysicalDistribute[DistributionSpecGather]
 ------PhysicalTopN[LOCAL_SORT]
 --------PhysicalProject
-----------hashJoin[INNER_JOIN] hashCondition=((i2.i_item_sk = 
descending.item_sk)) otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((i2.i_item_sk = 
descending.item_sk)) otherCondition=() build RFs:RF1 item_sk->[i_item_sk]
+------------PhysicalProject
+--------------PhysicalOlapScan[item] apply RFs: RF1
 ------------PhysicalDistribute[DistributionSpecHash]
 --------------PhysicalProject
-----------------hashJoin[INNER_JOIN] hashCondition=((i1.i_item_sk = 
asceding.item_sk)) otherCondition=()
+----------------hashJoin[INNER_JOIN] hashCondition=((i1.i_item_sk = 
asceding.item_sk)) otherCondition=() build RFs:RF0 item_sk->[i_item_sk]
+------------------PhysicalProject
+--------------------PhysicalOlapScan[item] apply RFs: RF0
 ------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN] hashCondition=((asceding.rnk = 
descending.rnk)) otherCondition=()
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------filter((rnk < 11))
-------------------------------PhysicalWindow
---------------------------------PhysicalQuickSort[MERGE_SORT]
-----------------------------------PhysicalDistribute[DistributionSpecGather]
-------------------------------------PhysicalQuickSort[LOCAL_SORT]
---------------------------------------PhysicalPartitionTopN
-----------------------------------------PhysicalProject
-------------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
---------------------------------------------PhysicalProject
-----------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------filter((ss1.ss_store_sk 
= 146))
---------------------------------------------------------PhysicalOlapScan[store_sales]
---------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------------------PhysicalAssertNumRows
-------------------------------------------------PhysicalDistribute[DistributionSpecGather]
+--------------------hashJoin[INNER_JOIN] hashCondition=((asceding.rnk = 
descending.rnk)) otherCondition=()
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------PhysicalProject
+--------------------------filter((rnk < 11))
+----------------------------PhysicalWindow
+------------------------------PhysicalQuickSort[MERGE_SORT]
+--------------------------------PhysicalDistribute[DistributionSpecGather]
+----------------------------------PhysicalQuickSort[LOCAL_SORT]
+------------------------------------PhysicalPartitionTopN
+--------------------------------------PhysicalProject
+----------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
+------------------------------------------PhysicalProject
+--------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------hashAgg[LOCAL]
 --------------------------------------------------PhysicalProject
-----------------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------------PhysicalProject
-------------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
---------------------------------------------------------------PhysicalOlapScan[store_sales]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------filter((rnk < 11))
-------------------------------PhysicalWindow
---------------------------------PhysicalQuickSort[MERGE_SORT]
-----------------------------------PhysicalDistribute[DistributionSpecGather]
-------------------------------------PhysicalQuickSort[LOCAL_SORT]
---------------------------------------PhysicalPartitionTopN
-----------------------------------------PhysicalProject
-------------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
---------------------------------------------PhysicalProject
-----------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------filter((ss1.ss_store_sk 
= 146))
---------------------------------------------------------PhysicalOlapScan[store_sales]
---------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------------------PhysicalAssertNumRows
-------------------------------------------------PhysicalDistribute[DistributionSpecGather]
+----------------------------------------------------filter((ss1.ss_store_sk = 
146))
+------------------------------------------------------PhysicalOlapScan[store_sales]
+------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------------------PhysicalAssertNumRows
+----------------------------------------------PhysicalDistribute[DistributionSpecGather]
+------------------------------------------------PhysicalProject
+--------------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------------hashAgg[LOCAL]
+--------------------------------------------------------PhysicalProject
+----------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
+------------------------------------------------------------PhysicalOlapScan[store_sales]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------PhysicalProject
+--------------------------filter((rnk < 11))
+----------------------------PhysicalWindow
+------------------------------PhysicalQuickSort[MERGE_SORT]
+--------------------------------PhysicalDistribute[DistributionSpecGather]
+----------------------------------PhysicalQuickSort[LOCAL_SORT]
+------------------------------------PhysicalPartitionTopN
+--------------------------------------PhysicalProject
+----------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
+------------------------------------------PhysicalProject
+--------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------hashAgg[LOCAL]
 --------------------------------------------------PhysicalProject
-----------------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------------PhysicalProject
-------------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
---------------------------------------------------------------PhysicalOlapScan[store_sales]
-------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------PhysicalOlapScan[item]
-------------PhysicalDistribute[DistributionSpecHash]
---------------PhysicalProject
-----------------PhysicalOlapScan[item]
+----------------------------------------------------filter((ss1.ss_store_sk = 
146))
+------------------------------------------------------PhysicalOlapScan[store_sales]
+------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------------------PhysicalAssertNumRows
+----------------------------------------------PhysicalDistribute[DistributionSpecGather]
+------------------------------------------------PhysicalProject
+--------------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------------hashAgg[LOCAL]
+--------------------------------------------------------PhysicalProject
+----------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
+------------------------------------------------------------PhysicalOlapScan[store_sales]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query59.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query59.out
index d90709a513a..12c4bec36a7 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query59.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query59.out
@@ -19,30 +19,31 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 --------PhysicalDistribute[DistributionSpecGather]
 ----------PhysicalTopN[LOCAL_SORT]
 ------------PhysicalProject
---------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk) and (y.s_store_id1 = x.s_store_id2)) otherCondition=() build 
RFs:RF4 s_store_id2->[s_store_id];RF5 s_store_sk->[ss_store_sk]
+--------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq1)) otherCondition=() build RFs:RF5 d_week_seq->[d_week_seq]
 ----------------PhysicalProject
-------------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk)) otherCondition=() build RFs:RF3 s_store_sk->[ss_store_sk]
---------------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq1)) otherCondition=() build RFs:RF2 d_week_seq->[d_week_seq]
-----------------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq2)) otherCondition=() build RFs:RF1 d_week_seq->[d_week_seq]
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((expr_cast(d_week_seq1 as BIGINT) = expr_(d_week_seq2 - 52))) 
otherCondition=()
---------------------------PhysicalDistribute[DistributionSpecHash]
+------------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk) and (y.s_store_id1 = x.s_store_id2)) otherCondition=() build 
RFs:RF3 s_store_id1->[s_store_id];RF4 s_store_sk->[ss_store_sk]
+--------------------PhysicalProject
+----------------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk)) otherCondition=() build RFs:RF2 s_store_sk->[ss_store_sk]
+------------------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq2)) otherCondition=() build RFs:RF1 d_week_seq->[d_week_seq]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((expr_cast(d_week_seq1 as BIGINT) = expr_(d_week_seq2 - 52))) 
otherCondition=()
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+--------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+------------------------------filter((d.d_month_seq <= 1219) and 
(d.d_month_seq >= 1208))
+--------------------------------PhysicalOlapScan[date_dim]
 ------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------PhysicalProject
-----------------------------filter((d.d_month_seq <= 1219) and (d.d_month_seq 
>= 1208))
-------------------------------PhysicalOlapScan[date_dim]
-----------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------PhysicalProject
---------------------------filter((d.d_month_seq <= 1207) and (d.d_month_seq >= 
1196))
-----------------------------PhysicalOlapScan[date_dim]
+----------------------------PhysicalOlapScan[store] apply RFs: RF3
 --------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------PhysicalProject
-------------------------PhysicalOlapScan[store] apply RFs: RF4
+------------------------PhysicalOlapScan[store]
 ----------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------PhysicalProject
---------------------PhysicalOlapScan[store]
+--------------------filter((d.d_month_seq <= 1207) and (d.d_month_seq >= 1196))
+----------------------PhysicalOlapScan[date_dim]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query69.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query69.out
index 778ab2fd4ec..449d29bf0c2 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query69.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query69.out
@@ -9,48 +9,49 @@ PhysicalResultSink
 ------------PhysicalDistribute[DistributionSpecHash]
 --------------hashAgg[LOCAL]
 ----------------PhysicalProject
-------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = 
store_sales.ss_customer_sk)) otherCondition=() build RFs:RF7 
c_customer_sk->[ss_customer_sk]
+------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)) otherCondition=()
 --------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF6 d_date_sk->[ss_sold_date_sk]
+------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF5 ca_address_sk->[c_current_addr_sk]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=()
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------hashJoin[LEFT_ANTI_JOIN] 
hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) 
otherCondition=()
+--------------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF2 RF3
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------------PhysicalProject
+--------------------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
+----------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalOlapScan[customer] apply RFs: RF5
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[web_sales] apply RFs: 
RF1
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------------------PhysicalProject
+------------------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
+--------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[customer_demographics]
+--------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------PhysicalProject
+------------------------------filter(ca_state IN ('MI', 'TX', 'VA'))
+--------------------------------PhysicalOlapScan[customer_address]
+--------------------PhysicalDistribute[DistributionSpecHash]
+----------------------PhysicalProject
+------------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[cs_sold_date_sk]
 --------------------------PhysicalProject
-----------------------------PhysicalOlapScan[store_sales] apply RFs: RF6 RF7
+----------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0
 --------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------PhysicalProject
 ------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy 
>= 1) and (date_dim.d_year = 2000))
 --------------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalProject
-----------------------hashJoin[RIGHT_ANTI_JOIN] 
hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) 
otherCondition=() build RFs:RF5 c_customer_sk->[cs_ship_customer_sk]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 d_date_sk->[cs_sold_date_sk]
-------------------------------PhysicalProject
---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 
RF5
-------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------PhysicalProject
-----------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
-------------------------------------PhysicalOlapScan[date_dim]
-------------------------hashJoin[RIGHT_ANTI_JOIN] 
hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) 
otherCondition=() build RFs:RF3 c_customer_sk->[ws_bill_customer_sk]
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 
RF3
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
---------------------------------------PhysicalOlapScan[date_dim]
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=()
-------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF0 ca_address_sk->[c_current_addr_sk]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[customer] apply RFs: RF0
-----------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------PhysicalProject
---------------------------------------filter(ca_state IN ('MI', 'TX', 'VA'))
-----------------------------------------PhysicalOlapScan[customer_address]
-------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[customer_demographics]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query95.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query95.out
index b54e3c5c0ea..4c4fbb34f6e 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query95.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/noStatsRfPrune/query95.out
@@ -3,13 +3,13 @@
 PhysicalCteAnchor ( cteId=CTEId#0 )
 --PhysicalCteProducer ( cteId=CTEId#0 )
 ----PhysicalProject
-------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_order_number = 
ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = 
ws_warehouse_sk))) build RFs:RF0 ws_order_number->[ws_order_number]
+------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_order_number = 
ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = 
ws_warehouse_sk)))
 --------PhysicalDistribute[DistributionSpecHash]
 ----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF6 RF7
+------------PhysicalOlapScan[web_sales]
 --------PhysicalDistribute[DistributionSpecHash]
 ----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF6 RF7
+------------PhysicalOlapScan[web_sales]
 --PhysicalResultSink
 ----PhysicalTopN[MERGE_SORT]
 ------PhysicalTopN[LOCAL_SORT]
@@ -19,35 +19,35 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 --------------hashAgg[GLOBAL]
 ----------------hashAgg[LOCAL]
 ------------------PhysicalProject
---------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=()
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF7 
wr_order_number->[ws_order_number,ws_order_number]
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[web_returns]
-----------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() 
build RFs:RF4 ws_order_number->[ws_order_number];RF6 
ws_order_number->[ws_order_number,ws_order_number]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() 
build RFs:RF3 web_site_sk->[ws_web_site_sk]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF2 ca_address_sk->[ws_ship_addr_sk]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF1 d_date_sk->[ws_ship_date_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 
RF2 RF3
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_date <= '1999-04-02') 
and (date_dim.d_date >= '1999-02-01'))
---------------------------------------PhysicalOlapScan[date_dim]
-------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=()
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------PhysicalProject
+--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+----------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk 
= web_site.web_site_sk)) otherCondition=() build RFs:RF5 
web_site_sk->[ws_web_site_sk]
+------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF4 ca_address_sk->[ws_ship_addr_sk]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF3 d_date_sk->[ws_ship_date_sk]
+----------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=() build RFs:RF2 ws_order_number->[wr_order_number]
+------------------------------PhysicalProject
+--------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF1 wr_order_number->[ws_order_number]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalOlapScan[web_returns] apply RFs: 
RF2
+------------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------------PhysicalProject
-----------------------------------filter((customer_address.ca_state = 'NC'))
-------------------------------------PhysicalOlapScan[customer_address]
+----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF3 
RF4 RF5
 ----------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------PhysicalProject
---------------------------------filter((web_site.web_company_name = 'pri'))
-----------------------------------PhysicalOlapScan[web_site]
+--------------------------------filter((date_dim.d_date <= '1999-04-02') and 
(date_dim.d_date >= '1999-02-01'))
+----------------------------------PhysicalOlapScan[date_dim]
+--------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------PhysicalProject
+------------------------------filter((customer_address.ca_state = 'NC'))
+--------------------------------PhysicalOlapScan[customer_address]
+------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------PhysicalProject
+----------------------------filter((web_site.web_company_name = 'pri'))
+------------------------------PhysicalOlapScan[web_site]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query10.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query10.out
index 6a46828f0a3..9e185b3a54e 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query10.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query10.out
@@ -13,28 +13,28 @@ PhysicalResultSink
 --------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)) otherCondition=()
 ----------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk 
= web_sales.ws_bill_customer_sk)) otherCondition=()
 ------------------------PhysicalProject
---------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF5 c_customer_sk->[ss_customer_sk]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 d_date_sk->[ss_sold_date_sk]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[store_sales] apply RFs: 
RF4 RF5
-----------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF5 ca_address_sk->[c_current_addr_sk]
+----------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=() build RFs:RF4 cd_demo_sk->[c_current_cdemo_sk]
+------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
 ------------------------------------PhysicalProject
---------------------------------------filter((date_dim.d_moy <= 4) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2001))
-----------------------------------------PhysicalOlapScan[date_dim]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=() build RFs:RF3 cd_demo_sk->[c_current_cdemo_sk]
---------------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF2 ca_address_sk->[c_current_addr_sk]
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF2 RF3
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------------PhysicalProject
+--------------------------------------------filter((date_dim.d_moy <= 4) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2001))
+----------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
 ------------------------------------PhysicalProject
---------------------------------------PhysicalOlapScan[customer] apply RFs: 
RF2 RF3
-------------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------------PhysicalProject
-----------------------------------------filter(ca_county IN ('Cochran County', 
'Kandiyohi County', 'Marquette County', 'Storey County', 'Warren County'))
-------------------------------------------PhysicalOlapScan[customer_address]
---------------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------------PhysicalOlapScan[customer_demographics]
+--------------------------------------PhysicalOlapScan[customer] apply RFs: 
RF4 RF5
+------------------------------PhysicalDistribute[DistributionSpecHash]
+--------------------------------PhysicalOlapScan[customer_demographics]
+----------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------PhysicalProject
+--------------------------------filter(ca_county IN ('Cochran County', 
'Kandiyohi County', 'Marquette County', 'Storey County', 'Warren County'))
+----------------------------------PhysicalOlapScan[customer_address]
 ------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------PhysicalProject
 ----------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query35.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query35.out
index c967d42e5e7..03410c1b280 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query35.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query35.out
@@ -13,29 +13,29 @@ PhysicalResultSink
 --------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)) otherCondition=()
 ----------------------hashJoin[LEFT_SEMI_JOIN] hashCondition=((c.c_customer_sk 
= web_sales.ws_bill_customer_sk)) otherCondition=()
 ------------------------PhysicalProject
---------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF5 c_customer_sk->[ss_customer_sk]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF5 ca_address_sk->[c_current_addr_sk]
 ----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------PhysicalProject
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 d_date_sk->[ss_sold_date_sk]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[store_sales] apply RFs: 
RF4 RF5
-----------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------PhysicalProject
---------------------------------------filter((date_dim.d_qoy < 4) and 
(date_dim.d_year = 2001))
-----------------------------------------PhysicalOlapScan[date_dim]
-----------------------------PhysicalDistribute[DistributionSpecHash]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=() build RFs:RF3 cd_demo_sk->[c_current_cdemo_sk]
+------------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=() build RFs:RF4 cd_demo_sk->[c_current_cdemo_sk]
 --------------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF2 ca_address_sk->[c_current_addr_sk]
+----------------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk]
 ------------------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[customer] apply RFs: 
RF2 RF3
+----------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+------------------------------------------PhysicalProject
+--------------------------------------------PhysicalOlapScan[store_sales] 
apply RFs: RF2 RF3
+------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------------------PhysicalProject
+----------------------------------------------filter((date_dim.d_qoy < 4) and 
(date_dim.d_year = 2001))
+------------------------------------------------PhysicalOlapScan[date_dim]
 ------------------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------------------PhysicalProject
-----------------------------------------PhysicalOlapScan[customer_address]
+----------------------------------------PhysicalOlapScan[customer] apply RFs: 
RF4 RF5
 --------------------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------------------PhysicalProject
 ------------------------------------PhysicalOlapScan[customer_demographics]
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[customer_address]
 ------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------PhysicalProject
 ----------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out
index 3f377d4f21e..069f7230ce0 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query44.out
@@ -5,71 +5,68 @@ PhysicalResultSink
 ----PhysicalDistribute[DistributionSpecGather]
 ------PhysicalTopN[LOCAL_SORT]
 --------PhysicalProject
-----------hashJoin[INNER_JOIN] hashCondition=((i2.i_item_sk = 
descending.item_sk)) otherCondition=()
+----------hashJoin[INNER_JOIN] hashCondition=((i2.i_item_sk = 
descending.item_sk)) otherCondition=() build RFs:RF1 item_sk->[i_item_sk]
+------------PhysicalProject
+--------------PhysicalOlapScan[item] apply RFs: RF1
 ------------PhysicalDistribute[DistributionSpecHash]
 --------------PhysicalProject
-----------------hashJoin[INNER_JOIN] hashCondition=((i1.i_item_sk = 
asceding.item_sk)) otherCondition=()
+----------------hashJoin[INNER_JOIN] hashCondition=((i1.i_item_sk = 
asceding.item_sk)) otherCondition=() build RFs:RF0 item_sk->[i_item_sk]
+------------------PhysicalProject
+--------------------PhysicalOlapScan[item] apply RFs: RF0
 ------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------hashJoin[INNER_JOIN] hashCondition=((asceding.rnk = 
descending.rnk)) otherCondition=()
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------filter((rnk < 11))
-------------------------------PhysicalWindow
---------------------------------PhysicalQuickSort[MERGE_SORT]
-----------------------------------PhysicalDistribute[DistributionSpecGather]
-------------------------------------PhysicalQuickSort[LOCAL_SORT]
---------------------------------------PhysicalPartitionTopN
-----------------------------------------PhysicalProject
-------------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
---------------------------------------------PhysicalProject
-----------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------filter((ss1.ss_store_sk 
= 146))
---------------------------------------------------------PhysicalOlapScan[store_sales]
---------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------------------PhysicalAssertNumRows
-------------------------------------------------PhysicalDistribute[DistributionSpecGather]
+--------------------hashJoin[INNER_JOIN] hashCondition=((asceding.rnk = 
descending.rnk)) otherCondition=()
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------PhysicalProject
+--------------------------filter((rnk < 11))
+----------------------------PhysicalWindow
+------------------------------PhysicalQuickSort[MERGE_SORT]
+--------------------------------PhysicalDistribute[DistributionSpecGather]
+----------------------------------PhysicalQuickSort[LOCAL_SORT]
+------------------------------------PhysicalPartitionTopN
+--------------------------------------PhysicalProject
+----------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
+------------------------------------------PhysicalProject
+--------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------hashAgg[LOCAL]
 --------------------------------------------------PhysicalProject
-----------------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------------PhysicalProject
-------------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
---------------------------------------------------------------PhysicalOlapScan[store_sales]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------filter((rnk < 11))
-------------------------------PhysicalWindow
---------------------------------PhysicalQuickSort[MERGE_SORT]
-----------------------------------PhysicalDistribute[DistributionSpecGather]
-------------------------------------PhysicalQuickSort[LOCAL_SORT]
---------------------------------------PhysicalPartitionTopN
-----------------------------------------PhysicalProject
-------------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
---------------------------------------------PhysicalProject
-----------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------PhysicalProject
-------------------------------------------------------filter((ss1.ss_store_sk 
= 146))
---------------------------------------------------------PhysicalOlapScan[store_sales]
---------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------------------PhysicalAssertNumRows
-------------------------------------------------PhysicalDistribute[DistributionSpecGather]
+----------------------------------------------------filter((ss1.ss_store_sk = 
146))
+------------------------------------------------------PhysicalOlapScan[store_sales]
+------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------------------PhysicalAssertNumRows
+----------------------------------------------PhysicalDistribute[DistributionSpecGather]
+------------------------------------------------PhysicalProject
+--------------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------------hashAgg[LOCAL]
+--------------------------------------------------------PhysicalProject
+----------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
+------------------------------------------------------------PhysicalOlapScan[store_sales]
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------PhysicalProject
+--------------------------filter((rnk < 11))
+----------------------------PhysicalWindow
+------------------------------PhysicalQuickSort[MERGE_SORT]
+--------------------------------PhysicalDistribute[DistributionSpecGather]
+----------------------------------PhysicalQuickSort[LOCAL_SORT]
+------------------------------------PhysicalPartitionTopN
+--------------------------------------PhysicalProject
+----------------------------------------NestedLoopJoin[INNER_JOIN](cast(rank_col
 as DOUBLE) > cast((0.9 * rank_col) as DOUBLE))
+------------------------------------------PhysicalProject
+--------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------hashAgg[LOCAL]
 --------------------------------------------------PhysicalProject
-----------------------------------------------------hashAgg[GLOBAL]
-------------------------------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------------------------------hashAgg[LOCAL]
-----------------------------------------------------------PhysicalProject
-------------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
---------------------------------------------------------------PhysicalOlapScan[store_sales]
-------------------PhysicalDistribute[DistributionSpecHash]
---------------------PhysicalProject
-----------------------PhysicalOlapScan[item]
-------------PhysicalDistribute[DistributionSpecHash]
---------------PhysicalProject
-----------------PhysicalOlapScan[item]
+----------------------------------------------------filter((ss1.ss_store_sk = 
146))
+------------------------------------------------------PhysicalOlapScan[store_sales]
+------------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------------------------PhysicalAssertNumRows
+----------------------------------------------PhysicalDistribute[DistributionSpecGather]
+------------------------------------------------PhysicalProject
+--------------------------------------------------hashAgg[GLOBAL]
+----------------------------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------------------------hashAgg[LOCAL]
+--------------------------------------------------------PhysicalProject
+----------------------------------------------------------filter((store_sales.ss_store_sk
 = 146) and ss_addr_sk IS NULL)
+------------------------------------------------------------PhysicalOlapScan[store_sales]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query59.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query59.out
index 19678a1f4da..24bd0aea7b9 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query59.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query59.out
@@ -19,30 +19,31 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 --------PhysicalDistribute[DistributionSpecGather]
 ----------PhysicalTopN[LOCAL_SORT]
 ------------PhysicalProject
---------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk) and (y.s_store_id1 = x.s_store_id2)) otherCondition=() build 
RFs:RF4 s_store_id2->[s_store_id];RF5 s_store_sk->[ss_store_sk]
+--------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq1)) otherCondition=() build RFs:RF5 d_week_seq->[d_week_seq]
 ----------------PhysicalProject
-------------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk)) otherCondition=() build RFs:RF3 s_store_sk->[ss_store_sk]
---------------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq1)) otherCondition=() build RFs:RF2 d_week_seq->[d_week_seq]
-----------------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq2)) otherCondition=() build RFs:RF1 d_week_seq->[d_week_seq]
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((expr_cast(d_week_seq1 as BIGINT) = expr_(d_week_seq2 - 52))) 
otherCondition=()
---------------------------PhysicalDistribute[DistributionSpecHash]
+------------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk) and (y.s_store_id1 = x.s_store_id2)) otherCondition=() build 
RFs:RF3 s_store_id1->[s_store_id];RF4 s_store_sk->[ss_store_sk]
+--------------------PhysicalProject
+----------------------hashJoin[INNER_JOIN] hashCondition=((wss.ss_store_sk = 
store.s_store_sk)) otherCondition=() build RFs:RF2 s_store_sk->[ss_store_sk]
+------------------------hashJoin[INNER_JOIN] hashCondition=((d.d_week_seq = 
d_week_seq2)) otherCondition=() build RFs:RF1 d_week_seq->[d_week_seq]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((expr_cast(d_week_seq1 as BIGINT) = expr_(d_week_seq2 - 52))) 
otherCondition=()
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+--------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+------------------------------filter((d.d_month_seq <= 1219) and 
(d.d_month_seq >= 1208))
+--------------------------------PhysicalOlapScan[date_dim]
 ------------------------PhysicalDistribute[DistributionSpecReplicated]
 --------------------------PhysicalProject
-----------------------------filter((d.d_month_seq <= 1219) and (d.d_month_seq 
>= 1208))
-------------------------------PhysicalOlapScan[date_dim]
-----------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------PhysicalProject
---------------------------filter((d.d_month_seq <= 1207) and (d.d_month_seq >= 
1196))
-----------------------------PhysicalOlapScan[date_dim]
+----------------------------PhysicalOlapScan[store] apply RFs: RF3
 --------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------PhysicalProject
-------------------------PhysicalOlapScan[store] apply RFs: RF4
+------------------------PhysicalOlapScan[store]
 ----------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------PhysicalProject
---------------------PhysicalOlapScan[store]
+--------------------filter((d.d_month_seq <= 1207) and (d.d_month_seq >= 1196))
+----------------------PhysicalOlapScan[date_dim]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query69.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query69.out
index 3ab0b1efc30..a87c023aa6e 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query69.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query69.out
@@ -9,48 +9,49 @@ PhysicalResultSink
 ------------PhysicalDistribute[DistributionSpecHash]
 --------------hashAgg[LOCAL]
 ----------------PhysicalProject
-------------------hashJoin[RIGHT_SEMI_JOIN] hashCondition=((c.c_customer_sk = 
store_sales.ss_customer_sk)) otherCondition=() build RFs:RF7 
c_customer_sk->[ss_customer_sk]
+------------------hashJoin[LEFT_ANTI_JOIN] hashCondition=((c.c_customer_sk = 
catalog_sales.cs_ship_customer_sk)) otherCondition=()
 --------------------PhysicalDistribute[DistributionSpecHash]
 ----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF6 d_date_sk->[ss_sold_date_sk]
+------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF5 ca_address_sk->[c_current_addr_sk]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=() build RFs:RF4 cd_demo_sk->[c_current_cdemo_sk]
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------hashJoin[LEFT_ANTI_JOIN] 
hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) 
otherCondition=()
+--------------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((c.c_customer_sk = store_sales.ss_customer_sk)) 
otherCondition=() build RFs:RF3 c_customer_sk->[ss_customer_sk]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((store_sales.ss_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ss_sold_date_sk]
+----------------------------------------PhysicalProject
+------------------------------------------PhysicalOlapScan[store_sales] apply 
RFs: RF2 RF3
+----------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+------------------------------------------PhysicalProject
+--------------------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
+----------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalOlapScan[customer] apply RFs: 
RF4 RF5
+--------------------------------PhysicalDistribute[DistributionSpecHash]
+----------------------------------PhysicalProject
+------------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF1 d_date_sk->[ws_sold_date_sk]
+--------------------------------------PhysicalProject
+----------------------------------------PhysicalOlapScan[web_sales] apply RFs: 
RF1
+--------------------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------------------PhysicalProject
+------------------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
+--------------------------------------------PhysicalOlapScan[date_dim]
+----------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------PhysicalProject
+--------------------------------PhysicalOlapScan[customer_demographics]
+--------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------PhysicalProject
+------------------------------filter(ca_state IN ('MI', 'TX', 'VA'))
+--------------------------------PhysicalOlapScan[customer_address]
+--------------------PhysicalDistribute[DistributionSpecHash]
+----------------------PhysicalProject
+------------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF0 d_date_sk->[cs_sold_date_sk]
 --------------------------PhysicalProject
-----------------------------PhysicalOlapScan[store_sales] apply RFs: RF6 RF7
+----------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF0
 --------------------------PhysicalDistribute[DistributionSpecReplicated]
 ----------------------------PhysicalProject
 ------------------------------filter((date_dim.d_moy <= 3) and (date_dim.d_moy 
>= 1) and (date_dim.d_year = 2000))
 --------------------------------PhysicalOlapScan[date_dim]
---------------------PhysicalProject
-----------------------hashJoin[RIGHT_ANTI_JOIN] 
hashCondition=((c.c_customer_sk = catalog_sales.cs_ship_customer_sk)) 
otherCondition=() build RFs:RF5 c_customer_sk->[cs_ship_customer_sk]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((catalog_sales.cs_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF4 d_date_sk->[cs_sold_date_sk]
-------------------------------PhysicalProject
---------------------------------PhysicalOlapScan[catalog_sales] apply RFs: RF4 
RF5
-------------------------------PhysicalDistribute[DistributionSpecReplicated]
---------------------------------PhysicalProject
-----------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
-------------------------------------PhysicalOlapScan[date_dim]
-------------------------hashJoin[RIGHT_ANTI_JOIN] 
hashCondition=((c.c_customer_sk = web_sales.ws_bill_customer_sk)) 
otherCondition=() build RFs:RF3 c_customer_sk->[ws_bill_customer_sk]
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_sales.ws_sold_date_sk = date_dim.d_date_sk)) 
otherCondition=() build RFs:RF2 d_date_sk->[ws_sold_date_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF2 
RF3
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_moy <= 3) and 
(date_dim.d_moy >= 1) and (date_dim.d_year = 2000))
---------------------------------------PhysicalOlapScan[date_dim]
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((customer_demographics.cd_demo_sk = c.c_current_cdemo_sk)) 
otherCondition=() build RFs:RF1 cd_demo_sk->[c_current_cdemo_sk]
-------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------hashJoin[INNER_JOIN] 
hashCondition=((c.c_current_addr_sk = ca.ca_address_sk)) otherCondition=() 
build RFs:RF0 ca_address_sk->[c_current_addr_sk]
-----------------------------------PhysicalProject
-------------------------------------PhysicalOlapScan[customer] apply RFs: RF0 
RF1
-----------------------------------PhysicalDistribute[DistributionSpecReplicated]
-------------------------------------PhysicalProject
---------------------------------------filter(ca_state IN ('MI', 'TX', 'VA'))
-----------------------------------------PhysicalOlapScan[customer_address]
-------------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[customer_demographics]
 
diff --git 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query95.out 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query95.out
index b54e3c5c0ea..1ce11a6c98f 100644
--- 
a/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query95.out
+++ 
b/regression-test/data/nereids_tpcds_shape_sf100_p0/no_stats_shape/query95.out
@@ -6,10 +6,10 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 ------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_order_number = 
ws2.ws_order_number)) otherCondition=(( not (ws_warehouse_sk = 
ws_warehouse_sk))) build RFs:RF0 ws_order_number->[ws_order_number]
 --------PhysicalDistribute[DistributionSpecHash]
 ----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF0 RF6 RF7
+------------PhysicalOlapScan[web_sales] apply RFs: RF0
 --------PhysicalDistribute[DistributionSpecHash]
 ----------PhysicalProject
-------------PhysicalOlapScan[web_sales] apply RFs: RF6 RF7
+------------PhysicalOlapScan[web_sales]
 --PhysicalResultSink
 ----PhysicalTopN[MERGE_SORT]
 ------PhysicalTopN[LOCAL_SORT]
@@ -19,35 +19,35 @@ PhysicalCteAnchor ( cteId=CTEId#0 )
 --------------hashAgg[GLOBAL]
 ----------------hashAgg[LOCAL]
 ------------------PhysicalProject
---------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=()
-----------------------PhysicalProject
-------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF5 wr_order_number->[ws_order_number];RF7 
wr_order_number->[ws_order_number,ws_order_number]
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
---------------------------PhysicalDistribute[DistributionSpecHash]
-----------------------------PhysicalProject
-------------------------------PhysicalOlapScan[web_returns]
-----------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=() 
build RFs:RF4 ws_order_number->[ws_order_number];RF6 
ws_order_number->[ws_order_number,ws_order_number]
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------PhysicalProject
-----------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
-------------------------PhysicalDistribute[DistributionSpecHash]
---------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_web_site_sk = web_site.web_site_sk)) otherCondition=() 
build RFs:RF3 web_site_sk->[ws_web_site_sk]
-----------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF2 ca_address_sk->[ws_ship_addr_sk]
-------------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF1 d_date_sk->[ws_ship_date_sk]
---------------------------------PhysicalProject
-----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF1 
RF2 RF3
---------------------------------PhysicalDistribute[DistributionSpecReplicated]
-----------------------------------PhysicalProject
-------------------------------------filter((date_dim.d_date <= '1999-04-02') 
and (date_dim.d_date >= '1999-02-01'))
---------------------------------------PhysicalOlapScan[date_dim]
-------------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = ws_wh.ws_order_number)) otherCondition=()
+----------------------PhysicalDistribute[DistributionSpecHash]
+------------------------PhysicalProject
+--------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+----------------------hashJoin[INNER_JOIN] hashCondition=((ws1.ws_web_site_sk 
= web_site.web_site_sk)) otherCondition=() build RFs:RF5 
web_site_sk->[ws_web_site_sk]
+------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_addr_sk = customer_address.ca_address_sk)) 
otherCondition=() build RFs:RF4 ca_address_sk->[ws_ship_addr_sk]
+--------------------------hashJoin[INNER_JOIN] 
hashCondition=((ws1.ws_ship_date_sk = date_dim.d_date_sk)) otherCondition=() 
build RFs:RF3 d_date_sk->[ws_ship_date_sk]
+----------------------------hashJoin[RIGHT_SEMI_JOIN] 
hashCondition=((ws1.ws_order_number = web_returns.wr_order_number)) 
otherCondition=() build RFs:RF2 ws_order_number->[wr_order_number]
+------------------------------PhysicalProject
+--------------------------------hashJoin[INNER_JOIN] 
hashCondition=((web_returns.wr_order_number = ws_wh.ws_order_number)) 
otherCondition=() build RFs:RF1 wr_order_number->[ws_order_number]
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalCteConsumer ( cteId=CTEId#0 )
+----------------------------------PhysicalDistribute[DistributionSpecHash]
+------------------------------------PhysicalProject
+--------------------------------------PhysicalOlapScan[web_returns] apply RFs: 
RF2
+------------------------------PhysicalDistribute[DistributionSpecHash]
 --------------------------------PhysicalProject
-----------------------------------filter((customer_address.ca_state = 'NC'))
-------------------------------------PhysicalOlapScan[customer_address]
+----------------------------------PhysicalOlapScan[web_sales] apply RFs: RF3 
RF4 RF5
 ----------------------------PhysicalDistribute[DistributionSpecReplicated]
 ------------------------------PhysicalProject
---------------------------------filter((web_site.web_company_name = 'pri'))
-----------------------------------PhysicalOlapScan[web_site]
+--------------------------------filter((date_dim.d_date <= '1999-04-02') and 
(date_dim.d_date >= '1999-02-01'))
+----------------------------------PhysicalOlapScan[date_dim]
+--------------------------PhysicalDistribute[DistributionSpecReplicated]
+----------------------------PhysicalProject
+------------------------------filter((customer_address.ca_state = 'NC'))
+--------------------------------PhysicalOlapScan[customer_address]
+------------------------PhysicalDistribute[DistributionSpecReplicated]
+--------------------------PhysicalProject
+----------------------------filter((web_site.web_company_name = 'pri'))
+------------------------------PhysicalOlapScan[web_site]
 


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

Reply via email to