englefly commented on code in PR #69028:
URL: https://github.com/apache/doris/pull/69028#discussion_r4312193993


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java:
##########
@@ -384,11 +384,19 @@ public Statistics visitLogicalFilter(LogicalFilter<? 
extends Plan> filter, Void
      * returns the sum of deltaRowCount for all selected partitions or for the 
table.
      */
     private long computeDeltaRowCount(OlapScan olapScan) {
+        OlapTable olapTable = olapScan.getTable();
+        // The delta rows are the rows loaded into the base index which the 
collected base index row count
+        // doesn't include yet. They are not the rows of an index which 
aggregates them: such an index has its
+        // own (usually much smaller) row count, so the delta only applies to 
a scan of an index which keeps
+        // one row per base row.
+        if (!TableStatsMeta.keepsOneRowPerBaseRow(olapTable, 
olapScan.getSelectedIndexId())) {
+            return 0;

Review Comment:
   done



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

Reply via email to