morrySnow commented on code in PR #16783:
URL: https://github.com/apache/doris/pull/16783#discussion_r1109627278


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/batch/NereidsRewriteJobExecutor.java:
##########
@@ -103,9 +103,13 @@ public NereidsRewriteJobExecutor(CascadesContext 
cascadesContext) {
                 .add(topDownBatch(RuleSet.PUSH_DOWN_FILTERS, false))
                 .add(visitorJob(RuleType.INFER_PREDICATES, new 
InferPredicates()))
                 .add(topDownBatch(ImmutableList.of(new 
ExtractFilterFromCrossJoin())))
-                .add(topDownBatch(ImmutableList.of(new MergeFilters())))
-                .add(topDownBatch(ImmutableList.of(new ReorderJoin())))
-                .add(topDownBatch(ImmutableList.of(new ColumnPruning())))
+                .add(topDownBatch(ImmutableList.of(new MergeFilters())));
+
+        if 
(!cascadesContext.getConnectContext().getSessionVariable().isDisableJoinReorder())
 {
+            jobBuilder.add(topDownBatch(ImmutableList.of(new ReorderJoin())));

Review Comment:
   better way to do that is move the if statement into ReorderJoin rule



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java:
##########
@@ -170,8 +170,10 @@ public Plan plan(LogicalPlan plan, PhysicalProperties 
requireProperties, Explain
             }
             deriveStats();
 
-            if 
(statementContext.getConnectContext().getSessionVariable().isEnableDPHypOptimizer())
 {
-                // TODO: use DPHyp according the number of join table
+            if 
(!statementContext.getConnectContext().getSessionVariable().isDisableJoinReorder()
+                    && 
statementContext.getConnectContext().getSessionVariable().isEnableDPHypOptimizer()
+                    && statementContext.getMaxNAryInnerJoin() > 
statementContext.getConnectContext()
+                    
.getSessionVariable().getMaxTableCountUseCascadesJoinReorder()) {
                 dpHypOptimize();
             } else {
                 optimize();

Review Comment:
   i think we need always run optimize, and use different rule set according to 
join size.
   merge dpHypOptimize and optimize into one function, and do if in it



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