englefly commented on code in PR #13375:
URL: https://github.com/apache/doris/pull/13375#discussion_r1004053499


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/JoinEstimation.java:
##########
@@ -124,11 +147,56 @@ private static JoinEstimationResult 
estimateInnerJoin(PhysicalHashJoin join, Equ
         return result;
     }
 
+    /**
+     * estimate join
+     */
+    public static StatsDeriveResult estimate(StatsDeriveResult leftStats, 
StatsDeriveResult rightStats, Join join) {
+        JoinType joinType = join.getJoinType();
+        double rowCount = Double.MAX_VALUE;
+        if (joinType == JoinType.LEFT_SEMI_JOIN || joinType == 
JoinType.LEFT_ANTI_JOIN) {
+            rowCount = leftStats.getRowCount();
+        } else if (joinType == JoinType.RIGHT_SEMI_JOIN || joinType == 
JoinType.RIGHT_ANTI_JOIN) {
+            rowCount = rightStats.getRowCount();

Review Comment:
   Previous version, semi and anti filter half of rows. The factor 0.5 should 
be refined.
   In fact, currently any factor are acceptable, they will not change the best 
plan.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to