englefly commented on code in PR #39592:
URL: https://github.com/apache/doris/pull/39592#discussion_r1728088964
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java:
##########
@@ -331,14 +331,28 @@ private Statistics estimateEqualTo(ComparisonPredicate
cp, ColumnStatistic stats
ColumnStatistic statsForRight,
EstimationContext context) {
double selectivity;
- double ndv = statsForLeft.ndv;
- double val = statsForRight.maxValue;
- if (val > statsForLeft.maxValue || val < statsForLeft.minValue) {
- selectivity = 0.0;
+ if (statsForLeft.isUnKnown) {
+ selectivity = DEFAULT_INEQUALITY_COEFFICIENT;
} else {
- selectivity = StatsMathUtil.minNonNaN(1.0, 1.0 / ndv);
+ double ndv = statsForLeft.ndv;
+ if (statsForRight.isUnKnown) {
+ if (ndv >= 1.0) {
Review Comment:
this ndv is from left, and right is unknown
--
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]