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


##########
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:
   I mean whether we should do a data normalization for those concept which has 
certain physical properties, such as row count, ndv, selectivity, etc. We may 
do this at next generation code model.



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