xzj7019 commented on code in PR #39592:
URL: https://github.com/apache/doris/pull/39592#discussion_r1726567923


##########
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:
   what is the case where statsForLeft is not unknown but ndv < 1.0? Should we 
do a normalization if the ndv < 1.0?



-- 
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