From ad96f77ff738e9949858f8ae9ea0318d14d981a1 Mon Sep 17 00:00:00 2001 From: minghong Date: Sun, 29 Sep 2024 15:58:11 +0800 Subject: [PATCH] delta row count only plus to analyzed row count, but to be reported row count --- .../org/apache/doris/nereids/stats/StatsCalculator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java index 79a574dc3f7423..3c70d4cd51868f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java @@ -396,7 +396,7 @@ private double getOlapTableRowCount(OlapScan olapScan) { rowCount = olapTable.getRowCountForIndex(olapScan.getSelectedIndexId(), true); if (rowCount == -1) { if (tableMeta != null) { - rowCount = tableMeta.getRowCount(olapScan.getSelectedIndexId()); + rowCount = tableMeta.getRowCount(olapScan.getSelectedIndexId()) + computeDeltaRowCount(olapScan); } } } @@ -489,7 +489,7 @@ private Statistics computeOlapScan(OlapScan olapScan) { builder.putColumnStatistics(slot, colStatsBuilder.build()); } checkIfUnknownStatsUsedAsKey(builder); - builder.setRowCount(selectedPartitionsRowCount + deltaRowCount); + builder.setRowCount(selectedPartitionsRowCount); } } // 1. no partition is pruned, or @@ -503,7 +503,7 @@ private Statistics computeOlapScan(OlapScan olapScan) { builder.putColumnStatistics(slot, colStatsBuilder.build()); } checkIfUnknownStatsUsedAsKey(builder); - builder.setRowCount(tableRowCount + deltaRowCount); + builder.setRowCount(tableRowCount); } return builder.build(); }