englefly commented on code in PR #13375: URL: https://github.com/apache/doris/pull/13375#discussion_r1004035628
########## fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java: ########## @@ -104,7 +104,10 @@ public static void estimate(GroupExpression groupExpression) { private void estimate() { StatsDeriveResult stats = groupExpression.getPlan().accept(this, null); - groupExpression.getOwnerGroup().setStatistics(stats); + if (groupExpression.getOwnerGroup().getStatistics() == null + || (stats.getRowCount() < groupExpression.getOwnerGroup().getStatistics().getRowCount())) { Review Comment: done ########## fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculatorV2.java: ########## @@ -99,7 +99,10 @@ public static void estimate(GroupExpression groupExpression) { private void estimate() { StatsDeriveResult stats = groupExpression.getPlan().accept(this, null); - groupExpression.getOwnerGroup().setStatistics(stats); + StatsDeriveResult originStats = groupExpression.getOwnerGroup().getStatistics(); + if (originStats == null || originStats.getRowCount() > stats.getRowCount()) { 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: 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