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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]