Skip to content

Commit

Permalink
[chore](sink) enable_parallel_result_sink default value is changed …
Browse files Browse the repository at this point in the history
…to false (#43933)

### What problem does this PR solve?

Problem Summary:

For most queries, result sink will not become a performance bottleneck,
but the parallel result sink will increase the pressure of RPC between
fe and be.
  • Loading branch information
xinyiZzz authored and Your Name committed Nov 19, 2024
1 parent 2eff82e commit 0bdeb04
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ public enum IgnoreSplitType {
private boolean enableSyncRuntimeFilterSize = true;

@VariableMgr.VarAttr(name = ENABLE_PARALLEL_RESULT_SINK, needForward = true, fuzzy = true)
private boolean enableParallelResultSink = true;
private boolean enableParallelResultSink = false;

@VariableMgr.VarAttr(name = "sort_phase_num", fuzzy = true, needForward = true,
description = {"如设置为1,则只生成1阶段sort,设置为2,则只生成2阶段sort,设置其它值,优化器根据代价选择sort类型",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.doris.catalog.Table;
import org.apache.doris.common.DdlException;
import org.apache.doris.common.FeConstants;
import org.apache.doris.planner.ExchangeNode;
import org.apache.doris.planner.OlapScanNode;
import org.apache.doris.planner.PlanFragment;
import org.apache.doris.planner.Planner;
Expand Down Expand Up @@ -120,7 +121,8 @@ public void testCreateDbAndTable() throws Exception {
}
// 5. query
// TODO: we can not process real query for now. So it has to be a explain query
String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION) */ * from db1.tbl1";
String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, "
+ "enable_parallel_result_sink=true) */ * from db1.tbl1";
StmtExecutor stmtExecutor = new StmtExecutor(ctx, queryStr);
stmtExecutor.execute();
Planner planner = stmtExecutor.planner();
Expand All @@ -129,5 +131,16 @@ public void testCreateDbAndTable() throws Exception {
PlanFragment fragment = fragments.get(0);
Assert.assertTrue(fragment.getPlanRoot() instanceof OlapScanNode);
Assert.assertEquals(0, fragment.getChildren().size());

queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, "
+ "enable_parallel_result_sink=false) */ * from db1.tbl1";
stmtExecutor = new StmtExecutor(ctx, queryStr);
stmtExecutor.execute();
planner = stmtExecutor.planner();
fragments = planner.getFragments();
Assert.assertEquals(2, fragments.size());
fragment = fragments.get(0);
Assert.assertTrue(fragment.getPlanRoot() instanceof ExchangeNode);
Assert.assertEquals(1, fragment.getChildren().size());
}
}
15 changes: 14 additions & 1 deletion fe/fe-core/src/test/java/org/apache/doris/utframe/DemoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.doris.catalog.OlapTable;
import org.apache.doris.catalog.Table;
import org.apache.doris.common.FeConstants;
import org.apache.doris.planner.ExchangeNode;
import org.apache.doris.planner.OlapScanNode;
import org.apache.doris.planner.PlanFragment;
import org.apache.doris.planner.Planner;
Expand Down Expand Up @@ -108,7 +109,8 @@ public void testCreateDbAndTable() throws Exception {

// 7. query
// TODO: we can not process real query for now. So it has to be a explain query
String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION) */ * from db1.tbl1";
String queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, "
+ "enable_parallel_result_sink=true) */ * from db1.tbl1";
StmtExecutor stmtExecutor = new StmtExecutor(connectContext, queryStr);
stmtExecutor.execute();
Planner planner = stmtExecutor.planner();
Expand All @@ -117,5 +119,16 @@ public void testCreateDbAndTable() throws Exception {
PlanFragment fragment = fragments.get(0);
Assertions.assertTrue(fragment.getPlanRoot() instanceof OlapScanNode);
Assertions.assertEquals(0, fragment.getChildren().size());

queryStr = "explain select /*+ SET_VAR(disable_nereids_rules=PRUNE_EMPTY_PARTITION, "
+ "enable_parallel_result_sink=false) */ * from db1.tbl1";
stmtExecutor = new StmtExecutor(connectContext, queryStr);
stmtExecutor.execute();
planner = stmtExecutor.planner();
fragments = planner.getFragments();
Assertions.assertEquals(2, fragments.size());
fragment = fragments.get(0);
Assertions.assertTrue(fragment.getPlanRoot() instanceof ExchangeNode);
Assertions.assertEquals(1, fragment.getChildren().size());
}
}

0 comments on commit 0bdeb04

Please sign in to comment.