This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3f9d83359c4 [opt](mtmv) Add log when compute olap scan cost to locate 
problem easier (#45948)
3f9d83359c4 is described below

commit 3f9d83359c466a9aaa16ec0579f47bcbbc46c2d6
Author: seawinde <w...@selectdb.com>
AuthorDate: Thu Jan 2 16:22:52 2025 +0800

    [opt](mtmv) Add log when compute olap scan cost to locate problem easier 
(#45948)
    
    ### What problem does this PR solve?
    
    Some mv test case should be chosen by cbo but not.
    Add log when compute olap scan cost to locate problem easier
---
 .../src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java | 4 ++++
 1 file changed, 4 insertions(+)

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 f549b216217..e2909317ba1 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
@@ -495,8 +495,12 @@ public class StatsCalculator extends 
DefaultPlanVisitor<Statistics, Void> {
             // mv is selected, return its estimated stats
             Optional<Statistics> optStats = 
cascadesContext.getStatementContext()
                     .getStatistics(((Relation) olapScan).getRelationId());
+            LOG.info("computeOlapScan optStats isPresent {}, tableRowCount is 
{}",
+                    optStats.isPresent(), tableRowCount);
             if (optStats.isPresent()) {
                 double selectedPartitionsRowCount = 
getSelectedPartitionRowCount(olapScan, tableRowCount);
+                LOG.info("computeOlapScan optStats is {}, 
selectedPartitionsRowCount is {}", optStats.get(),
+                        selectedPartitionsRowCount);
                 // if estimated mv rowCount is more than actual row count, 
fall back to base table stats
                 if (selectedPartitionsRowCount >= 
optStats.get().getRowCount()) {
                     Statistics derivedStats = optStats.get();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to