[fix](nereids) Pick the stop watch is not reset (#37168) (#37397)

Pick https://github.com/apache/doris/pull/37168 and
https://github.com/apache/doris/pull/37095
This commit is contained in:
meiyi
2024-07-08 10:28:03 +08:00
committed by GitHub
parent 70f46c12b3
commit af7b69da48

View File

@ -113,10 +113,14 @@ public class NereidsPlanner extends Planner {
NereidsTracer.logImportantTime("EndParsePlan");
setParsedPlan(parsedPlan);
PhysicalProperties requireProperties = buildInitRequireProperties();
statementContext.getStopwatch().start();
boolean showPlanProcess = showPlanProcess(queryStmt.getExplainOptions());
Plan resultPlan = plan(parsedPlan, requireProperties, explainLevel, showPlanProcess);
statementContext.getStopwatch().stop();
statementContext.getStopwatch().reset().start();
Plan resultPlan = null;
try {
boolean showPlanProcess = showPlanProcess(queryStmt.getExplainOptions());
resultPlan = plan(parsedPlan, requireProperties, explainLevel, showPlanProcess);
} finally {
statementContext.getStopwatch().stop();
}
setOptimizedPlan(resultPlan);
if (explainLevel.isPlanLevel) {
return;