englefly commented on code in PR #18035: URL: https://github.com/apache/doris/pull/18035#discussion_r1145616268
########## fe/fe-core/src/main/java/org/apache/doris/nereids/stats/ExpressionEstimation.java: ########## @@ -289,12 +290,7 @@ public ColumnStatistic visitCount(Count count, Statistics context) { // TODO: return a proper estimated stat after supports histogram @Override public ColumnStatistic visitSum(Sum sum, Statistics context) { - ColumnStatistic columnStatistic = sum.child().accept(this, context); - return new ColumnStatisticBuilder(columnStatistic) - .setMaxValue(columnStatistic.maxValue * context.getRowCount() / columnStatistic.ndv) - .setMinValue(columnStatistic.minValue * context.getRowCount() / columnStatistic.ndv) - .setAvgSizeByte(sum.getDataType().width()) - .setDataSize(sum.getDataType().width() * context.getRowCount()).build(); Review Comment: to compute dataSize, we need rows after agg, not context.getRowCount() -- 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