[feat](nereids) add session var to turn on/off common sub expressoin extraction (branch-2.1) #33616

This commit is contained in:
minghong
2024-04-13 14:10:46 +08:00
committed by yiguolei
parent e26a53d8a6
commit ca59b25d59
3 changed files with 8 additions and 1 deletions

View File

@ -63,7 +63,9 @@ public class PlanPostProcessors {
builder.add(new MergeProjectPostProcessor());
builder.add(new RecomputeLogicalPropertiesProcessor());
builder.add(new AddOffsetIntoDistribute());
builder.add(new CommonSubExpressionOpt());
if (cascadesContext.getConnectContext().getSessionVariable().enableCommonSubExpression) {
builder.add(new CommonSubExpressionOpt());
}
// DO NOT replace PLAN NODE from here
builder.add(new TopNScanOpt());
builder.add(new FragmentProcessor());

View File

@ -908,6 +908,10 @@ public class SessionVariable implements Serializable, Writable {
varType = VariableAnnotation.EXPERIMENTAL, needForward = true)
private int parallelScanMaxScannersCount = 48;
@VariableMgr.VarAttr(name = "enable_common_sub_expression", fuzzy = false,
varType = VariableAnnotation.EXPERIMENTAL, needForward = true)
public boolean enableCommonSubExpression = false;
@VariableMgr.VarAttr(name = PARALLEL_SCAN_MIN_ROWS_PER_SCANNER, fuzzy = true,
varType = VariableAnnotation.EXPERIMENTAL, needForward = true)
private long parallelScanMinRowsPerScanner = 16384; // 16K

View File

@ -20,6 +20,7 @@
// and modified by Doris.
suite('cse') {
sql "set enable_common_sub_expression=true"
def q1 = """select s_suppkey,n_regionkey,(s_suppkey + n_regionkey) + 1 as x, (s_suppkey + n_regionkey) + 2 as y
from supplier join nation on s_nationkey=n_nationkey order by s_suppkey , n_regionkey limit 10 ;
"""