924060929 commented on code in PR #43546:
URL: https://github.com/apache/doris/pull/43546#discussion_r2163102150
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java:
##########
@@ -412,11 +423,9 @@ private ColumnStatistic
getColumnStatsFromTableCache(CatalogRelation catalogRela
/**
* if get partition col stats failed, then return table level col stats
*/
- private ColumnStatistic
getColumnStatsFromPartitionCacheOrTableCache(OlapScan catalogRelation,
SlotReference slot,
- List<String> partitionNames) {
- long idxId = catalogRelation.getSelectedIndexId();
-
- return getColumnStatistic(catalogRelation.getTable(), slot.getName(),
idxId, partitionNames);
+ private ColumnStatistic getColumnStatsFromPartitionCacheOrTableCache(
+ OlapTableStatistics olapTableStats, SlotReference slot,
List<String> partitionNames) {
+ return getColumnStatistic(olapTableStats, slot.getName(),
partitionNames);
Review Comment:
because the `selectIndexId` already exists in `OlapTableStatistics`.
the core idea is: we need find table first, and then compute ColumnStatistic
multiple times for lots of columns in this table.
the old code is: find table for every column, this is too cost, so I split
it to two phase:
1. compute OlapTableStatistics first
2. reuse OlapTableStatistics to compute ColumnStatistic.
the new code only find table one time
--
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]