englefly commented on code in PR #18129:
URL: https://github.com/apache/doris/pull/18129#discussion_r1150432415
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/JoinEstimation.java:
##########
@@ -52,37 +55,105 @@ private static Statistics estimateInnerJoin(Statistics
crossJoinStats, List<Expr
for (int i = 0; i < sortedJoinConditions.size(); i++) {
sel *= Math.pow(sortedJoinConditions.get(i).second, 1 /
Math.pow(2, i));
}
- return crossJoinStats.updateRowCountOnly(crossJoinStats.getRowCount()
* sel);
+ Statistics innerJoinStats =
crossJoinStats.updateRowCountOnly(crossJoinStats.getRowCount() * sel);
+
+ if (!join.getOtherJoinConjuncts().isEmpty()) {
+ FilterEstimation filterEstimation = new FilterEstimation();
+ innerJoinStats = filterEstimation.estimate(
+ ExpressionUtils.and(join.getOtherJoinConjuncts()),
innerJoinStats);
+ }
+ return innerJoinStats;
}
private static double estimateJoinConditionSel(Statistics crossJoinStats,
Expression joinCond) {
Statistics statistics = new FilterEstimation().estimate(joinCond,
crossJoinStats);
return statistics.getRowCount() / crossJoinStats.getRowCount();
}
+ private static double adjustSemiOrAntiByOtherJoinConditions(Join join) {
+ final double non_equal_ratio = 0.5;
Review Comment:
Ok, non_equal_ratio is replaced by
FilterEstimation.DEFAULT_INEQUALITY_COEFFICIENT.
--
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]