Jibing-Li commented on code in PR #31212:
URL: https://github.com/apache/doris/pull/31212#discussion_r1497091875


##########
fe/fe-core/src/main/java/org/apache/doris/statistics/OlapAnalysisTask.java:
##########
@@ -183,14 +184,22 @@ protected ResultRow 
collectBasicStat(AutoCloseConnectContext context) {
                     tbl.getName(), col.getName());
             return null;
         }
+        long startTime = System.currentTimeMillis();
         Map<String, String> params = new HashMap<>();
         params.put("dbName", db.getFullName());
         params.put("colName", StatisticsUtil.escapeColumnName(info.colName));
         params.put("tblName", tbl.getName());
         params.put("index", getIndex());
         StringSubstitutor stringSubstitutor = new StringSubstitutor(params);
-        stmtExecutor = new StmtExecutor(context.connectContext, 
stringSubstitutor.replace(BASIC_STATS_TEMPLATE));
-        return stmtExecutor.executeInternalQuery().get(0);
+        String sql = stringSubstitutor.replace(BASIC_STATS_TEMPLATE);
+        stmtExecutor = new StmtExecutor(context.connectContext, sql);
+        ResultRow resultRow = stmtExecutor.executeInternalQuery().get(0);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Cost time in millisec: " + (System.currentTimeMillis() 
- startTime)
+                    + " Min max SQL: " + sql + " QueryId: " + 
DebugUtil.printId(stmtExecutor.getContext().queryId()));
+        }
+        stmtExecutor = null;

Review Comment:
   added



-- 
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

Reply via email to