seawinde commented on code in PR #50895:
URL: https://github.com/apache/doris/pull/50895#discussion_r2224684179


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Optimizer.java:
##########
@@ -47,37 +48,45 @@ public void execute() {
         // init memo
         cascadesContext.toMemo();
         // stats derive
-        cascadesContext.pushJob(new 
DeriveStatsJob(cascadesContext.getMemo().getRoot().getLogicalExpression(),
-                cascadesContext.getCurrentJobContext()));
+        
cascadesContext.getMemo().getRoot().getLogicalExpressions().forEach(groupExpression
 ->
+                cascadesContext.pushJob(new DeriveStatsJob(groupExpression, 
cascadesContext.getCurrentJobContext())));
         cascadesContext.getJobScheduler().executeJobPool(cascadesContext);
+        if (cascadesContext.getStatementContext().isDpHyp() || 
isDpHyp(cascadesContext)) {

Review Comment:
   this is for performance, because when pre rewrite, would set isDpHyp in 
statement context, if not set then call `isDpHyp(cascadesContext) 
`,`isDpHyp(cascadesContext) ` would visit plan



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

Reply via email to