From c546f8504b06756bbf70741f89070e86ab7ca78a Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Tue, 2 Jun 2026 14:59:52 +0800 Subject: [PATCH 01/25] parser: support recursive parentheses in LEADING hint Signed-off-by: guo-shaoge --- pkg/parser/ast/misc.go | 94 +++++++++++++++++++++++++++++- pkg/parser/ast/misc_test.go | 10 ++++ pkg/parser/hintparser.y | 52 ++++++++++++++++- pkg/parser/hintparser_test.go | 106 ++++++++++++++++++++++++++++++++++ pkg/parser/parser_test.go | 36 +++++++++--- 5 files changed, 285 insertions(+), 13 deletions(-) diff --git a/pkg/parser/ast/misc.go b/pkg/parser/ast/misc.go index 044b757cb7685..414123eff7beb 100644 --- a/pkg/parser/ast/misc.go +++ b/pkg/parser/ast/misc.go @@ -3877,6 +3877,16 @@ type HintTimeRange struct { To string } +// LeadingList represents a nested structure in LEADING hints. +// It could be *HintTable or LeadingList +// +// eg: LEADING(a, (b, c), d) +// will be parsed into a LeadingList like: +// Items = [HintTable("a"), LeadingList{[HintTable("b"), HintTable("c")]}, HintTable("d")] +type LeadingList struct { + Items []interface{} +} + // HintSetVar is the payload of `SET_VAR` hint type HintSetVar struct { VarName string @@ -3891,6 +3901,25 @@ type HintTable struct { PartitionList []model.CIStr } +// FlattenLeadingList collects all HintTable nodes from a possibly nested LeadingList into a flat slice. +// Note: +// - Only table names are preserved. +func FlattenLeadingList(list *LeadingList) []HintTable { + if list == nil { + return nil + } + var result []HintTable + for _, item := range list.Items { + switch t := item.(type) { + case *HintTable: + result = append(result, *t) + case *LeadingList: + result = append(result, FlattenLeadingList(t)...) + } + } + return result +} + func (ht *HintTable) Restore(ctx *format.RestoreCtx) { if !ctx.Flags.HasWithoutSchemaNameFlag() { if ht.DBName.L != "" { @@ -3916,11 +3945,52 @@ func (ht *HintTable) Restore(ctx *format.RestoreCtx) { } } +func (lt *LeadingList) RestoreWithQB(ctx *format.RestoreCtx, qbName model.CIStr, needParen bool, isTop bool, qbOnTable bool) error { + if lt == nil || len(lt.Items) == 0 { + return nil + } + if needParen { + ctx.WritePlain("(") + } + + currentQBName := qbName // hint level QBName + + for i, item := range lt.Items { + if i > 0 { + ctx.WritePlain(", ") + } + + switch t := item.(type) { + case *HintTable: + if i == 0 && currentQBName.L != "" && !qbOnTable { + ctx.WriteKeyWord("@") + ctx.WriteName(currentQBName.String()) + ctx.WritePlain(" ") + t.Restore(ctx) + currentQBName = model.CIStr{} + } else { + t.Restore(ctx) + } + case *LeadingList: + if err := t.RestoreWithQB(ctx, currentQBName, true, false, qbOnTable); err != nil { + return err + } + currentQBName = model.CIStr{} + default: + return fmt.Errorf("unexpected type in LeadingList: %T", t) + } + } + if needParen { + ctx.WritePlain(")") + } + return nil +} + // Restore implements Node interface. func (n *TableOptimizerHint) Restore(ctx *format.RestoreCtx) error { ctx.WriteKeyWord(n.HintName.String()) ctx.WritePlain("(") - if n.QBName.L != "" { + if n.HintName.L != "leading" && n.QBName.L != "" { if n.HintName.L != "qb_name" { ctx.WriteKeyWord("@") } @@ -3936,7 +4006,7 @@ func (n *TableOptimizerHint) Restore(ctx *format.RestoreCtx) error { ctx.WritePlain(")") return nil } - if n.QBName.L != "" { + if n.HintName.L != "leading" && n.QBName.L != "" { ctx.WritePlain(" ") } // Hints with args except query block. @@ -3947,8 +4017,26 @@ func (n *TableOptimizerHint) Restore(ctx *format.RestoreCtx) error { ctx.WriteName(n.HintData.(string)) case "nth_plan": ctx.WritePlainf("%d", n.HintData.(int64)) + case "leading": + if list, ok := n.HintData.(*LeadingList); ok && list != nil { + // if table level QBName or not + qbOnTable := false + if len(n.Tables) > 0 && n.Tables[0].QBName.L != "" { + qbOnTable = true + } + if err := list.RestoreWithQB(ctx, n.QBName, false, true, qbOnTable); err != nil { + return err + } + } else { + for i, table := range n.Tables { + if i != 0 { + ctx.WritePlain(", ") + } + table.Restore(ctx) + } + } case "tidb_hj", "tidb_smj", "tidb_inlj", "hash_join", "hash_join_build", "hash_join_probe", "merge_join", "inl_join", - "broadcast_join", "shuffle_join", "inl_hash_join", "inl_merge_join", "leading", "no_hash_join", "no_merge_join", + "broadcast_join", "shuffle_join", "inl_hash_join", "inl_merge_join", "no_hash_join", "no_merge_join", "no_index_join", "no_index_hash_join", "no_index_merge_join": for i, table := range n.Tables { if i != 0 { diff --git a/pkg/parser/ast/misc_test.go b/pkg/parser/ast/misc_test.go index 721ae970d3a4e..f9114e61158fd 100644 --- a/pkg/parser/ast/misc_test.go +++ b/pkg/parser/ast/misc_test.go @@ -253,13 +253,23 @@ func TestTableOptimizerHintRestore(t *testing.T) { {"HASH_JOIN_PROBE(t1)", "HASH_JOIN_PROBE(`t1`)"}, {"LEADING(t1)", "LEADING(`t1`)"}, {"LEADING(t1, c1)", "LEADING(`t1`, `c1`)"}, + {"LEADING((t1, c1), t2)", "LEADING((`t1`, `c1`), `t2`)"}, + {"LEADING(t1, (c1, t2))", "LEADING(`t1`, (`c1`, `t2`))"}, + {"LEADING(((t1, c1), t2), t3)", "LEADING(((`t1`, `c1`), `t2`), `t3`)"}, + {"LEADING(t1, (c1, (t2, t3)))", "LEADING(`t1`, (`c1`, (`t2`, `t3`)))"}, {"LEADING(t1, c1, t2)", "LEADING(`t1`, `c1`, `t2`)"}, {"LEADING(@sel1 t1, c1)", "LEADING(@`sel1` `t1`, `c1`)"}, {"LEADING(@sel1 t1)", "LEADING(@`sel1` `t1`)"}, {"LEADING(@sel1 t1, c1, t2)", "LEADING(@`sel1` `t1`, `c1`, `t2`)"}, + {"LEADING(@sel1 t1, (c1, t2))", "LEADING(@`sel1` `t1`, (`c1`, `t2`))"}, + {"LEADING(@sel1 t1, (c1, t2), d3)", "LEADING(@`sel1` `t1`, (`c1`, `t2`), `d3`)"}, {"LEADING(t1@sel1)", "LEADING(`t1`@`sel1`)"}, {"LEADING(t1@sel1, c1)", "LEADING(`t1`@`sel1`, `c1`)"}, {"LEADING(t1@sel1, c1, t2)", "LEADING(`t1`@`sel1`, `c1`, `t2`)"}, + {"LEADING((t1@sel1, c1), t2)", "LEADING((`t1`@`sel1`, `c1`), `t2`)"}, + {"LEADING(t1@sel1, (c1, t2))", "LEADING(`t1`@`sel1`, (`c1`, `t2`))"}, + {"LEADING(t1@sel1, c1, t2, d3)", "LEADING(`t1`@`sel1`, `c1`, `t2`, `d3`)"}, + {"LEADING(t1@sel1, (c1, t2), d3)", "LEADING(`t1`@`sel1`, (`c1`, `t2`), `d3`)"}, {"MAX_EXECUTION_TIME(3000)", "MAX_EXECUTION_TIME(3000)"}, {"MAX_EXECUTION_TIME(@sel1 3000)", "MAX_EXECUTION_TIME(@`sel1` 3000)"}, {"USE_INDEX_MERGE(t1 c1)", "USE_INDEX_MERGE(`t1` `c1`)"}, diff --git a/pkg/parser/hintparser.y b/pkg/parser/hintparser.y index bac8064baa875..7748a6a0b1478 100644 --- a/pkg/parser/hintparser.y +++ b/pkg/parser/hintparser.y @@ -32,6 +32,8 @@ import ( hints []*ast.TableOptimizerHint table ast.HintTable modelIdents []model.CIStr + leadingList *ast.LeadingList + leadingElement interface{} // Modified: Represents either *ast.HintTable or *ast.LeadingList } %token @@ -189,6 +191,12 @@ import ( PartitionList "partition name list in optimizer hint" PartitionListOpt "optional partition name list in optimizer hint" +%type + LeadingTableList "leading table list" + +%type + LeadingTableElement "leading element (table or list)" + %start Start @@ -246,6 +254,27 @@ TableOptimizerHintOpt: h.HintName = model.NewCIStr($1) $$ = h } +| "LEADING" '(' QueryBlockOpt LeadingTableList ')' + { + h := &ast.TableOptimizerHint{ + HintName: ast.NewCIStr($1), + QBName: ast.NewCIStr($3), + HintData: $4, + } + // For LEADING hints we need to maintain two views of the tables: + // h.HintData: + // - Stores the structured AST node (LeadingList). + // - Preserves the nesting and order information of LEADING(...), + // + // h.Tables: + // - Stores a flat slice of all HintTable elements inside the LeadingList. + // - Only used for initialization. + if leadingList, ok := h.HintData.(*ast.LeadingList); ok { + // be compatible with the prior flatten writing style + h.Tables = ast.FlattenLeadingList(leadingList) + } + $$ = h + } | UnsupportedIndexLevelOptimizerHintName '(' HintIndexList ')' { parser.warnUnsupportedHint($1) @@ -416,6 +445,28 @@ HintStorageTypeAndTable: $$ = h } +LeadingTableList: + LeadingTableElement + { + $$ = &ast.LeadingList{Items: []interface{}{$1}} + } +| LeadingTableList ',' LeadingTableElement + { + $$ = $1 + $$.Items = append($$.Items, $3) + } + +LeadingTableElement: + HintTable + { + tmp := $1 + $$ = &tmp + } +| '(' LeadingTableList ')' + { + $$ = $2 + } + QueryBlockOpt: /* empty */ { @@ -655,7 +706,6 @@ SupportedTableLevelOptimizerHintName: | "NO_HASH_JOIN" | "HASH_JOIN_BUILD" | "HASH_JOIN_PROBE" -| "LEADING" | "HYPO_INDEX" UnsupportedIndexLevelOptimizerHintName: diff --git a/pkg/parser/hintparser_test.go b/pkg/parser/hintparser_test.go index 1ecbea8cfc50a..699b10f5ad96c 100644 --- a/pkg/parser/hintparser_test.go +++ b/pkg/parser/hintparser_test.go @@ -366,6 +366,112 @@ func TestParseHint(t *testing.T) { }, }, }, + { + input: "LEADING(a,(b,(c,d)))", + output: []*ast.TableOptimizerHint{ + { + HintName: ast.NewCIStr("LEADING"), + HintData: &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("a")}, + &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("b")}, + &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("c")}, + &ast.HintTable{TableName: ast.NewCIStr("d")}, + }, + }, + }, + }, + }, + }, + Tables: []ast.HintTable{ + {TableName: ast.NewCIStr("a")}, + {TableName: ast.NewCIStr("b")}, + {TableName: ast.NewCIStr("c")}, + {TableName: ast.NewCIStr("d")}, + }, + }, + }, + }, + { + input: "LEADING(a,b,c)", + output: []*ast.TableOptimizerHint{ + { + HintName: ast.NewCIStr("LEADING"), + HintData: &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("a")}, + &ast.HintTable{TableName: ast.NewCIStr("b")}, + &ast.HintTable{TableName: ast.NewCIStr("c")}, + }, + }, + Tables: []ast.HintTable{ + {TableName: ast.NewCIStr("a")}, + {TableName: ast.NewCIStr("b")}, + {TableName: ast.NewCIStr("c")}, + }, + }, + }, + }, + { + input: "LEADING((a,b),(c,d))", + output: []*ast.TableOptimizerHint{ + { + HintName: ast.NewCIStr("LEADING"), + HintData: &ast.LeadingList{ + Items: []interface{}{ + &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("a")}, + &ast.HintTable{TableName: ast.NewCIStr("b")}, + }, + }, + &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("c")}, + &ast.HintTable{TableName: ast.NewCIStr("d")}, + }, + }, + }, + }, + Tables: []ast.HintTable{ + {TableName: ast.NewCIStr("a")}, + {TableName: ast.NewCIStr("b")}, + {TableName: ast.NewCIStr("c")}, + {TableName: ast.NewCIStr("d")}, + }, + }, + }, + }, + { + input: "LEADING(x,(y,z),w)", + output: []*ast.TableOptimizerHint{ + { + HintName: ast.NewCIStr("LEADING"), + HintData: &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("x")}, + &ast.LeadingList{ + Items: []interface{}{ + &ast.HintTable{TableName: ast.NewCIStr("y")}, + &ast.HintTable{TableName: ast.NewCIStr("z")}, + }, + }, + &ast.HintTable{TableName: ast.NewCIStr("w")}, + }, + }, + Tables: []ast.HintTable{ + {TableName: ast.NewCIStr("x")}, + {TableName: ast.NewCIStr("y")}, + {TableName: ast.NewCIStr("z")}, + {TableName: ast.NewCIStr("w")}, + }, + }, + }, + }, } for _, tc := range testCases { diff --git a/pkg/parser/parser_test.go b/pkg/parser/parser_test.go index 85ffd4b1ba18a..fd904ade26a99 100644 --- a/pkg/parser/parser_test.go +++ b/pkg/parser/parser_test.go @@ -4838,19 +4838,37 @@ func TestOptimizerHints(t *testing.T) { hints = selectStmt.TableHints require.Len(t, hints, 3) require.Equal(t, "leading", hints[0].HintName.L) - require.Len(t, hints[0].Tables, 1) - require.Equal(t, "t1", hints[0].Tables[0].TableName.L) + leadingList1, ok := hints[0].HintData.(*ast.LeadingList) + require.True(t, ok) + require.Len(t, leadingList1.Items, 1) + hintTable1, ok := leadingList1.Items[0].(*ast.HintTable) + require.True(t, ok) + require.Equal(t, "t1", hintTable1.TableName.L) require.Equal(t, "leading", hints[1].HintName.L) - require.Len(t, hints[1].Tables, 2) - require.Equal(t, "t2", hints[1].Tables[0].TableName.L) - require.Equal(t, "t3", hints[1].Tables[1].TableName.L) + leadingList2, ok := hints[1].HintData.(*ast.LeadingList) + require.True(t, ok) + require.Len(t, leadingList2.Items, 2) + hintTable2, ok := leadingList2.Items[0].(*ast.HintTable) + require.True(t, ok) + require.Equal(t, "t2", hintTable2.TableName.L) + hintTable3, ok := leadingList2.Items[1].(*ast.HintTable) + require.True(t, ok) + require.Equal(t, "t3", hintTable3.TableName.L) require.Equal(t, "leading", hints[2].HintName.L) - require.Len(t, hints[2].Tables, 3) - require.Equal(t, "t4", hints[2].Tables[0].TableName.L) - require.Equal(t, "t5", hints[2].Tables[1].TableName.L) - require.Equal(t, "t6", hints[2].Tables[2].TableName.L) + leadingList3, ok := hints[2].HintData.(*ast.LeadingList) + require.True(t, ok) + require.Len(t, leadingList3.Items, 3) + hintTable4, ok := leadingList3.Items[0].(*ast.HintTable) + require.True(t, ok) + require.Equal(t, "t4", hintTable4.TableName.L) + hintTable5, ok := leadingList3.Items[1].(*ast.HintTable) + require.True(t, ok) + require.Equal(t, "t5", hintTable5.TableName.L) + hintTable6, ok := leadingList3.Items[2].(*ast.HintTable) + require.True(t, ok) + require.Equal(t, "t6", hintTable6.TableName.L) // Test NO_HASH_JOIN stmt, _, err = p.Parse("select /*+ NO_HASH_JOIN(t1, t2), NO_HASH_JOIN(t3) */ * from t1, t2, t3", "", "") From 8f597b52c2cb66909dff58ef2903708da3cd82be Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Tue, 2 Jun 2026 15:06:15 +0800 Subject: [PATCH 02/25] fix Signed-off-by: guo-shaoge --- pkg/parser/hintparser.go | 1002 ++++++++++++++++++++------------------ pkg/parser/hintparser.y | 4 +- 2 files changed, 534 insertions(+), 472 deletions(-) diff --git a/pkg/parser/hintparser.go b/pkg/parser/hintparser.go index e0b63b234b239..b4008417ddd76 100644 --- a/pkg/parser/hintparser.go +++ b/pkg/parser/hintparser.go @@ -26,14 +26,16 @@ import ( ) type yyhintSymType struct { - yys int - offset int - ident string - number uint64 - hint *ast.TableOptimizerHint - hints []*ast.TableOptimizerHint - table ast.HintTable - modelIdents []model.CIStr + yys int + offset int + ident string + number uint64 + hint *ast.TableOptimizerHint + hints []*ast.TableOptimizerHint + table ast.HintTable + modelIdents []model.CIStr + leadingList *ast.LeadingList + leadingElement interface{} // Modified: Represents either *ast.HintTable or *ast.LeadingList } type yyhintXError struct { @@ -137,149 +139,151 @@ const ( hintWriteSlowLog = 57382 yyhintMaxDepth = 200 - yyhintTabOfs = -225 + yyhintTabOfs = -229 ) var ( yyhintXLAT = map[int]int{ - 41: 0, // ')' (166x) - 57380: 1, // hintAggToCop (156x) - 57403: 2, // hintBCJoin (156x) - 57355: 3, // hintBKA (156x) - 57357: 4, // hintBNL (156x) - 57419: 5, // hintForceIndex (156x) - 57383: 6, // hintHashAgg (156x) - 57359: 7, // hintHashJoin (156x) - 57360: 8, // hintHashJoinBuild (156x) - 57361: 9, // hintHashJoinProbe (156x) - 57379: 10, // hintHypoIndex (156x) - 57347: 11, // hintIdentifier (156x) - 57386: 12, // hintIgnoreIndex (156x) - 57381: 13, // hintIgnorePlanCache (156x) - 57390: 14, // hintIndexHashJoin (156x) - 57387: 15, // hintIndexJoin (156x) - 57411: 16, // hintIndexLookUpPushDown (156x) - 57365: 17, // hintIndexMerge (156x) - 57394: 18, // hintIndexMergeJoin (156x) - 57389: 19, // hintInlHashJoin (156x) - 57392: 20, // hintInlJoin (156x) - 57393: 21, // hintInlMergeJoin (156x) - 57351: 22, // hintJoinFixedOrder (156x) - 57352: 23, // hintJoinOrder (156x) - 57353: 24, // hintJoinPrefix (156x) - 57354: 25, // hintJoinSuffix (156x) - 57421: 26, // hintLeading (156x) - 57418: 27, // hintLimitToCop (156x) - 57375: 28, // hintMaxExecutionTime (156x) - 57396: 29, // hintMemoryQuota (156x) - 57363: 30, // hintMerge (156x) - 57384: 31, // hintMpp1PhaseAgg (156x) - 57385: 32, // hintMpp2PhaseAgg (156x) - 57367: 33, // hintMRR (156x) - 57356: 34, // hintNoBKA (156x) - 57358: 35, // hintNoBNL (156x) - 57423: 36, // hintNoDecorrelate (156x) - 57362: 37, // hintNoHashJoin (156x) - 57369: 38, // hintNoICP (156x) - 57391: 39, // hintNoIndexHashJoin (156x) - 57388: 40, // hintNoIndexJoin (156x) - 57412: 41, // hintNoIndexLookUpPushDown (156x) - 57366: 42, // hintNoIndexMerge (156x) - 57395: 43, // hintNoIndexMergeJoin (156x) - 57364: 44, // hintNoMerge (156x) - 57368: 45, // hintNoMRR (156x) - 57410: 46, // hintNoOrderIndex (156x) - 57370: 47, // hintNoRangeOptimization (156x) - 57374: 48, // hintNoSemijoin (156x) - 57372: 49, // hintNoSkipScan (156x) - 57402: 50, // hintNoSMJoin (156x) - 57397: 51, // hintNoSwapJoinInputs (156x) - 57417: 52, // hintNthPlan (156x) - 57409: 53, // hintOrderIndex (156x) - 57378: 54, // hintQBName (156x) - 57398: 55, // hintQueryType (156x) - 57399: 56, // hintReadConsistentReplica (156x) - 57400: 57, // hintReadFromStorage (156x) - 57377: 58, // hintResourceGroup (156x) - 57373: 59, // hintSemijoin (156x) - 57422: 60, // hintSemiJoinRewrite (156x) - 57376: 61, // hintSetVar (156x) - 57404: 62, // hintShuffleJoin (156x) - 57371: 63, // hintSkipScan (156x) - 57401: 64, // hintSMJoin (156x) - 57420: 65, // hintStraightJoin (156x) - 57405: 66, // hintStreamAgg (156x) - 57406: 67, // hintSwapJoinInputs (156x) - 57415: 68, // hintTimeRange (156x) - 57416: 69, // hintUseCascades (156x) - 57408: 70, // hintUseIndex (156x) - 57407: 71, // hintUseIndexMerge (156x) - 57413: 72, // hintUsePlanCache (156x) - 57414: 73, // hintUseToja (156x) - 57382: 74, // hintWriteSlowLog (156x) - 44: 75, // ',' (150x) - 57433: 76, // hintDupsWeedOut (128x) - 57434: 77, // hintFirstMatch (128x) - 57435: 78, // hintLooseScan (128x) - 57436: 79, // hintMaterialization (128x) - 57428: 80, // hintTiFlash (128x) - 57427: 81, // hintTiKV (128x) - 57429: 82, // hintFalse (127x) - 57424: 83, // hintOLAP (127x) - 57425: 84, // hintOLTP (127x) - 57430: 85, // hintTrue (127x) - 57432: 86, // hintGB (126x) - 57431: 87, // hintMB (126x) - 57349: 88, // hintSingleAtIdentifier (107x) + 41: 0, // ')' (172x) + 57380: 1, // hintAggToCop (161x) + 57403: 2, // hintBCJoin (161x) + 57355: 3, // hintBKA (161x) + 57357: 4, // hintBNL (161x) + 57419: 5, // hintForceIndex (161x) + 57383: 6, // hintHashAgg (161x) + 57359: 7, // hintHashJoin (161x) + 57360: 8, // hintHashJoinBuild (161x) + 57361: 9, // hintHashJoinProbe (161x) + 57379: 10, // hintHypoIndex (161x) + 57347: 11, // hintIdentifier (161x) + 57386: 12, // hintIgnoreIndex (161x) + 57381: 13, // hintIgnorePlanCache (161x) + 57390: 14, // hintIndexHashJoin (161x) + 57387: 15, // hintIndexJoin (161x) + 57411: 16, // hintIndexLookUpPushDown (161x) + 57365: 17, // hintIndexMerge (161x) + 57394: 18, // hintIndexMergeJoin (161x) + 57389: 19, // hintInlHashJoin (161x) + 57392: 20, // hintInlJoin (161x) + 57393: 21, // hintInlMergeJoin (161x) + 57351: 22, // hintJoinFixedOrder (161x) + 57352: 23, // hintJoinOrder (161x) + 57353: 24, // hintJoinPrefix (161x) + 57354: 25, // hintJoinSuffix (161x) + 57421: 26, // hintLeading (161x) + 57418: 27, // hintLimitToCop (161x) + 57375: 28, // hintMaxExecutionTime (161x) + 57396: 29, // hintMemoryQuota (161x) + 57363: 30, // hintMerge (161x) + 57384: 31, // hintMpp1PhaseAgg (161x) + 57385: 32, // hintMpp2PhaseAgg (161x) + 57367: 33, // hintMRR (161x) + 57356: 34, // hintNoBKA (161x) + 57358: 35, // hintNoBNL (161x) + 57423: 36, // hintNoDecorrelate (161x) + 57362: 37, // hintNoHashJoin (161x) + 57369: 38, // hintNoICP (161x) + 57391: 39, // hintNoIndexHashJoin (161x) + 57388: 40, // hintNoIndexJoin (161x) + 57412: 41, // hintNoIndexLookUpPushDown (161x) + 57366: 42, // hintNoIndexMerge (161x) + 57395: 43, // hintNoIndexMergeJoin (161x) + 57364: 44, // hintNoMerge (161x) + 57368: 45, // hintNoMRR (161x) + 57410: 46, // hintNoOrderIndex (161x) + 57370: 47, // hintNoRangeOptimization (161x) + 57374: 48, // hintNoSemijoin (161x) + 57372: 49, // hintNoSkipScan (161x) + 57402: 50, // hintNoSMJoin (161x) + 57397: 51, // hintNoSwapJoinInputs (161x) + 57417: 52, // hintNthPlan (161x) + 57409: 53, // hintOrderIndex (161x) + 57378: 54, // hintQBName (161x) + 57398: 55, // hintQueryType (161x) + 57399: 56, // hintReadConsistentReplica (161x) + 57400: 57, // hintReadFromStorage (161x) + 57377: 58, // hintResourceGroup (161x) + 57373: 59, // hintSemijoin (161x) + 57422: 60, // hintSemiJoinRewrite (161x) + 57376: 61, // hintSetVar (161x) + 57404: 62, // hintShuffleJoin (161x) + 57371: 63, // hintSkipScan (161x) + 57401: 64, // hintSMJoin (161x) + 57420: 65, // hintStraightJoin (161x) + 57405: 66, // hintStreamAgg (161x) + 57406: 67, // hintSwapJoinInputs (161x) + 57415: 68, // hintTimeRange (161x) + 57416: 69, // hintUseCascades (161x) + 57408: 70, // hintUseIndex (161x) + 57407: 71, // hintUseIndexMerge (161x) + 57413: 72, // hintUsePlanCache (161x) + 57414: 73, // hintUseToja (161x) + 57382: 74, // hintWriteSlowLog (161x) + 44: 75, // ',' (157x) + 57433: 76, // hintDupsWeedOut (132x) + 57434: 77, // hintFirstMatch (132x) + 57435: 78, // hintLooseScan (132x) + 57436: 79, // hintMaterialization (132x) + 57428: 80, // hintTiFlash (132x) + 57427: 81, // hintTiKV (132x) + 57429: 82, // hintFalse (131x) + 57424: 83, // hintOLAP (131x) + 57425: 84, // hintOLTP (131x) + 57430: 85, // hintTrue (131x) + 57432: 86, // hintGB (130x) + 57431: 87, // hintMB (130x) + 57349: 88, // hintSingleAtIdentifier (108x) 57346: 89, // hintIntLit (104x) 93: 90, // ']' (97x) 46: 91, // '.' (96x) 57426: 92, // hintPartition (91x) 61: 93, // '=' (88x) - 40: 94, // '(' (82x) - 57344: 95, // $end (30x) - 57457: 96, // QueryBlockOpt (21x) - 57449: 97, // Identifier (18x) - 57350: 98, // hintStringLit (6x) - 57439: 99, // CommaOpt (5x) - 57445: 100, // HintTable (4x) + 40: 94, // '(' (87x) + 57344: 95, // $end (31x) + 57459: 96, // QueryBlockOpt (22x) + 57449: 97, // Identifier (21x) + 57445: 98, // HintTable (7x) + 57350: 99, // hintStringLit (6x) + 57439: 100, // CommaOpt (5x) 57446: 101, // HintTableList (4x) 91: 102, // '[' (3x) - 43: 103, // '+' (2x) - 45: 104, // '-' (2x) - 57438: 105, // BooleanHintName (2x) - 57440: 106, // HintIndexList (2x) - 57442: 107, // HintStorageType (2x) - 57443: 108, // HintStorageTypeAndTable (2x) - 57447: 109, // HintTableListOpt (2x) - 57452: 110, // JoinOrderOptimizerHintName (2x) - 57453: 111, // NullaryHintName (2x) - 57455: 112, // PartitionList (2x) - 57456: 113, // PartitionListOpt (2x) - 57459: 114, // StorageOptimizerHintOpt (2x) - 57460: 115, // SubqueryOptimizerHintName (2x) - 57463: 116, // SubqueryStrategy (2x) - 57464: 117, // SupportedIndexLevelOptimizerHintName (2x) - 57465: 118, // SupportedTableLevelOptimizerHintName (2x) - 57466: 119, // TableOptimizerHintOpt (2x) - 57468: 120, // UnsupportedIndexLevelOptimizerHintName (2x) - 57469: 121, // UnsupportedTableLevelOptimizerHintName (2x) - 57470: 122, // Value (2x) - 57471: 123, // ViewName (2x) - 57441: 124, // HintQueryType (1x) - 57444: 125, // HintStorageTypeAndTableList (1x) - 57448: 126, // HintTrueOrFalse (1x) - 57450: 127, // IndexNameList (1x) - 57451: 128, // IndexNameListOpt (1x) - 57454: 129, // OptimizerHintList (1x) - 57458: 130, // Start (1x) - 57461: 131, // SubqueryStrategies (1x) - 57462: 132, // SubqueryStrategiesOpt (1x) - 57467: 133, // UnitOfBytes (1x) - 57472: 134, // ViewNameList (1x) - 57437: 135, // $default (0x) - 57345: 136, // error (0x) - 57348: 137, // hintInvalid (0x) + 57453: 103, // LeadingTableElement (3x) + 43: 104, // '+' (2x) + 45: 105, // '-' (2x) + 57438: 106, // BooleanHintName (2x) + 57440: 107, // HintIndexList (2x) + 57442: 108, // HintStorageType (2x) + 57443: 109, // HintStorageTypeAndTable (2x) + 57447: 110, // HintTableListOpt (2x) + 57452: 111, // JoinOrderOptimizerHintName (2x) + 57454: 112, // LeadingTableList (2x) + 57455: 113, // NullaryHintName (2x) + 57457: 114, // PartitionList (2x) + 57458: 115, // PartitionListOpt (2x) + 57461: 116, // StorageOptimizerHintOpt (2x) + 57462: 117, // SubqueryOptimizerHintName (2x) + 57465: 118, // SubqueryStrategy (2x) + 57466: 119, // SupportedIndexLevelOptimizerHintName (2x) + 57467: 120, // SupportedTableLevelOptimizerHintName (2x) + 57468: 121, // TableOptimizerHintOpt (2x) + 57470: 122, // UnsupportedIndexLevelOptimizerHintName (2x) + 57471: 123, // UnsupportedTableLevelOptimizerHintName (2x) + 57472: 124, // Value (2x) + 57473: 125, // ViewName (2x) + 57441: 126, // HintQueryType (1x) + 57444: 127, // HintStorageTypeAndTableList (1x) + 57448: 128, // HintTrueOrFalse (1x) + 57450: 129, // IndexNameList (1x) + 57451: 130, // IndexNameListOpt (1x) + 57456: 131, // OptimizerHintList (1x) + 57460: 132, // Start (1x) + 57463: 133, // SubqueryStrategies (1x) + 57464: 134, // SubqueryStrategiesOpt (1x) + 57469: 135, // UnitOfBytes (1x) + 57474: 136, // ViewNameList (1x) + 57437: 137, // $default (0x) + 57345: 138, // error (0x) + 57348: 139, // hintInvalid (0x) } yyhintSymNames = []string{ @@ -381,11 +385,12 @@ var ( "$end", "QueryBlockOpt", "Identifier", + "HintTable", "hintStringLit", "CommaOpt", - "HintTable", "HintTableList", "'['", + "LeadingTableElement", "'+'", "'-'", "BooleanHintName", @@ -394,6 +399,7 @@ var ( "HintStorageTypeAndTable", "HintTableListOpt", "JoinOrderOptimizerHintName", + "LeadingTableList", "NullaryHintName", "PartitionList", "PartitionListOpt", @@ -425,104 +431,87 @@ var ( yyhintReductions = []struct{ xsym, components int }{ {0, 1}, - {130, 1}, - {129, 1}, - {129, 3}, - {129, 1}, - {129, 3}, - {119, 4}, - {119, 4}, - {119, 4}, - {119, 4}, - {119, 4}, - {119, 4}, - {119, 5}, - {119, 5}, - {119, 5}, - {119, 6}, - {119, 4}, - {119, 4}, - {119, 6}, - {119, 6}, - {119, 6}, - {119, 5}, - {119, 4}, - {119, 1}, - {119, 5}, - {119, 5}, - {119, 4}, - {119, 6}, - {119, 6}, - {114, 5}, - {125, 1}, - {125, 3}, - {108, 4}, - {96, 0}, - {96, 1}, - {99, 0}, - {99, 1}, - {113, 0}, - {113, 4}, + {132, 1}, + {131, 1}, + {131, 3}, + {131, 1}, + {131, 3}, + {121, 4}, + {121, 4}, + {121, 4}, + {121, 4}, + {121, 5}, + {121, 4}, + {121, 4}, + {121, 5}, + {121, 5}, + {121, 5}, + {121, 6}, + {121, 4}, + {121, 4}, + {121, 6}, + {121, 6}, + {121, 6}, + {121, 5}, + {121, 4}, + {121, 1}, + {121, 5}, + {121, 5}, + {121, 4}, + {121, 6}, + {121, 6}, + {116, 5}, + {127, 1}, + {127, 3}, + {109, 4}, {112, 1}, {112, 3}, - {109, 1}, - {109, 1}, + {103, 1}, + {103, 3}, + {96, 0}, + {96, 1}, + {100, 0}, + {100, 1}, + {115, 0}, + {115, 4}, + {114, 1}, + {114, 3}, + {110, 1}, + {110, 1}, {101, 2}, {101, 3}, - {100, 3}, - {100, 5}, - {134, 3}, + {98, 3}, + {98, 5}, + {136, 3}, + {136, 1}, + {125, 2}, + {125, 1}, + {107, 4}, + {130, 0}, + {130, 1}, + {129, 1}, + {129, 3}, + {134, 0}, {134, 1}, - {123, 2}, - {123, 1}, - {106, 4}, - {128, 0}, - {128, 1}, - {127, 1}, - {127, 3}, - {132, 0}, - {132, 1}, - {131, 1}, - {131, 3}, - {122, 1}, - {122, 1}, - {122, 1}, - {122, 2}, - {122, 2}, {133, 1}, - {133, 1}, - {126, 1}, - {126, 1}, - {110, 1}, - {110, 1}, - {110, 1}, - {121, 1}, - {121, 1}, - {121, 1}, - {121, 1}, - {121, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, - {118, 1}, + {133, 3}, + {124, 1}, + {124, 1}, + {124, 1}, + {124, 2}, + {124, 2}, + {135, 1}, + {135, 1}, + {128, 1}, + {128, 1}, + {111, 1}, + {111, 1}, + {111, 1}, + {123, 1}, + {123, 1}, + {123, 1}, + {123, 1}, + {123, 1}, {120, 1}, {120, 1}, {120, 1}, @@ -530,39 +519,60 @@ var ( {120, 1}, {120, 1}, {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {120, 1}, + {122, 1}, + {122, 1}, + {122, 1}, + {122, 1}, + {122, 1}, + {122, 1}, + {122, 1}, + {119, 1}, + {119, 1}, + {119, 1}, + {119, 1}, + {119, 1}, + {119, 1}, + {119, 1}, + {119, 1}, {117, 1}, {117, 1}, - {117, 1}, - {117, 1}, - {117, 1}, - {117, 1}, - {117, 1}, - {117, 1}, - {115, 1}, - {115, 1}, - {116, 1}, - {116, 1}, - {116, 1}, - {116, 1}, - {105, 1}, - {105, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {111, 1}, - {124, 1}, - {124, 1}, - {107, 1}, - {107, 1}, + {118, 1}, + {118, 1}, + {118, 1}, + {118, 1}, + {106, 1}, + {106, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {113, 1}, + {126, 1}, + {126, 1}, + {108, 1}, + {108, 1}, {97, 1}, {97, 1}, {97, 1}, @@ -653,39 +663,39 @@ var ( yyhintXErrors = map[yyhintXError]string{} - yyhintParseTab = [324][]uint16{ + yyhintParseTab = [335][]uint16{ // 0 - {1: 304, 260, 253, 255, 290, 300, 274, 276, 277, 279, 248, 288, 308, 267, 263, 293, 280, 272, 266, 262, 271, 230, 250, 251, 252, 278, 305, 237, 242, 265, 301, 302, 281, 254, 256, 311, 275, 283, 268, 264, 294, 306, 273, 257, 282, 292, 284, 296, 286, 259, 270, 238, 291, 241, 247, 307, 249, 240, 295, 310, 239, 261, 285, 258, 309, 303, 269, 243, 298, 287, 289, 299, 297, 246, 105: 244, 110: 231, 245, 114: 229, 236, 117: 235, 233, 228, 234, 232, 129: 227, 226}, - {95: 225}, - {1: 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 420, 95: 224, 99: 546}, - {1: 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 95: 223}, - {1: 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 95: 221}, + {1: 308, 265, 258, 260, 294, 304, 279, 281, 282, 283, 253, 292, 312, 272, 268, 297, 284, 277, 271, 267, 276, 234, 255, 256, 257, 238, 309, 242, 247, 270, 305, 306, 285, 259, 261, 315, 280, 287, 273, 269, 298, 310, 278, 262, 286, 296, 288, 300, 290, 264, 275, 243, 295, 246, 252, 311, 254, 245, 299, 314, 244, 266, 289, 263, 313, 307, 274, 248, 302, 291, 293, 303, 301, 251, 106: 249, 111: 235, 113: 250, 116: 233, 241, 119: 240, 237, 232, 239, 236, 131: 231, 230}, + {95: 229}, + {1: 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 424, 95: 228, 100: 561}, + {1: 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 95: 227}, + {1: 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 95: 225}, // 5 - {94: 543}, - {94: 540}, - {94: 537}, - {94: 532}, - {94: 529}, + {94: 558}, + {94: 555}, + {94: 552}, + {94: 547}, + {94: 536}, // 10 - {94: 518}, + {94: 533}, + {94: 522}, + {94: 510}, {94: 506}, {94: 502}, - {94: 498}, - {94: 493}, // 15 - {94: 490}, - {94: 478}, - {94: 471}, - {94: 466}, - {94: 460}, + {94: 497}, + {94: 494}, + {94: 482}, + {94: 475}, + {94: 470}, // 20 - {94: 457}, - {1: 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 95: 202}, - {94: 451}, - {94: 431}, - {94: 312}, + {94: 464}, + {94: 461}, + {1: 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 95: 205}, + {94: 455}, + {94: 435}, // 25 - {94: 156}, + {94: 316}, {94: 155}, {94: 154}, {94: 153}, @@ -759,21 +769,21 @@ var ( // 85 {94: 92}, {94: 91}, - {80: 192, 192, 88: 314, 96: 313}, - {80: 319, 318, 107: 317, 316, 125: 315}, - {191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 89: 191, 191, 191, 191}, + {80: 191, 191, 88: 318, 96: 317}, + {80: 323, 322, 108: 321, 320, 127: 319}, + {190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 89: 190, 190, 190, 190, 94: 190}, // 90 - {428, 75: 429}, - {195, 75: 195}, - {102: 320}, + {432, 75: 433}, + {198, 75: 198}, + {102: 324}, {102: 88}, {102: 87}, // 95 - {1: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 76: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 96: 322, 101: 321}, - {75: 426, 90: 425}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 324, 100: 323}, - {182, 75: 182, 90: 182}, - {192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 90: 192, 412, 192, 96: 411}, + {1: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 76: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 96: 326, 101: 325}, + {75: 430, 90: 429}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 328, 327}, + {181, 75: 181, 90: 181}, + {191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 90: 191, 416, 191, 96: 415}, // 100 {86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86}, {85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85}, @@ -878,171 +888,184 @@ var ( {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, // 185 {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - {188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 90: 188, 92: 415, 113: 424}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 413}, - {192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 90: 192, 92: 192, 96: 414}, - {188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 90: 188, 92: 415, 113: 416}, + {187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 90: 187, 92: 419, 115: 428}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 417}, + {191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 90: 191, 92: 191, 96: 418}, + {187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 90: 187, 92: 419, 115: 420}, // 190 - {94: 417}, - {179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 90: 179}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 419, 112: 418}, - {421, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 420, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 99: 422}, - {186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186}, + {94: 421}, + {178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 90: 178}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 423, 114: 422}, + {425, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 424, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 100: 426}, + {185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185}, // 195 - {189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 76: 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 89: 189, 98: 189}, - {187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 90: 187}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 423}, - {185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 89: 185}, - {180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 90: 180}, + {188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 76: 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 89: 188, 99: 188}, + {186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 90: 186}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 427}, + {184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 89: 184}, + {179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 90: 179}, // 200 - {193, 75: 193}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 324, 100: 427}, - {181, 75: 181, 90: 181}, - {1: 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 95: 196}, - {80: 319, 318, 107: 317, 430}, + {196, 75: 196}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 328, 431}, + {180, 75: 180, 90: 180}, + {1: 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 95: 199}, + {80: 323, 322, 108: 321, 434}, // 205 - {194, 75: 194}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 314, 192, 96: 432, 434, 112: 433}, - {89: 449}, - {445, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 420, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 89: 190, 99: 446}, - {186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 89: 186, 93: 435}, + {197, 75: 197}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 318, 191, 96: 436, 438, 114: 437}, + {89: 453}, + {449, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 424, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 89: 189, 100: 450}, + {185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 89: 185, 93: 439}, // 210 - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 89: 439, 97: 438, 437, 103: 440, 441, 122: 436}, - {444}, - {165}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 89: 443, 97: 442, 99: 441, 104: 444, 445, 124: 440}, + {448}, {164}, {163}, + {162}, // 215 - {89: 443}, - {89: 442}, + {89: 447}, + {89: 446}, + {160}, {161}, - {162}, - {1: 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 95: 197}, + {1: 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 95: 200}, // 220 - {1: 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 95: 199}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 89: 447, 97: 423}, - {448}, - {1: 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 95: 198}, - {450}, + {1: 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 95: 202}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 89: 451, 97: 427}, + {452}, + {1: 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 95: 201}, + {454}, // 225 - {1: 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 95: 200}, - {83: 192, 192, 88: 314, 96: 452}, - {83: 454, 455, 124: 453}, - {456}, + {1: 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 95: 203}, + {83: 191, 191, 88: 318, 96: 456}, + {83: 458, 459, 126: 457}, + {460}, {90}, // 230 {89}, - {1: 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 95: 201}, - {192, 88: 314, 96: 458}, - {459}, - {1: 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 95: 203}, + {1: 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 95: 204}, + {191, 88: 318, 96: 462}, + {463}, + {1: 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 95: 206}, // 235 - {82: 192, 85: 192, 88: 314, 96: 461}, - {82: 464, 85: 463, 126: 462}, - {465}, - {158}, + {82: 191, 85: 191, 88: 318, 96: 465}, + {82: 468, 85: 467, 128: 466}, + {469}, {157}, + {156}, // 240 - {1: 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 95: 204}, - {98: 467}, - {75: 420, 98: 190, 468}, - {98: 469}, - {470}, + {1: 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 95: 207}, + {99: 471}, + {75: 424, 99: 189, 472}, + {99: 473}, + {474}, // 245 - {1: 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 95: 205}, - {88: 314, 192, 96: 472}, - {89: 473}, - {86: 476, 475, 133: 474}, - {477}, + {1: 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 95: 208}, + {88: 318, 191, 96: 476}, + {89: 477}, + {86: 480, 479, 135: 478}, + {481}, // 250 - {160}, {159}, - {1: 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 95: 206}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 479}, - {480, 75: 481}, + {158}, + {1: 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 95: 209}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 483}, + {484, 75: 485}, // 255 - {1: 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 95: 208}, - {192, 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 314, 91: 192, 96: 485, 484, 123: 483, 134: 482}, - {487, 91: 488}, - {177, 91: 177}, - {192, 88: 314, 91: 192, 96: 486}, + {1: 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 95: 211}, + {191, 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 318, 91: 191, 96: 489, 488, 125: 487, 136: 486}, + {491, 91: 492}, + {176, 91: 176}, + {191, 88: 318, 91: 191, 96: 490}, // 260 + {174, 91: 174}, {175, 91: 175}, - {176, 91: 176}, - {1: 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 95: 207}, - {192, 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 314, 91: 192, 96: 485, 484, 123: 489}, - {178, 91: 178}, + {1: 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 95: 210}, + {191, 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 318, 91: 191, 96: 489, 488, 125: 493}, + {177, 91: 177}, // 265 - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 491}, - {492}, - {1: 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 95: 209}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 494}, - {93: 495}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 495}, + {496}, + {1: 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 95: 212}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 498}, + {93: 499}, // 270 - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 89: 439, 97: 438, 437, 103: 440, 441, 122: 496}, - {497}, - {1: 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 95: 210}, - {88: 314, 192, 96: 499}, - {89: 500}, - // 275 + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 89: 443, 97: 442, 99: 441, 104: 444, 445, 124: 500}, {501}, - {1: 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 95: 211}, - {88: 314, 192, 96: 503}, + {1: 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 95: 213}, + {88: 318, 191, 96: 503}, {89: 504}, + // 275 {505}, + {1: 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 95: 214}, + {88: 318, 191, 96: 507}, + {89: 508}, + {509}, // 280 - {1: 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 95: 212}, - {192, 76: 192, 192, 192, 192, 88: 314, 96: 507}, - {169, 76: 511, 512, 513, 514, 116: 510, 131: 509, 508}, - {517}, - {168, 75: 515}, + {1: 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 95: 215}, + {191, 76: 191, 191, 191, 191, 88: 318, 96: 511}, + {168, 76: 515, 516, 517, 518, 118: 514, 133: 513, 512}, + {521}, + {167, 75: 519}, // 285 - {167, 75: 167}, + {166, 75: 166}, {109, 75: 109}, {108, 75: 108}, {107, 75: 107}, {106, 75: 106}, // 290 - {76: 511, 512, 513, 514, 116: 516}, - {166, 75: 166}, - {1: 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 95: 213}, - {1: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 76: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 96: 520, 106: 519}, - {528}, + {76: 515, 516, 517, 518, 118: 520}, + {165, 75: 165}, + {1: 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 95: 216}, + {1: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 76: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 96: 524, 107: 523}, + {532}, // 295 - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 324, 100: 521}, - {190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 420, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 99: 522}, - {173, 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 525, 127: 524, 523}, - {174}, - {172, 75: 526}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 328, 525}, + {189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 424, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 100: 526}, + {172, 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 529, 129: 528, 527}, + {173}, + {171, 75: 530}, // 300 - {171, 75: 171}, - {1: 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 527}, {170, 75: 170}, - {1: 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 95: 214}, - {1: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 76: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 96: 520, 106: 530}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 531}, + {169, 75: 169}, + {1: 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 95: 217}, + {1: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 76: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 96: 524, 107: 534}, // 305 - {531}, - {1: 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 95: 215}, - {192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 76: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 96: 535, 101: 534, 109: 533}, - {536}, - {184, 75: 426}, + {535}, + {1: 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 95: 218}, + {1: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 76: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 94: 191, 96: 537}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 94: 541, 97: 328, 540, 103: 539, 112: 538}, + {546, 75: 543}, // 310 - {183, 355, 379, 330, 332, 394, 359, 334, 335, 336, 354, 325, 362, 357, 364, 367, 387, 340, 370, 363, 366, 369, 326, 327, 328, 329, 396, 356, 350, 372, 338, 360, 361, 342, 331, 333, 398, 337, 344, 365, 368, 388, 341, 371, 339, 343, 386, 345, 349, 347, 378, 373, 393, 385, 353, 374, 375, 376, 352, 348, 397, 351, 380, 346, 377, 395, 381, 382, 391, 392, 384, 383, 389, 390, 358, 76: 407, 408, 409, 410, 402, 401, 403, 399, 400, 404, 406, 405, 97: 324, 100: 323}, - {1: 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 95: 216}, - {192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 76: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 96: 535, 101: 534, 109: 538}, - {539}, - {1: 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 95: 217}, + {195, 75: 195}, + {193, 75: 193}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 94: 541, 97: 328, 540, 103: 539, 112: 542}, + {544, 75: 543}, + {1: 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 94: 541, 97: 328, 540, 103: 545}, // 315 - {1: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 76: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 314, 96: 322, 101: 541}, - {542, 75: 426}, - {1: 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 95: 218}, - {192, 88: 314, 96: 544}, - {545}, - // 320 + {192, 75: 192}, + {194, 75: 194}, {1: 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 95: 219}, - {1: 304, 260, 253, 255, 290, 300, 274, 276, 277, 279, 248, 288, 308, 267, 263, 293, 280, 272, 266, 262, 271, 230, 250, 251, 252, 278, 305, 237, 242, 265, 301, 302, 281, 254, 256, 311, 275, 283, 268, 264, 294, 306, 273, 257, 282, 292, 284, 296, 286, 259, 270, 238, 291, 241, 247, 307, 249, 240, 295, 310, 239, 261, 285, 258, 309, 303, 269, 243, 298, 287, 289, 299, 297, 246, 105: 244, 110: 231, 245, 114: 548, 236, 117: 235, 233, 547, 234, 232}, - {1: 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 95: 222}, + {191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 76: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 96: 550, 101: 549, 110: 548}, + {551}, + // 320 + {183, 75: 430}, + {182, 359, 383, 334, 336, 398, 363, 338, 339, 340, 358, 329, 366, 361, 368, 371, 391, 344, 374, 367, 370, 373, 330, 331, 332, 333, 400, 360, 354, 376, 342, 364, 365, 346, 335, 337, 402, 341, 348, 369, 372, 392, 345, 375, 343, 347, 390, 349, 353, 351, 382, 377, 397, 389, 357, 378, 379, 380, 356, 352, 401, 355, 384, 350, 381, 399, 385, 386, 395, 396, 388, 387, 393, 394, 362, 76: 411, 412, 413, 414, 406, 405, 407, 403, 404, 408, 410, 409, 97: 328, 327}, {1: 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 95: 220}, + {191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 76: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 96: 550, 101: 549, 110: 553}, + {554}, + // 325 + {1: 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 95: 221}, + {1: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 76: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 318, 96: 326, 101: 556}, + {557, 75: 430}, + {1: 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 95: 222}, + {191, 88: 318, 96: 559}, + // 330 + {560}, + {1: 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 95: 223}, + {1: 308, 265, 258, 260, 294, 304, 279, 281, 282, 283, 253, 292, 312, 272, 268, 297, 284, 277, 271, 267, 276, 234, 255, 256, 257, 238, 309, 242, 247, 270, 305, 306, 285, 259, 261, 315, 280, 287, 273, 269, 298, 310, 278, 262, 286, 296, 288, 300, 290, 264, 275, 243, 295, 246, 252, 311, 254, 245, 299, 314, 244, 266, 289, 263, 313, 307, 274, 248, 302, 291, 293, 303, 301, 251, 106: 249, 111: 235, 113: 250, 116: 563, 241, 119: 240, 237, 562, 239, 236}, + {1: 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 95: 226}, + {1: 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 95: 224}, } ) @@ -1082,7 +1105,7 @@ func yyhintlex1(yylex yyhintLexer, lval *yyhintSymType) (n int) { } func yyhintParse(yylex yyhintLexer, parser *hintParser) int { - const yyError = 136 + const yyError = 138 yyEx, _ := yylex.(yyhintLexerEx) var yyn int @@ -1305,22 +1328,43 @@ yynewstate: parser.yyVAL.hint = h } case 10: + { + h := &ast.TableOptimizerHint{ + HintName: model.NewCIStr(yyS[yypt-4].ident), + QBName: model.NewCIStr(yyS[yypt-2].ident), + HintData: yyS[yypt-1].leadingList, + } + // For LEADING hints we need to maintain two views of the tables: + // h.HintData: + // - Stores the structured AST node (LeadingList). + // - Preserves the nesting and order information of LEADING(...), + // + // h.Tables: + // - Stores a flat slice of all HintTable elements inside the LeadingList. + // - Only used for initialization. + if leadingList, ok := h.HintData.(*ast.LeadingList); ok { + // be compatible with the prior flatten writing style + h.Tables = ast.FlattenLeadingList(leadingList) + } + parser.yyVAL.hint = h + } + case 11: { parser.warnUnsupportedHint(yyS[yypt-3].ident) parser.yyVAL.hint = nil } - case 11: + case 12: { h := yyS[yypt-1].hint h.HintName = model.NewCIStr(yyS[yypt-3].ident) parser.yyVAL.hint = h } - case 12: + case 13: { parser.warnUnsupportedHint(yyS[yypt-4].ident) parser.yyVAL.hint = nil } - case 13: + case 14: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-4].ident), @@ -1328,7 +1372,7 @@ yynewstate: HintData: yyS[yypt-1].number, } } - case 14: + case 15: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-4].ident), @@ -1336,7 +1380,7 @@ yynewstate: HintData: int64(yyS[yypt-1].number), } } - case 15: + case 16: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-5].ident), @@ -1346,21 +1390,21 @@ yynewstate: }, } } - case 16: + case 17: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-3].ident), HintData: yyS[yypt-1].ident, } } - case 17: + case 18: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-3].ident), QBName: model.NewCIStr(yyS[yypt-1].ident), } } - case 18: + case 19: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-5].ident), @@ -1368,7 +1412,7 @@ yynewstate: Tables: yyS[yypt-1].hint.Tables, } } - case 19: + case 20: { maxValue := uint64(math.MaxInt64) / yyS[yypt-1].number if yyS[yypt-2].number <= maxValue { @@ -1383,7 +1427,7 @@ yynewstate: parser.yyVAL.hint = nil } } - case 20: + case 21: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-5].ident), @@ -1393,27 +1437,27 @@ yynewstate: }, } } - case 21: + case 22: { h := yyS[yypt-1].hint h.HintName = model.NewCIStr(yyS[yypt-4].ident) h.QBName = model.NewCIStr(yyS[yypt-2].ident) parser.yyVAL.hint = h } - case 22: + case 23: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-3].ident), QBName: model.NewCIStr(yyS[yypt-1].ident), } } - case 23: + case 24: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-0].ident), } } - case 24: + case 25: { parser.yyVAL.hint = &ast.TableOptimizerHint{ HintName: model.NewCIStr(yyS[yypt-4].ident), @@ -1421,27 +1465,27 @@ yynewstate: HintData: model.NewCIStr(yyS[yypt-1].ident), } } - case 25: + case 26: { parser.warnUnsupportedHint(yyS[yypt-4].ident) parser.yyVAL.hint = nil } - case 26: + case 27: { parser.warnUnsupportedHint(yyS[yypt-3].ident) parser.yyVAL.hint = nil } - case 27: + case 28: { parser.warnUnsupportedHint(yyS[yypt-5].ident) parser.yyVAL.hint = nil } - case 28: + case 29: { parser.warnUnsupportedHint(yyS[yypt-5].ident) parser.yyVAL.hint = nil } - case 29: + case 30: { hs := yyS[yypt-1].hints name := model.NewCIStr(yyS[yypt-4].ident) @@ -1452,60 +1496,78 @@ yynewstate: } parser.yyVAL.hints = hs } - case 30: + case 31: { parser.yyVAL.hints = []*ast.TableOptimizerHint{yyS[yypt-0].hint} } - case 31: + case 32: { parser.yyVAL.hints = append(yyS[yypt-2].hints, yyS[yypt-0].hint) } - case 32: + case 33: { h := yyS[yypt-1].hint h.HintData = model.NewCIStr(yyS[yypt-3].ident) parser.yyVAL.hint = h } - case 33: + case 34: { - parser.yyVAL.ident = "" + parser.yyVAL.leadingList = &ast.LeadingList{Items: []interface{}{yyS[yypt-0].leadingElement}} + } + case 35: + { + parser.yyVAL.leadingList = yyS[yypt-2].leadingList + parser.yyVAL.leadingList.Items = append(parser.yyVAL.leadingList.Items, yyS[yypt-0].leadingElement) + } + case 36: + { + tmp := yyS[yypt-0].table + parser.yyVAL.leadingElement = &tmp } case 37: { - parser.yyVAL.modelIdents = nil + parser.yyVAL.leadingElement = yyS[yypt-1].leadingList } case 38: + { + parser.yyVAL.ident = "" + } + case 42: + { + parser.yyVAL.modelIdents = nil + } + case 43: { parser.yyVAL.modelIdents = yyS[yypt-1].modelIdents } - case 39: + case 44: { parser.yyVAL.modelIdents = []model.CIStr{model.NewCIStr(yyS[yypt-0].ident)} } - case 40: + case 45: { parser.yyVAL.modelIdents = append(yyS[yypt-2].modelIdents, model.NewCIStr(yyS[yypt-0].ident)) } - case 42: + case 47: { parser.yyVAL.hint = &ast.TableOptimizerHint{ QBName: model.NewCIStr(yyS[yypt-0].ident), } } - case 43: + case 48: { parser.yyVAL.hint = &ast.TableOptimizerHint{ Tables: []ast.HintTable{yyS[yypt-0].table}, QBName: model.NewCIStr(yyS[yypt-1].ident), } } - case 44: + case 49: { h := yyS[yypt-2].hint h.Tables = append(h.Tables, yyS[yypt-0].table) parser.yyVAL.hint = h } - case 45: + case 50: { parser.yyVAL.table = ast.HintTable{ TableName: model.NewCIStr(yyS[yypt-2].ident), @@ -1513,7 +1575,7 @@ yynewstate: PartitionList: yyS[yypt-0].modelIdents, } } - case 46: + case 51: { parser.yyVAL.table = ast.HintTable{ DBName: model.NewCIStr(yyS[yypt-4].ident), @@ -1522,63 +1584,63 @@ yynewstate: PartitionList: yyS[yypt-0].modelIdents, } } - case 47: + case 52: { h := yyS[yypt-2].hint h.Tables = append(h.Tables, yyS[yypt-0].table) parser.yyVAL.hint = h } - case 48: + case 53: { parser.yyVAL.hint = &ast.TableOptimizerHint{ Tables: []ast.HintTable{yyS[yypt-0].table}, } } - case 49: + case 54: { parser.yyVAL.table = ast.HintTable{ TableName: model.NewCIStr(yyS[yypt-1].ident), QBName: model.NewCIStr(yyS[yypt-0].ident), } } - case 50: + case 55: { parser.yyVAL.table = ast.HintTable{ QBName: model.NewCIStr(yyS[yypt-0].ident), } } - case 51: + case 56: { h := yyS[yypt-0].hint h.Tables = []ast.HintTable{yyS[yypt-2].table} h.QBName = model.NewCIStr(yyS[yypt-3].ident) parser.yyVAL.hint = h } - case 52: + case 57: { parser.yyVAL.hint = &ast.TableOptimizerHint{} } - case 54: + case 59: { parser.yyVAL.hint = &ast.TableOptimizerHint{ Indexes: []model.CIStr{model.NewCIStr(yyS[yypt-0].ident)}, } } - case 55: + case 60: { h := yyS[yypt-2].hint h.Indexes = append(h.Indexes, model.NewCIStr(yyS[yypt-0].ident)) parser.yyVAL.hint = h } - case 62: + case 67: { parser.yyVAL.ident = strconv.FormatUint(yyS[yypt-0].number, 10) } - case 63: + case 68: { parser.yyVAL.ident = strconv.FormatUint(yyS[yypt-0].number, 10) } - case 64: + case 69: { if yyS[yypt-0].number > 9223372036854775808 { yylex.AppendError(yylex.Errorf("the Signed Value should be at the range of [-9223372036854775808, 9223372036854775807].")) @@ -1590,19 +1652,19 @@ yynewstate: parser.yyVAL.ident = strconv.FormatInt(-int64(yyS[yypt-0].number), 10) } } - case 65: + case 70: { parser.yyVAL.number = 1024 * 1024 } - case 66: + case 71: { parser.yyVAL.number = 1024 * 1024 * 1024 } - case 67: + case 72: { parser.yyVAL.hint = &ast.TableOptimizerHint{HintData: true} } - case 68: + case 73: { parser.yyVAL.hint = &ast.TableOptimizerHint{HintData: false} } diff --git a/pkg/parser/hintparser.y b/pkg/parser/hintparser.y index 7748a6a0b1478..f801378b2e447 100644 --- a/pkg/parser/hintparser.y +++ b/pkg/parser/hintparser.y @@ -257,8 +257,8 @@ TableOptimizerHintOpt: | "LEADING" '(' QueryBlockOpt LeadingTableList ')' { h := &ast.TableOptimizerHint{ - HintName: ast.NewCIStr($1), - QBName: ast.NewCIStr($3), + HintName: model.NewCIStr($1), + QBName: model.NewCIStr($3), HintData: $4, } // For LEADING hints we need to maintain two views of the tables: From 36b2bf6ad0021bfd0c0766fcf300d4c549ecb36f Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Tue, 2 Jun 2026 15:07:34 +0800 Subject: [PATCH 03/25] planner: pre-refactor for join reorder conflict detection algorithm Signed-off-by: guo-shaoge --- pkg/expression/schema.go | 16 + pkg/planner/core/BUILD.bazel | 1 + pkg/planner/core/joinorder/BUILD.bazel | 16 + pkg/planner/core/joinorder/util.go | 333 ++++++++++++++++++ .../operator/logicalop/logical_projection.go | 11 + pkg/planner/core/plan_cost_ver2.go | 12 +- pkg/planner/core/rule_join_reorder.go | 89 +---- 7 files changed, 389 insertions(+), 89 deletions(-) create mode 100644 pkg/planner/core/joinorder/BUILD.bazel create mode 100644 pkg/planner/core/joinorder/util.go diff --git a/pkg/expression/schema.go b/pkg/expression/schema.go index 3e2e737024e88..6864672337a0a 100644 --- a/pkg/expression/schema.go +++ b/pkg/expression/schema.go @@ -83,6 +83,22 @@ func (s *Schema) Clone() *Schema { return schema } +// Equal checks if two schemas are equal. +func (s *Schema) Equal(other *Schema) bool { + if s == nil || other == nil { + return s == other + } + if len(s.Columns) != len(other.Columns) { + return false + } + for i, col := range s.Columns { + if !col.EqualColumn(other.Columns[i]) { + return false + } + } + return true +} + // ExprReferenceSchema checks if any column of this expression are from the schema. func ExprReferenceSchema(expr Expression, schema *Schema) bool { switch v := expr.(type) { diff --git a/pkg/planner/core/BUILD.bazel b/pkg/planner/core/BUILD.bazel index 6dbe8bd8efca3..72b2f3eb24e85 100644 --- a/pkg/planner/core/BUILD.bazel +++ b/pkg/planner/core/BUILD.bazel @@ -123,6 +123,7 @@ go_library( "//pkg/planner/cascades/base", "//pkg/planner/core/base", "//pkg/planner/core/cost", + "//pkg/planner/core/joinorder", "//pkg/planner/core/metrics", "//pkg/planner/core/operator/baseimpl", "//pkg/planner/core/operator/logicalop", diff --git a/pkg/planner/core/joinorder/BUILD.bazel b/pkg/planner/core/joinorder/BUILD.bazel new file mode 100644 index 0000000000000..af9d0ae09f67f --- /dev/null +++ b/pkg/planner/core/joinorder/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "joinorder", + srcs = ["util.go"], + importpath = "github.com/pingcap/tidb/pkg/planner/core/joinorder", + visibility = ["//visibility:public"], + deps = [ + "//pkg/parser/ast", + "//pkg/planner/core/base", + "//pkg/planner/core/operator/logicalop", + "//pkg/planner/util", + "//pkg/util/hint", + "//pkg/util/intest", + ], +) diff --git a/pkg/planner/core/joinorder/util.go b/pkg/planner/core/joinorder/util.go new file mode 100644 index 0000000000000..a39dae31f36c8 --- /dev/null +++ b/pkg/planner/core/joinorder/util.go @@ -0,0 +1,333 @@ +// Copyright 2026 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package joinorder + +import ( + "strconv" + "strings" + + "github.com/pingcap/tidb/pkg/parser/ast" + "github.com/pingcap/tidb/pkg/planner/core/base" + "github.com/pingcap/tidb/pkg/planner/core/operator/logicalop" + "github.com/pingcap/tidb/pkg/planner/util" + "github.com/pingcap/tidb/pkg/util/hint" + "github.com/pingcap/tidb/pkg/util/intest" +) + +// JoinMethodHint records the join method hint for a vertex. +type JoinMethodHint struct { + PreferJoinMethod uint + HintInfo *hint.PlanHints +} + +// CheckAndGenerateLeadingHint used to check and generate the valid leading hint. +// We are allowed to use at most one leading hint in a join group. When more than one, +// all leading hints in the current join group will be invalid. +// For example: select /*+ leading(t3) */ * from (select /*+ leading(t1) */ t2.b from t1 join t2 on t1.a=t2.a) t4 join t3 on t4.b=t3.b +// The Join Group {t1, t2, t3} contains two leading hints includes leading(t3) and leading(t1). +// Although they are in different query blocks, they are conflicting. +// In addition, the table alias 't4' cannot be recognized because of the join group. +func CheckAndGenerateLeadingHint(hintInfo []*hint.PlanHints) (*hint.PlanHints, bool) { + leadingHintNum := len(hintInfo) + var leadingHintInfo *hint.PlanHints + hasDiffLeadingHint := false + if leadingHintNum > 0 { + leadingHintInfo = hintInfo[0] + // One join group has one leading hint at most. Check whether there are different join order hints. + for i := 1; i < leadingHintNum; i++ { + if hintInfo[i] != hintInfo[i-1] { + hasDiffLeadingHint = true + break + } + } + if hasDiffLeadingHint { + leadingHintInfo = nil + } + } + return leadingHintInfo, hasDiffLeadingHint +} + +// LeadingTreeFinder finds a node by hint and removes it from the available slice. +type LeadingTreeFinder[T any] func(available []T, hint *ast.HintTable) (T, []T, bool) + +// LeadingTreeJoiner joins two nodes in the leading tree. +type LeadingTreeJoiner[T any] func(left, right T) (T, bool, error) + +// BuildLeadingTreeFromList recursively constructs a LEADING join order tree. +// the `leadingList` argument is derived from a LEADING hint in SQL, e.g.: +// +// /*+ LEADING(t1, (t2, t3), (t4, (t5, t6, t7))) */ +// +// and it is parsed into a nested structure of *ast.LeadingList and *ast.HintTable: +// leadingList.Items = [ +// +// *ast.HintTable{name: "t1"}, +// *ast.LeadingList{ // corresponds to (t2, t3) +// Items: [ +// *ast.HintTable{name: "t2"}, +// *ast.HintTable{name: "t3"}, +// ], +// }, +// *ast.LeadingList{ // corresponds to (t4, (t5, t6, t7)) +// Items: [ +// *ast.HintTable{name: "t4"}, +// *ast.LeadingList{ +// Items: [ +// *ast.HintTable{name: "t5"}, +// *ast.HintTable{name: "t6"}, +// *ast.HintTable{name: "t7"}, +// ], +// }, +// ], +// }, +// +// ] +func BuildLeadingTreeFromList[T any]( + leadingList *ast.LeadingList, + availableGroups []T, + findAndRemoveByHint LeadingTreeFinder[T], + checkAndJoin LeadingTreeJoiner[T], + warn func(), +) (T, []T, bool, error) { + var zero T + if leadingList == nil || len(leadingList.Items) == 0 { + return zero, availableGroups, false, nil + } + + var ( + currentJoin T + err error + ok bool + remainingGroups = availableGroups + ) + + for i, item := range leadingList.Items { + switch element := item.(type) { + case *ast.HintTable: + var tableNode T + tableNode, remainingGroups, ok = findAndRemoveByHint(remainingGroups, element) + if !ok { + return zero, availableGroups, false, nil + } + + if i == 0 { + currentJoin = tableNode + } else { + currentJoin, ok, err = checkAndJoin(currentJoin, tableNode) + if err != nil { + return zero, availableGroups, false, err + } + if !ok { + return zero, availableGroups, false, nil + } + } + case *ast.LeadingList: + var nestedJoin T + nestedJoin, remainingGroups, ok, err = BuildLeadingTreeFromList(element, remainingGroups, findAndRemoveByHint, checkAndJoin, warn) + if err != nil { + return zero, availableGroups, false, err + } + if !ok { + return zero, availableGroups, false, nil + } + + if i == 0 { + currentJoin = nestedJoin + } else { + currentJoin, ok, err = checkAndJoin(currentJoin, nestedJoin) + if err != nil { + return zero, availableGroups, false, err + } + if !ok { + return zero, availableGroups, false, nil + } + } + default: + if warn != nil { + warn() + } + return zero, availableGroups, false, nil + } + } + + return currentJoin, remainingGroups, true, nil +} + +// FindAndRemovePlanByAstHint find the plan in `plans` that matches `ast.HintTable` and remove that plan, returning the new slice. +// Matching rules: +// 1. Match by regular table name (db/table/*) +// 2. Match by query-block alias (subquery name, e.g., tx) +// 3. If multiple join groups belong to the same block alias, mark as ambiguous and skip (consistent with old logic) +// +// NOTE: T is usually be *Node or base.LogicalPlan, we use generics because we want to reuse this function in both the old and new join order code. +func FindAndRemovePlanByAstHint[T any]( + ctx base.PlanContext, + plans []T, + astTbl *ast.HintTable, + getPlan func(T) base.LogicalPlan, +) (T, []T, bool) { + var zero T + var queryBlockNames []ast.HintTable + if p := ctx.GetSessionVars().PlannerSelectBlockAsName.Load(); p != nil { + queryBlockNames = *p + } + + // Step 1: Direct match by table name + for i, joinGroup := range plans { + plan := getPlan(joinGroup) + tableAlias := util.ExtractTableAlias(plan, plan.QueryBlockOffset()) + if tableAlias != nil { + // Match db/table (supports astTbl.DBName == "*") + dbMatch := astTbl.DBName.L == "" || astTbl.DBName.L == tableAlias.DBName.L || astTbl.DBName.L == "*" + tableMatch := astTbl.TableName.L == tableAlias.TblName.L + + // Match query block names + // Use SelectOffset to match query blocks + qbMatch := true + if astTbl.QBName.L != "" { + expectedOffset := extractSelectOffset(astTbl.QBName.L) + if expectedOffset > 0 { + qbMatch = tableAlias.SelectOffset == expectedOffset + } else { + // If QBName cannot be parsed, ignore the QB match. + qbMatch = true + } + } + if dbMatch && tableMatch && qbMatch { + newPlans := append(plans[:i], plans[i+1:]...) + return joinGroup, newPlans, true + } + } + } + + // Step 2: Match by query-block alias (subquery name) + // Only execute this step if no direct table name match was found + matchIdx := -1 + for i, joinGroup := range plans { + plan := getPlan(joinGroup) + blockOffset := plan.QueryBlockOffset() + if blockOffset > 1 && blockOffset < len(queryBlockNames) { + blockName := queryBlockNames[blockOffset] + dbMatch := astTbl.DBName.L == "" || astTbl.DBName.L == blockName.DBName.L + tableMatch := astTbl.TableName.L == blockName.TableName.L + if dbMatch && tableMatch { + if matchIdx != -1 { + intest.Assert(false, "leading subquery alias matches multiple join groups") + return zero, plans, false + } + matchIdx = i + } + } + } + if matchIdx != -1 { + // take the matched plan before slice manipulation. `append(plans[:matchIdx], ...)` + // may overwrite `plans[matchIdx]` due to shared backing arrays. + matched := plans[matchIdx] + newPlans := append(plans[:matchIdx], plans[matchIdx+1:]...) + return matched, newPlans, true + } + + return zero, plans, false +} + +// extract the number x from 'sel_x' +func extractSelectOffset(qbName string) int { + if strings.HasPrefix(qbName, "sel_") { + if offset, err := strconv.Atoi(qbName[4:]); err == nil { + return offset + } + } + return -1 +} + +// IsDerivedTableInLeadingHint checks if a plan node represents a derived table (subquery) +// that is explicitly referenced in the LEADING hint. +func IsDerivedTableInLeadingHint(p base.LogicalPlan, leadingHint *hint.PlanHints) bool { + if leadingHint == nil || leadingHint.LeadingList == nil { + return false + } + + // Get the query block names mapping to find derived table aliases + var queryBlockNames []ast.HintTable + names := p.SCtx().GetSessionVars().PlannerSelectBlockAsName.Load() + if names == nil { + return false + } + queryBlockNames = *names + + // Get the block offset of this plan node + blockOffset := p.QueryBlockOffset() + + // Only blockOffset values in [2, len(queryBlockNames)-1] can represent + // subqueries / derived tables. Offsets 0 and 1 are typically main query + // or CTE, and offsets beyond the end of queryBlockNames are invalid. + if blockOffset <= 1 || blockOffset >= len(queryBlockNames) { + return false + } + + // Get the alias name of this derived table + derivedTableAlias := queryBlockNames[blockOffset].TableName.L + if derivedTableAlias == "" { + return false + } + derivedDBName := queryBlockNames[blockOffset].DBName.L + + // Check if this alias appears in the LEADING hint + return containsTableInLeadingList(leadingHint.LeadingList, derivedDBName, derivedTableAlias) +} + +// containsTableInLeadingList recursively searches for a table name in the LEADING hint structure +func containsTableInLeadingList(leadingList *ast.LeadingList, dbName, tableName string) bool { + if leadingList == nil { + return false + } + + for _, item := range leadingList.Items { + switch element := item.(type) { + case *ast.HintTable: + // Direct table reference in LEADING hint + dbMatch := element.DBName.L == "" || element.DBName.L == dbName || element.DBName.L == "*" + tableMatch := element.TableName.L == tableName + if dbMatch && tableMatch { + return true + } + case *ast.LeadingList: + // Nested structure, recursively check + if containsTableInLeadingList(element, dbName, tableName) { + return true + } + } + } + + return false +} + +// SetNewJoinWithHint sets the join method hint for the join node. +func SetNewJoinWithHint(newJoin *logicalop.LogicalJoin, vertexHints map[int]*JoinMethodHint) { + if newJoin == nil { + return + } + lChild := newJoin.Children()[0] + rChild := newJoin.Children()[1] + if joinMethodHint, ok := vertexHints[lChild.ID()]; ok { + newJoin.LeftPreferJoinType = joinMethodHint.PreferJoinMethod + newJoin.HintInfo = joinMethodHint.HintInfo + } + if joinMethodHint, ok := vertexHints[rChild.ID()]; ok { + newJoin.RightPreferJoinType = joinMethodHint.PreferJoinMethod + newJoin.HintInfo = joinMethodHint.HintInfo + } + newJoin.SetPreferredJoinType() +} diff --git a/pkg/planner/core/operator/logicalop/logical_projection.go b/pkg/planner/core/operator/logicalop/logical_projection.go index f2f930f2df7fe..10d418b6748df 100644 --- a/pkg/planner/core/operator/logicalop/logical_projection.go +++ b/pkg/planner/core/operator/logicalop/logical_projection.go @@ -673,3 +673,14 @@ func canProjectionBeEliminatedLoose(p *LogicalProjection) bool { } return true } + +// InjectExpr injects the expr into a projection above p, and returns the new projection and the new column. +func InjectExpr(p base.LogicalPlan, expr expression.Expression) (base.LogicalPlan, *expression.Column) { + proj, ok := p.(*LogicalProjection) + if !ok { + proj = LogicalProjection{Exprs: expression.Column2Exprs(p.Schema().Columns)}.Init(p.SCtx(), p.QueryBlockOffset()) + proj.SetSchema(p.Schema().Clone()) + proj.SetChildren(p) + } + return proj, proj.AppendExpr(expr) +} diff --git a/pkg/planner/core/plan_cost_ver2.go b/pkg/planner/core/plan_cost_ver2.go index cc8e8552951bf..37c54ba7133e0 100644 --- a/pkg/planner/core/plan_cost_ver2.go +++ b/pkg/planner/core/plan_cost_ver2.go @@ -578,8 +578,8 @@ func (p *PhysicalMergeJoin) GetPlanCostVer2(taskType property.TaskType, option * filterCost := costusage.SumCostVer2(filterCostVer2(option, leftRows, p.LeftConditions, cpuFactor), filterCostVer2(option, rightRows, p.RightConditions, cpuFactor), filterCostVer2(option, leftRows+rightRows, p.OtherConditions, cpuFactor)) // OtherConditions are applied to both sides - groupCost := costusage.SumCostVer2(groupCostVer2(option, leftRows, cols2Exprs(p.LeftJoinKeys), cpuFactor), - groupCostVer2(option, rightRows, cols2Exprs(p.RightJoinKeys), cpuFactor)) + groupCost := costusage.SumCostVer2(groupCostVer2(option, leftRows, expression.Column2Exprs(p.LeftJoinKeys), cpuFactor), + groupCostVer2(option, rightRows, expression.Column2Exprs(p.RightJoinKeys), cpuFactor)) leftChildCost, err := p.Children()[0].GetPlanCostVer2(taskType, option) if err != nil { @@ -1206,11 +1206,3 @@ func getTableInfo(p base.PhysicalPlan) *model.TableInfo { return getTableInfo(x.Children()[0]) } } - -func cols2Exprs(cols []*expression.Column) []expression.Expression { - exprs := make([]expression.Expression, 0, len(cols)) - for _, c := range cols { - exprs = append(exprs, c) - } - return exprs -} diff --git a/pkg/planner/core/rule_join_reorder.go b/pkg/planner/core/rule_join_reorder.go index dd379c5bad169..c456c88f1cf8e 100644 --- a/pkg/planner/core/rule_join_reorder.go +++ b/pkg/planner/core/rule_join_reorder.go @@ -21,6 +21,7 @@ import ( "slices" "github.com/pingcap/tidb/pkg/expression" + "github.com/pingcap/tidb/pkg/planner/core/joinorder" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/planner/core/base" "github.com/pingcap/tidb/pkg/planner/core/operator/logicalop" @@ -38,7 +39,7 @@ import ( // For example: "InnerJoin(InnerJoin(a, b), LeftJoin(c, d))" // results in a join group {a, b, c, d}. func extractJoinGroup(p base.LogicalPlan) *joinGroupResult { - joinMethodHintInfo := make(map[int]*joinMethodHint) + joinMethodHintInfo := make(map[int]*joinorder.JoinMethodHint) var ( group []base.LogicalPlan joinOrderHintInfo []*h.PlanHints @@ -102,11 +103,11 @@ func extractJoinGroup(p base.LogicalPlan) *joinGroupResult { if isJoin && p.SCtx().GetSessionVars().EnableAdvancedJoinHint && join.PreferJoinType > uint(0) { // If the current join node has the join method hint, we should store the hint information and restore it when we have finished the join reorder process. if join.LeftPreferJoinType > uint(0) { - joinMethodHintInfo[join.Children()[0].ID()] = &joinMethodHint{join.LeftPreferJoinType, join.HintInfo} + joinMethodHintInfo[join.Children()[0].ID()] = &joinorder.JoinMethodHint{PreferJoinMethod: join.LeftPreferJoinType, HintInfo: join.HintInfo} leftHasHint = true } if join.RightPreferJoinType > uint(0) { - joinMethodHintInfo[join.Children()[1].ID()] = &joinMethodHint{join.RightPreferJoinType, join.HintInfo} + joinMethodHintInfo[join.Children()[1].ID()] = &joinorder.JoinMethodHint{PreferJoinMethod: join.RightPreferJoinType, HintInfo: join.HintInfo} rightHasHint = true } } @@ -296,7 +297,7 @@ func (s *JoinReOrderSolver) optimizeRecursive(ctx base.PlanContext, p base.Logic joinGroupNum := len(curJoinGroup) useGreedy := joinGroupNum > ctx.GetSessionVars().TiDBOptJoinReorderThreshold || !isSupportDP - leadingHintInfo, hasDiffLeadingHint := checkAndGenerateLeadingHint(joinOrderHintInfo) + leadingHintInfo, hasDiffLeadingHint := joinorder.CheckAndGenerateLeadingHint(joinOrderHintInfo) if hasDiffLeadingHint { ctx.GetSessionVars().StmtCtx.SetHintWarning( "We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid") @@ -331,18 +332,7 @@ func (s *JoinReOrderSolver) optimizeRecursive(ctx base.PlanContext, p base.Logic if err != nil { return nil, err } - schemaChanged := false - if len(p.Schema().Columns) != len(originalSchema.Columns) { - schemaChanged = true - } else { - for i, col := range p.Schema().Columns { - if !col.EqualColumn(originalSchema.Columns[i]) { - schemaChanged = true - break - } - } - } - if schemaChanged { + if !p.Schema().Equal(originalSchema) { proj := logicalop.LogicalProjection{ Exprs: expression.Column2Exprs(originalSchema.Columns), }.Init(p.SCtx(), p.QueryBlockOffset()) @@ -369,38 +359,6 @@ func (s *JoinReOrderSolver) optimizeRecursive(ctx base.PlanContext, p base.Logic return p, nil } -// checkAndGenerateLeadingHint used to check and generate the valid leading hint. -// We are allowed to use at most one leading hint in a join group. When more than one, -// all leading hints in the current join group will be invalid. -// For example: select /*+ leading(t3) */ * from (select /*+ leading(t1) */ t2.b from t1 join t2 on t1.a=t2.a) t4 join t3 on t4.b=t3.b -// The Join Group {t1, t2, t3} contains two leading hints includes leading(t3) and leading(t1). -// Although they are in different query blocks, they are conflicting. -// In addition, the table alias 't4' cannot be recognized because of the join group. -func checkAndGenerateLeadingHint(hintInfo []*h.PlanHints) (*h.PlanHints, bool) { - leadingHintNum := len(hintInfo) - var leadingHintInfo *h.PlanHints - hasDiffLeadingHint := false - if leadingHintNum > 0 { - leadingHintInfo = hintInfo[0] - // One join group has one leading hint at most. Check whether there are different join order hints. - for i := 1; i < leadingHintNum; i++ { - if hintInfo[i] != hintInfo[i-1] { - hasDiffLeadingHint = true - break - } - } - if hasDiffLeadingHint { - leadingHintInfo = nil - } - } - return leadingHintInfo, hasDiffLeadingHint -} - -type joinMethodHint struct { - preferredJoinMethod uint - joinMethodHintInfo *h.PlanHints -} - // basicJoinGroupInfo represents basic information for a join group in the join reorder process. type basicJoinGroupInfo struct { eqEdges []*expression.ScalarFunction @@ -409,7 +367,7 @@ type basicJoinGroupInfo struct { // `joinMethodHintInfo` is used to map the sub-plan's ID to the join method hint. // The sub-plan will join the join reorder process to build the new plan. // So after we have finished the join reorder process, we can reset the join method hint based on the sub-plan's ID. - joinMethodHintInfo map[int]*joinMethodHint + joinMethodHintInfo map[int]*joinorder.JoinMethodHint } type joinGroupResult struct { @@ -549,10 +507,10 @@ func (s *baseSingleGroupJoinOrderSolver) checkConnection(leftPlan, rightPlan bas _, isCol1 := newSf.GetArgs()[1].(*expression.Column) if !isCol0 || !isCol1 { if !isCol0 { - leftPlan, rCol = s.injectExpr(leftPlan, newSf.GetArgs()[0]) + leftPlan, rCol = logicalop.InjectExpr(leftPlan, newSf.GetArgs()[0]) } if !isCol1 { - rightPlan, lCol = s.injectExpr(rightPlan, newSf.GetArgs()[1]) + rightPlan, lCol = logicalop.InjectExpr(rightPlan, newSf.GetArgs()[1]) } leftNode, rightNode = leftPlan, rightPlan newSf = expression.NewFunctionInternal(s.ctx.GetExprCtx(), funcName, edge.GetStaticType(), @@ -565,16 +523,6 @@ func (s *baseSingleGroupJoinOrderSolver) checkConnection(leftPlan, rightPlan bas return } -func (*baseSingleGroupJoinOrderSolver) injectExpr(p base.LogicalPlan, expr expression.Expression) (base.LogicalPlan, *expression.Column) { - proj, ok := p.(*logicalop.LogicalProjection) - if !ok { - proj = logicalop.LogicalProjection{Exprs: cols2Exprs(p.Schema().Columns)}.Init(p.SCtx(), p.QueryBlockOffset()) - proj.SetSchema(p.Schema().Clone()) - proj.SetChildren(p) - } - return proj, proj.AppendExpr(expr) -} - // makeJoin build join tree for the nodes which have equal conditions to connect them. func (s *baseSingleGroupJoinOrderSolver) makeJoin(leftPlan, rightPlan base.LogicalPlan, eqEdges []*expression.ScalarFunction, joinType *joinTypeWithExtMsg, opt *optimizetrace.LogicalOptimizeOp) (base.LogicalPlan, []expression.Expression) { remainOtherConds := make([]expression.Expression, len(s.otherConds)) @@ -677,7 +625,7 @@ func (s *baseSingleGroupJoinOrderSolver) newCartesianJoin(lChild, rChild base.Lo }.Init(s.ctx, offset) join.SetSchema(expression.MergeSchema(lChild.Schema(), rChild.Schema())) join.SetChildren(lChild, rChild) - s.setNewJoinWithHint(join) + joinorder.SetNewJoinWithHint(join, s.joinMethodHintInfo) return join } @@ -704,23 +652,6 @@ func (s *baseSingleGroupJoinOrderSolver) newJoinWithEdges(lChild, rChild base.Lo return newJoin } -// setNewJoinWithHint sets the join method hint for the join node. -// Before the join reorder process, we split the join node and collect the join method hint. -// And we record the join method hint and reset the hint after we have finished the join reorder process. -func (s *baseSingleGroupJoinOrderSolver) setNewJoinWithHint(newJoin *logicalop.LogicalJoin) { - lChild := newJoin.Children()[0] - rChild := newJoin.Children()[1] - if joinMethodHint, ok := s.joinMethodHintInfo[lChild.ID()]; ok { - newJoin.LeftPreferJoinType = joinMethodHint.preferredJoinMethod - newJoin.HintInfo = joinMethodHint.joinMethodHintInfo - } - if joinMethodHint, ok := s.joinMethodHintInfo[rChild.ID()]; ok { - newJoin.RightPreferJoinType = joinMethodHint.preferredJoinMethod - newJoin.HintInfo = joinMethodHint.joinMethodHintInfo - } - newJoin.SetPreferredJoinType() -} - // calcJoinCumCost calculates the cumulative cost of the join node. func (*baseSingleGroupJoinOrderSolver) calcJoinCumCost(join base.LogicalPlan, lNode, rNode *jrNode) float64 { return join.StatsInfo().RowCount + lNode.cumCost + rNode.cumCost From e0485fa879f0bae52ff1ea8e4f10d4db6ada1b67 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Tue, 2 Jun 2026 15:14:57 +0800 Subject: [PATCH 04/25] fix Signed-off-by: guo-shaoge --- pkg/util/hint/hint.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/util/hint/hint.go b/pkg/util/hint/hint.go index 75543d014f67e..e70f0ba52ae48 100644 --- a/pkg/util/hint/hint.go +++ b/pkg/util/hint/hint.go @@ -550,6 +550,7 @@ type PlanHints struct { TiFlashTables []HintedTable // isolation_read_engines(xx=tiflash) TiKVTables []HintedTable // isolation_read_engines(xx=tikv) LeadingJoinOrder []HintedTable // leading + LeadingList *ast.LeadingList // leading recursive HJBuild []HintedTable // hash_join_build HJProbe []HintedTable // hash_join_probe NoIndexLookUpPushDown []HintedTable // no_index_lookup_pushdown @@ -778,6 +779,7 @@ func ParsePlanHints(hints []*ast.TableOptimizerHint, leadingJoinOrder []HintedTable hjBuildTables, hjProbeTables []HintedTable leadingHintCnt int + leadingList *ast.LeadingList ) for _, hint := range hints { // Set warning for the hint that requires the table name. @@ -926,6 +928,12 @@ func ParsePlanHints(hints []*ast.TableOptimizerHint, case HintLeading: if leadingHintCnt == 0 { leadingJoinOrder = append(leadingJoinOrder, tableNames2HintTableInfo(currentDB, hint.HintName.L, hint.Tables, hintProcessor, currentLevel, warnHandler)...) + // get LeadingList + if hint.HintData != nil { + if list, ok := hint.HintData.(*ast.LeadingList); ok { + leadingList = list + } + } } leadingHintCnt++ case HintSemiJoinRewrite: @@ -972,6 +980,7 @@ func ParsePlanHints(hints []*ast.TableOptimizerHint, PreferLimitToCop: preferLimitToCop, CTEMerge: cteMerge, LeadingJoinOrder: leadingJoinOrder, + LeadingList: leadingList, HJBuild: hjBuildTables, HJProbe: hjProbeTables, NoIndexLookUpPushDown: noIndexLookUpPushDownTables, From e76f723f9f1308270c97229d38b8d4daff41f319 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Tue, 2 Jun 2026 16:02:24 +0800 Subject: [PATCH 05/25] planner: fix join reorder correctness with conflict detection algorithm Signed-off-by: guo-shaoge --- pkg/planner/core/casetest/rule/BUILD.bazel | 1 + pkg/planner/core/casetest/rule/main_test.go | 5 + .../rule/rule_cdc_join_reorder_test.go | 82 ++ .../testdata/cdc_join_reorder_suite_in.json | 247 ++++ .../testdata/cdc_join_reorder_suite_out.json | 1207 +++++++++++++++++ .../testdata/cdc_join_reorder_suite_xut.json | 1207 +++++++++++++++++ pkg/planner/core/joinorder/BUILD.bazel | 26 +- .../core/joinorder/bitset_bench_test.go | 186 +++ .../core/joinorder/conflict_detector.go | 963 +++++++++++++ pkg/planner/core/joinorder/join_order.go | 605 +++++++++ .../core/operator/logicalop/logical_join.go | 12 + pkg/planner/core/rule_join_reorder.go | 7 + 12 files changed, 4546 insertions(+), 2 deletions(-) create mode 100644 pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go create mode 100644 pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json create mode 100644 pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json create mode 100644 pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json create mode 100644 pkg/planner/core/joinorder/bitset_bench_test.go create mode 100644 pkg/planner/core/joinorder/conflict_detector.go create mode 100644 pkg/planner/core/joinorder/join_order.go diff --git a/pkg/planner/core/casetest/rule/BUILD.bazel b/pkg/planner/core/casetest/rule/BUILD.bazel index 05152fed4cd66..9117e06be03d7 100644 --- a/pkg/planner/core/casetest/rule/BUILD.bazel +++ b/pkg/planner/core/casetest/rule/BUILD.bazel @@ -5,6 +5,7 @@ go_test( timeout = "short", srcs = [ "main_test.go", + "rule_cdc_join_reorder_test.go", "rule_derive_topn_from_window_test.go", "rule_eliminate_projection_test.go", "rule_inject_extra_projection_test.go", diff --git a/pkg/planner/core/casetest/rule/main_test.go b/pkg/planner/core/casetest/rule/main_test.go index a2f34998b00c4..e310168ada0c4 100644 --- a/pkg/planner/core/casetest/rule/main_test.go +++ b/pkg/planner/core/casetest/rule/main_test.go @@ -34,6 +34,7 @@ func TestMain(m *testing.M) { testDataMap.LoadTestSuiteData("testdata", "join_reorder_suite") testDataMap.LoadTestSuiteData("testdata", "predicate_pushdown_suite") testDataMap.LoadTestSuiteData("testdata", "predicate_simplification") + testDataMap.LoadTestSuiteData("testdata", "cdc_join_reorder_suite") opts := []goleak.Option{ goleak.IgnoreTopFunction("github.com/golang/glog.(*fileSink).flushDaemon"), goleak.IgnoreTopFunction("github.com/bazelbuild/rules_go/go/tools/bzltestutil.RegisterTimeoutHandler.func1"), @@ -71,3 +72,7 @@ func GetPredicatePushdownSuiteData() testdata.TestData { func GetPredicateSimplificationSuiteData() testdata.TestData { return testDataMap["predicate_simplification"] } + +func GetCDCJoinReorderSuiteData() testdata.TestData { + return testDataMap["cdc_join_reorder_suite"] +} diff --git a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go new file mode 100644 index 0000000000000..51892bf4f27f5 --- /dev/null +++ b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go @@ -0,0 +1,82 @@ +// Copyright 2026 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package rule + +import ( + "testing" + + "github.com/pingcap/tidb/pkg/testkit" + "github.com/pingcap/tidb/pkg/testkit/testdata" + "github.com/pingcap/tidb/pkg/testkit/testfailpoint" + "github.com/stretchr/testify/require" +) + +func TestCDCJoinReorder(tt *testing.T) { + testkit.RunTestUnderCascades(tt, func(t *testing.T, tk *testkit.TestKit, cascades, caller string) { + tk.MustExec("use test") + tk.MustExec("drop table if exists t1, t2, t3, t4, t5") + tk.MustExec("CREATE TABLE t1 (a INT, b INT)") + tk.MustExec("CREATE TABLE t2 (a INT, b INT)") + tk.MustExec("CREATE TABLE t3 (a INT, b INT)") + tk.MustExec("CREATE TABLE t4 (a INT, b INT)") + tk.MustExec("CREATE TABLE t5 (a INT, b INT)") + + tk.MustExec("INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30)") + tk.MustExec("INSERT INTO t2 VALUES (1, 100), (2, 200), (4, 400)") + tk.MustExec("INSERT INTO t3 VALUES (1, 1000), (3, 3000), (5, 5000)") + tk.MustExec("INSERT INTO t4 VALUES (1, 10000), (4, 40000), (6, 60000)") + tk.MustExec("INSERT INTO t5 VALUES (2, 20000), (5, 50000), (7, 70000)") + + tk.MustExec("analyze table t1 all columns;") + tk.MustExec("analyze table t2 all columns;") + tk.MustExec("analyze table t3 all columns;") + tk.MustExec("analyze table t4 all columns;") + tk.MustExec("analyze table t5 all columns;") + + var input []string + var output []struct { + SQL string + Plan []string + Result []string + } + suite := GetCDCJoinReorderSuiteData() + suite.LoadTestCases(t, &input, &output, cascades, caller) + + // Phase 1: Collect expected results using the old join reorder algorithm + // (CD-C is NOT enabled yet). These serve as the ground-truth baseline. + expectedResults := make([][]string, len(input)) + for i, sql := range input { + expectedResults[i] = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + } + + // Phase 2: Enable CD-C algorithm, then verify both the plan and the + // result correctness for every case. + testfailpoint.Enable(t, "github.com/pingcap/tidb/pkg/planner/core/enableCDCJoinReorder", `return(true)`) + + for i, sql := range input { + testdata.OnRecord(func() { + output[i].SQL = sql + output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN FORMAT='plan_tree' " + sql).Rows()) + output[i].Result = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + }) + tk.MustQuery("EXPLAIN FORMAT='plan_tree' " + sql).Check(testkit.Rows(output[i].Plan...)) + + // Run with CD-C and cross-validate against the old algorithm baseline. + cdcResult := testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + require.Equalf(t, expectedResults[i], cdcResult, + "CD-C result differs from old algorithm for case[%d]: %s", i, sql) + } + }) +} diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json new file mode 100644 index 0000000000000..b166c3b8fb820 --- /dev/null +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json @@ -0,0 +1,247 @@ +[ + { + "name": "TestCDCJoinReorder", + "cases": [ + // ============================================= + // Group 1: Inner join reorder (baseline) + // ============================================= + + // 3-table inner join + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // 4-table inner join + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + + // ============================================= + // Group 2: LEFT JOIN + INNER JOIN + // ============================================= + + // assoc(inner, left) = 1: (t1 INNER t2) LEFT t3 + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", + // assoc(left, inner) = 0: (t1 LEFT t2) INNER t3 on t1.a = t3.a + // A conflict rule should be added to prevent incorrect reorder. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", + // leftAsscom(left, inner) = 1: (t1 LEFT t2) INNER t3 on t2.a = t3.a + // leftAsscom allows reorder when the inner join condition references the right side of the left join. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a, t3.a", + + // ============================================= + // Group 3: RIGHT JOIN + INNER JOIN + // ============================================= + + // assoc(right, inner) = 1: (t1 RIGHT t2) INNER t3 + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + // assoc(inner, right) = 0: (t1 INNER t2) RIGHT t3 + // A conflict rule prevents incorrect reorder. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", + + // ============================================= + // Group 4: Nested LEFT JOINs + // ============================================= + + // assoc(left, left) = 1: (t1 LEFT t2) LEFT t3 on t2.a = t3.a + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // leftAsscom(left, left) = 1: (t1 LEFT t2) LEFT t3 on t1.a = t3.a + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t1.a", + + // ============================================= + // Group 5: Nested RIGHT JOINs + // ============================================= + + // assoc(right, right) = 1: (t1 RIGHT t2) RIGHT t3 on t2.a = t3.a + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", + + // ============================================= + // Group 6: LEFT + RIGHT mixed + // ============================================= + + // assoc(right, left) = 1: (t1 RIGHT t2) LEFT t3 on t2.a = t3.a + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t2.a", + // assoc(left, right) = 0: (t1 LEFT t2) RIGHT t3 on t1.a = t3.a + // Conflict rule should prevent incorrect reorder. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t1.a = t3.a ORDER BY t3.a", + + // ============================================= + // Group 7: rightAsscom(right, left) = 1 + // ============================================= + + // rightAsscom(right, left) = 1: t1 RIGHT (t2 LEFT t3) + // In SQL: t2 LEFT t3 is a subgroup; t1 RIGHT JOIN that. + // We write it as: t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a + // Parse tree: (t1 RIGHT t2) LEFT t3 + // Use a different structure to test rightAsscom: + // t2 LEFT t3 ON t2.a = t3.a, then t1 RIGHT t2 ON t1.b = t2.b + // This is achieved via: t1 RIGHT JOIN (t2 LEFT JOIN t3 ON t2.a = t3.a) ON t1.a = t2.a + // But MySQL syntax doesn't allow this directly. Use: + "SELECT * FROM t2 LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t1 ON t2.a = t1.a ORDER BY t1.a", + + // ============================================= + // Group 8: Complex 4-table mixed outer joins + // ============================================= + + // LEFT + INNER + LEFT: (t1 LEFT t2) INNER t3 LEFT t4 + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + // RIGHT + INNER + RIGHT: (t1 RIGHT t2) INNER t3 RIGHT t4 + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + // INNER + LEFT + RIGHT: t1 INNER t2 LEFT t3 RIGHT t4 + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + + // ============================================= + // Group 9: All inner join with more complex conditions + // ============================================= + + // Inner join with multiple conditions + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // Inner join chain with different join columns + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a, t2.a, t3.a", + + // ============================================= + // Group 10: Join-condition orientation and filters + // ============================================= + + // Reversed equality orientation to exercise eq condition alignment. + "SELECT * FROM t1 JOIN t2 ON t2.a = t1.a JOIN t3 ON t3.a = t2.a ORDER BY t1.a", + // Inner join with one-side filter in ON condition. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t2.b > 150 JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", + // Degenerate predicate (single-side reference) + normal edge. + "SELECT * FROM t1 JOIN t2 ON t1.b > 15 JOIN t3 ON t2.a = t3.a WHERE t1.a = 3 ORDER BY t2.a, t3.a", + // Cross-style inner join with join predicate in WHERE. + "SELECT * FROM t1 JOIN t2 JOIN t3 ON t2.a = t3.a WHERE t1.a = t2.a ORDER BY t1.a", + + // ============================================= + // Group 11: Reorder barriers and fallback paths + // ============================================= + + // Null-safe equality should stop join-group expansion. + "SELECT * FROM t1 JOIN t2 ON t1.a <=> t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // STRAIGHT_JOIN should preserve explicit order. + "SELECT * FROM t1 STRAIGHT_JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // Non-equi LEFT JOIN should not be reordered as non-inner edge. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a < t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t2.a, t3.a", + // Non-equi RIGHT JOIN should not be reordered as non-inner edge. + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a < t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + + // ============================================= + // Group 12: Parenthesized/derived join groups + // ============================================= + + // Explicit parenthesized mixed joins. + "SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) JOIN (t3 JOIN t4 ON t3.a = t4.a) ON t1.a = t3.a ORDER BY t1.a, t3.a", + // Right join over an explicit sub-join. + "SELECT * FROM t1 RIGHT JOIN (t2 LEFT JOIN t3 ON t2.a = t3.a) ON t1.a = t2.a ORDER BY t2.a, t1.a", + // Derived-table leafs inside join reorder. + "SELECT * FROM (SELECT a, b FROM t1 WHERE a <= 3) x JOIN (SELECT a, b FROM t2 WHERE a <= 2) y ON x.a = y.a JOIN t3 ON y.a = t3.a ORDER BY x.a", + // Mixed outer chain with one-side outer condition. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t2.b > 150 LEFT JOIN t3 ON t1.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a, t4.a", + + // ============================================= + // Group 13: 5-table joins + // ============================================= + + // 5-table inner join chain. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + // 5-table mixed: INNER + LEFT + INNER + RIGHT. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a JOIN t4 ON t1.a = t4.a RIGHT JOIN t5 ON t4.a = t5.a ORDER BY t5.a", + // 5-table all LEFT JOINs. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a LEFT JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + + // ============================================= + // Group 14: Deep outer join chains (4-table) + // ============================================= + + // 4 consecutive LEFT JOINs: assoc(left,left) exercised at each level. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + // 4 consecutive RIGHT JOINs: assoc(right,right) exercised at each level. + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + + // ============================================= + // Group 15: Alternating join type patterns + // ============================================= + + // LEFT-RIGHT-LEFT alternating: conflict rules from mixed joins interact. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t3.a", + // RIGHT-LEFT-RIGHT alternating: another direction of mixed chain. + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + + // ============================================= + // Group 16: WHERE clause interaction with outer joins + // ============================================= + + // WHERE filter on preserved side of 3-table LEFT JOIN chain. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 ORDER BY t1.a", + // WHERE IS NULL filter: preserves outer join semantics (anti-join pattern). + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a WHERE t2.a IS NULL ORDER BY t1.a", + // WHERE on null-extended side may convert LEFT to INNER before reorder. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a WHERE t2.b > 100 ORDER BY t1.a", + + // ============================================= + // Group 17: Self-joins + // ============================================= + + // Self inner join: same table joined with itself. + "SELECT * FROM t1 x JOIN t1 y ON x.a = y.b ORDER BY x.a, y.a", + // Self left join + another table: CD-C must track distinct vertex IDs. + "SELECT * FROM t1 x LEFT JOIN t1 y ON x.a = y.b JOIN t2 ON x.a = t2.a ORDER BY x.a, t2.a", + + // ============================================= + // Group 18: Compound ON conditions for non-inner edges + // ============================================= + + // LEFT JOIN with multiple ON conditions + INNER. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", + // RIGHT JOIN with multiple ON conditions + INNER. + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + + // ============================================= + // Group 19: leftAsscom/rightAsscom = 0 specific cases + // ============================================= + + // leftAsscom(right, left) = 0: (t1 RIGHT t2) LEFT t3 ON t1.a = t3.a. + // The LEFT join references the inner side of the RIGHT join. + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t2.a", + // leftAsscom(right, inner) = 0: (t1 RIGHT t2) INNER t3 ON t1.a = t3.a. + // The INNER join references the inner side of the RIGHT join. + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t2.a, t3.a", + // rightAsscom(left, inner) = 0: t1 LEFT (t2 INNER t3). + // Achieved via t2 JOIN t3 ON t2.a = t3.a LEFT JOIN t1 ON t1.a = t2.a, then reversed. + "SELECT * FROM t2 JOIN t3 ON t2.a = t3.a LEFT JOIN t1 ON t1.a = t3.a ORDER BY t2.a", + + // ============================================= + // Group 20: Aggregation and LIMIT on top of join reorder + // ============================================= + + // GROUP BY after 3-table mixed join. + "SELECT t1.a, COUNT(*) FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a GROUP BY t1.a ORDER BY t1.a", + // LIMIT after 3-table inner join. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a LIMIT 2", + + // ============================================= + // Group 21: Semi/Anti join as join-group barriers + // ============================================= + + // EXISTS subquery becomes semi join, forms a barrier for join group expansion. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", + // NOT EXISTS subquery becomes anti join. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", + // IN subquery becomes semi join. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE t1.a IN (SELECT a FROM t3) ORDER BY t1.a", + + // ============================================= + // Group 22: Join with OR and complex predicates + // ============================================= + + // Inner join with OR in WHERE. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 OR t2.b > 150 ORDER BY t1.a", + // Left join with compound predicate in ON. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND (t2.b > 100 OR t2.b < 50) JOIN t3 ON t1.a = t3.a ORDER BY t1.a", + + // ============================================= + // Group 23: Cross join columns (join on column b) + // ============================================= + + // Join on column b instead of a. + "SELECT * FROM t1 JOIN t2 ON t1.b = t2.b LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", + // Mixed columns: a for one edge, b for another. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a" + ] + } +] diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json new file mode 100644 index 0000000000000..d0dd4dfcd3050 --- /dev/null +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json @@ -0,0 +1,1207 @@ +[ + { + "Name": "TestCDCJoinReorder", + "Cases": [ + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + " 3 3000", + " 5 5000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + " 3 3000", + " 5 5000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:TableFullScan", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + " 4 400 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t1.a = t3.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "3 30 3 3000", + " 5 5000" + ] + }, + { + "SQL": "SELECT * FROM t2 LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t1 ON t2.a = t1.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t1.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t2.a, test.t3.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 100 1 1000 1 10", + "2 200 2 20", + " 3 30" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + "3 30 3 3000 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a, t2.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.b))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t2.a = t1.a JOIN t3 ON t3.a = t2.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t2.b > 150 JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b > 15 JOIN t3 ON t2.a = t3.a WHERE t1.a = 3 ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root CARTESIAN inner join", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] eq(test.t1.a, 3), gt(test.t1.b, 15)", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan cop[tikv] table:t2 keep order:false" + ], + "Result": [ + "3 30 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 JOIN t3 ON t2.a = t3.a WHERE t1.a = t2.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a <=> t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin(Build) root inner join, equal:[nulleq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 STRAIGHT_JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a < t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t2.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a, test.t3.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root CARTESIAN left outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 2 200 1 1000", + "1 10 4 400 1 1000", + "3 30 4 400 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a < t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root CARTESIAN right outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + " 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) JOIN (t3 JOIN t4 ON t3.a = t4.a) ON t1.a = t3.a ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN (t2 LEFT JOIN t3 ON t2.a = t3.a) ON t1.a = t2.a ORDER BY t2.a, t1.a", + "Plan": [ + "Sort root test.t2.a, test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:TableFullScan", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + " 4 400 " + ] + }, + { + "SQL": "SELECT * FROM (SELECT a, b FROM t1 WHERE a <= 3) x JOIN (SELECT a, b FROM t2 WHERE a <= 2) y ON x.a = y.a JOIN t3 ON y.a = t3.a ORDER BY x.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] le(test.t2.a, 2), le(test.t2.a, 3), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] le(test.t1.a, 2), le(test.t1.a, 3), not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t2.b > 150 LEFT JOIN t3 ON t1.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a, t4.a", + "Plan": [ + "Sort root test.t1.a, test.t4.a", + "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a JOIN t4 ON t1.a = t4.a RIGHT JOIN t5 ON t4.a = t5.a ORDER BY t5.a", + "Plan": [ + "Sort root test.t5.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + " 2 20000", + " 5 50000", + " 7 70000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a LEFT JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000 ", + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 3 3000 ", + " 5 5000 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t1.b, 10)", + " │ │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a WHERE t2.a IS NULL ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:Projection, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─Projection(Probe) root test.t1.a, test.t1.b, ->test.t2.a, ->test.t2.b", + " └─HashJoin root anti semi join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a WHERE t2.b > 100 ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t2.b, 100), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 x JOIN t1 y ON x.a = y.b ORDER BY x.a, y.a", + "Plan": [ + "Sort root test.t1.a, test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan cop[tikv] table:y keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:x keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 x LEFT JOIN t1 y ON x.a = y.b JOIN t2 ON x.a = t2.a ORDER BY x.a, t2.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan cop[tikv] table:y keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:x keep order:false" + ], + "Result": [ + "1 10 1 100", + "2 20 2 200" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:gt(test.t1.b, test.t2.b)", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + " 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:TableFullScan", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + " 4 400 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t2 JOIN t3 ON t2.a = t3.a LEFT JOIN t1 ON t1.a = t3.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan cop[tikv] table:t2 keep order:false" + ], + "Result": [ + "1 100 1 1000 1 10" + ] + }, + { + "SQL": "SELECT t1.a, COUNT(*) FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a GROUP BY t1.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, Column", + " └─HashAgg root group by:test.t1.a, funcs:count(1)->Column, funcs:firstrow(test.t1.a)->test.t1.a", + " └─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 1", + "2 1" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a LIMIT 2", + "Plan": [ + "TopN root test.t1.a, offset:0, count:2", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root anti semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "2 20 2 200" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE t1.a IN (SELECT a FROM t3) ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashAgg(Build) root group by:test.t3.a, funcs:firstrow(test.t3.a)->test.t3.a", + " │ └─TableReader root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 OR t2.b > 150 ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:or(gt(test.t1.b, 10), gt(test.t2.b, 150))", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND (t2.b > 100 OR t2.b < 50) JOIN t3 ON t1.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), or(gt(test.t2.b, 100), lt(test.t2.b, 50))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 1000", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b = t2.b LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.b, test.t2.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.b))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.b))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 ", + "2 20 2 200 " + ] + } + ] + } +] diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json new file mode 100644 index 0000000000000..d0dd4dfcd3050 --- /dev/null +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json @@ -0,0 +1,1207 @@ +[ + { + "Name": "TestCDCJoinReorder", + "Cases": [ + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + " 3 3000", + " 5 5000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + " 3 3000", + " 5 5000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:TableFullScan", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + " 4 400 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t1.a = t3.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "3 30 3 3000", + " 5 5000" + ] + }, + { + "SQL": "SELECT * FROM t2 LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t1 ON t2.a = t1.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t1.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t2.a, test.t3.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 100 1 1000 1 10", + "2 200 2 20", + " 3 30" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + "3 30 3 3000 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a, t2.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.b))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t2.a = t1.a JOIN t3 ON t3.a = t2.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t2.b > 150 JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b > 15 JOIN t3 ON t2.a = t3.a WHERE t1.a = 3 ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root CARTESIAN inner join", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] eq(test.t1.a, 3), gt(test.t1.b, 15)", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan cop[tikv] table:t2 keep order:false" + ], + "Result": [ + "3 30 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 JOIN t3 ON t2.a = t3.a WHERE t1.a = t2.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a <=> t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin(Build) root inner join, equal:[nulleq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 STRAIGHT_JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a < t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t2.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a, test.t3.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root CARTESIAN left outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 2 200 1 1000", + "1 10 4 400 1 1000", + "3 30 4 400 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a < t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root CARTESIAN right outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + " 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) JOIN (t3 JOIN t4 ON t3.a = t4.a) ON t1.a = t3.a ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN (t2 LEFT JOIN t3 ON t2.a = t3.a) ON t1.a = t2.a ORDER BY t2.a, t1.a", + "Plan": [ + "Sort root test.t2.a, test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:TableFullScan", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + " 4 400 " + ] + }, + { + "SQL": "SELECT * FROM (SELECT a, b FROM t1 WHERE a <= 3) x JOIN (SELECT a, b FROM t2 WHERE a <= 2) y ON x.a = y.a JOIN t3 ON y.a = t3.a ORDER BY x.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] le(test.t2.a, 2), le(test.t2.a, 3), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] le(test.t1.a, 2), le(test.t1.a, 3), not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t2.b > 150 LEFT JOIN t3 ON t1.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a, t4.a", + "Plan": [ + "Sort root test.t1.a, test.t4.a", + "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a JOIN t4 ON t1.a = t4.a RIGHT JOIN t5 ON t4.a = t5.a ORDER BY t5.a", + "Plan": [ + "Sort root test.t5.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + " 2 20000", + " 5 50000", + " 7 70000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a LEFT JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000 ", + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t3.a", + "Plan": [ + "Sort root test.t3.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 3 3000 ", + " 5 5000 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", + "Plan": [ + "Sort root test.t4.a", + "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + " 4 40000", + " 6 60000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t1.b, 10)", + " │ │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "2 20 2 200 ", + "3 30 " + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a WHERE t2.a IS NULL ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:Projection, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─Projection(Probe) root test.t1.a, test.t1.b, ->test.t2.a, ->test.t2.b", + " └─HashJoin root anti semi join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a WHERE t2.b > 100 ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] gt(test.t2.b, 100), not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 x JOIN t1 y ON x.a = y.b ORDER BY x.a, y.a", + "Plan": [ + "Sort root test.t1.a, test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan cop[tikv] table:y keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:x keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 x LEFT JOIN t1 y ON x.a = y.b JOIN t2 ON x.a = t2.a ORDER BY x.a, t2.a", + "Plan": [ + "Sort root test.t1.a, test.t2.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan cop[tikv] table:y keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:x keep order:false" + ], + "Result": [ + "1 10 1 100", + "2 20 2 200" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:gt(test.t1.b, test.t2.b)", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + " 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:TableFullScan", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "2 20 2 200 ", + " 4 400 " + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t2.a, t3.a", + "Plan": [ + "Sort root test.t2.a, test.t3.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t2 JOIN t3 ON t2.a = t3.a LEFT JOIN t1 ON t1.a = t3.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan cop[tikv] table:t2 keep order:false" + ], + "Result": [ + "1 100 1 1000 1 10" + ] + }, + { + "SQL": "SELECT t1.a, COUNT(*) FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a GROUP BY t1.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─Projection root test.t1.a, Column", + " └─HashAgg root group by:test.t1.a, funcs:count(1)->Column, funcs:firstrow(test.t1.a)->test.t1.a", + " └─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 1", + "2 1" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a LIMIT 2", + "Plan": [ + "TopN root test.t1.a, offset:0, count:2", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root anti semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "2 20 2 200" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE t1.a IN (SELECT a FROM t3) ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashAgg(Build) root group by:test.t3.a, funcs:firstrow(test.t3.a)->test.t3.a", + " │ └─TableReader root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 OR t2.b > 150 ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:or(gt(test.t1.b, 10), gt(test.t2.b, 150))", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND (t2.b > 100 OR t2.b < 50) JOIN t3 ON t1.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), or(gt(test.t2.b, 100), lt(test.t2.b, 50))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": [ + "1 10 1 1000", + "3 30 3 3000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b = t2.b LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.b, test.t2.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.b))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.b))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 ", + "2 20 2 200 " + ] + } + ] + } +] diff --git a/pkg/planner/core/joinorder/BUILD.bazel b/pkg/planner/core/joinorder/BUILD.bazel index af9d0ae09f67f..5a1e270a46a24 100644 --- a/pkg/planner/core/joinorder/BUILD.bazel +++ b/pkg/planner/core/joinorder/BUILD.bazel @@ -1,16 +1,38 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "joinorder", - srcs = ["util.go"], + srcs = [ + "conflict_detector.go", + "join_order.go", + "util.go", + ], importpath = "github.com/pingcap/tidb/pkg/planner/core/joinorder", visibility = ["//visibility:public"], deps = [ + "//pkg/expression", "//pkg/parser/ast", "//pkg/planner/core/base", "//pkg/planner/core/operator/logicalop", "//pkg/planner/util", "//pkg/util/hint", "//pkg/util/intest", + "//pkg/util/intset", + "//pkg/util/logutil", + "@com_github_cockroachdb_errors//:errors", + "@com_github_pingcap_errors//:errors", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "joinorder_test", + timeout = "short", + srcs = ["bitset_bench_test.go"], + embed = [":joinorder"], + flaky = True, + deps = [ + "//pkg/util/intset", + "@com_github_bits_and_blooms_bitset//:bitset", ], ) diff --git a/pkg/planner/core/joinorder/bitset_bench_test.go b/pkg/planner/core/joinorder/bitset_bench_test.go new file mode 100644 index 0000000000000..65d22979c8756 --- /dev/null +++ b/pkg/planner/core/joinorder/bitset_bench_test.go @@ -0,0 +1,186 @@ +// Copyright 2026 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package joinorder + +import ( + "fmt" + "testing" + + "github.com/bits-and-blooms/bitset" + "github.com/pingcap/tidb/pkg/util/intset" +) + +type joinorderBenchCase struct { + name string + nodeCount int + edgeCount int +} + +type edgeFast struct { + tes intset.FastIntSet + left intset.FastIntSet + right intset.FastIntSet + rules []ruleFast +} + +type ruleFast struct { + from intset.FastIntSet + to intset.FastIntSet +} + +type edgeBit struct { + tes *bitset.BitSet + left *bitset.BitSet + right *bitset.BitSet + rules []ruleBit +} + +type ruleBit struct { + from *bitset.BitSet + to *bitset.BitSet +} + +func buildFastSingleton(idx int) intset.FastIntSet { + return intset.NewFastIntSet(idx) +} + +func buildBitSingleton(idx int) *bitset.BitSet { + bs := bitset.New(uint(idx + 1)) + bs.Set(uint(idx)) + return bs +} + +func buildFastEdges(nodes []intset.FastIntSet, edgeCount int) []edgeFast { + edges := make([]edgeFast, 0, edgeCount) + n := len(nodes) + for i := 0; i < edgeCount; i++ { + l := i % n + r := (i*7 + 3) % n + if r == l { + r = (r + 1) % n + } + extra := (i*11 + 1) % n + if extra == l || extra == r { + extra = (extra + 2) % n + } + tes := nodes[l].Union(nodes[r]).Union(nodes[extra]) + left := nodes[l] + right := nodes[r] + rules := []ruleFast{ + {from: right, to: left}, + {from: left, to: right}, + } + edges = append(edges, edgeFast{tes: tes, left: left, right: right, rules: rules}) + } + return edges +} + +func buildBitEdges(nodes []*bitset.BitSet, edgeCount int) []edgeBit { + edges := make([]edgeBit, 0, edgeCount) + n := len(nodes) + for i := 0; i < edgeCount; i++ { + l := i % n + r := (i*7 + 3) % n + if r == l { + r = (r + 1) % n + } + extra := (i*11 + 1) % n + if extra == l || extra == r { + extra = (extra + 2) % n + } + tes := nodes[l].Union(nodes[r]).Union(nodes[extra]) + left := nodes[l] + right := nodes[r] + rules := []ruleBit{ + {from: right, to: left}, + {from: left, to: right}, + } + edges = append(edges, edgeBit{tes: tes, left: left, right: right, rules: rules}) + } + return edges +} + +func BenchmarkJoinOrderConflictDetectorOps(b *testing.B) { + cases := []joinorderBenchCase{ + {name: "n16_e32", nodeCount: 16, edgeCount: 32}, + {name: "n32_e64", nodeCount: 32, edgeCount: 64}, + {name: "n64_e128", nodeCount: 64, edgeCount: 128}, + {name: "n128_e256", nodeCount: 128, edgeCount: 256}, + } + + for _, c := range cases { + fastNodes := make([]intset.FastIntSet, 0, c.nodeCount) + bitNodes := make([]*bitset.BitSet, 0, c.nodeCount) + for i := 0; i < c.nodeCount; i++ { + fastNodes = append(fastNodes, buildFastSingleton(i)) + bitNodes = append(bitNodes, buildBitSingleton(i)) + } + + fastEdges := buildFastEdges(fastNodes, c.edgeCount) + bitEdges := buildBitEdges(bitNodes, c.edgeCount) + + b.Run(fmt.Sprintf("fastintset/conflict/%s", c.name), func(b *testing.B) { + var sink bool + b.ResetTimer() + for i := 0; i < b.N; i++ { + ok := true + for _, e := range fastEdges { + s := e.left.Union(e.right) + if !e.tes.SubsetOf(s) || !e.tes.Intersects(e.left) || !e.tes.Intersects(e.right) { + ok = false + } + if !e.left.Intersection(e.tes).SubsetOf(e.left) || !e.right.Intersection(e.tes).SubsetOf(e.right) { + ok = false + } + for _, r := range e.rules { + if r.from.Intersects(s) && !r.to.SubsetOf(s) { + ok = false + } + } + } + sink = ok + } + if sink { + _ = sink + } + }) + + b.Run(fmt.Sprintf("bitset/conflict/%s", c.name), func(b *testing.B) { + var sink bool + b.ResetTimer() + for i := 0; i < b.N; i++ { + ok := true + for _, e := range bitEdges { + s := e.left.Union(e.right) + if !s.IsSuperSet(e.tes) || e.tes.IntersectionCardinality(e.left) == 0 || e.tes.IntersectionCardinality(e.right) == 0 { + ok = false + } + if !e.left.IsSuperSet(e.left.Intersection(e.tes)) || !e.right.IsSuperSet(e.right.Intersection(e.tes)) { + ok = false + } + for _, r := range e.rules { + if r.from.IntersectionCardinality(s) > 0 && !s.IsSuperSet(r.to) { + ok = false + } + } + } + sink = ok + } + if sink { + _ = sink + } + }) + } +} diff --git a/pkg/planner/core/joinorder/conflict_detector.go b/pkg/planner/core/joinorder/conflict_detector.go new file mode 100644 index 0000000000000..32c8575f52a56 --- /dev/null +++ b/pkg/planner/core/joinorder/conflict_detector.go @@ -0,0 +1,963 @@ +// Copyright 2026 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package joinorder + +import ( + "maps" + + "github.com/pingcap/errors" + "github.com/pingcap/tidb/pkg/expression" + "github.com/pingcap/tidb/pkg/planner/core/base" + "github.com/pingcap/tidb/pkg/planner/core/operator/logicalop" + "github.com/pingcap/tidb/pkg/util/intset" +) + +// This file implements the CD-C (Conflict Detection C) algorithm +// from the paper: +// +// "On the Correct and Complete Enumeration of the Core Search Space" +// — Guido Moerkotte, Pit Fender, Marius Eich (2013) +// +// # Overview +// +// CD-C determines which join reorderings are semantically valid when outer joins +// (and semi/anti joins) are present. The key insight is that, unlike pure inner +// joins, outer joins are neither associative nor commutative in general. +// Rearranging them arbitrarily can change query results. +// +// # Core Concepts +// +// TES (Total Eligibility Set): +// +// For each join predicate (edge), the TES records which base relations must be +// present in a candidate subgraph for that predicate to be applicable. It starts +// as the SES (Syntactic Eligibility Set, i.e. the relations referenced by the +// predicate) and is extended by conflict rules. +// +// Conflict Rules: +// +// A conflict rule {from → to} states: "if any relation in `from` appears in a +// candidate join's input set S, then every relation in `to` must also appear in S." +// These rules are derived by checking, for each pair of a parent edge and a child +// edge, whether the three properties — associativity (assoc), left-asscom, and +// right-asscom — hold for their join-type combination. When a property does NOT +// hold, a conflict rule is generated to prevent the invalid reordering. +// +// Validity Check: +// +// When the join enumerator proposes connecting two subgraphs (S1, S2), each edge +// checks: (1) its TES is a subset of S1 ∪ S2, (2) it intersects both S1 and S2, +// and (3) all conflict rules are satisfied. Only then is the join considered valid. +// +// # Rule Tables +// +// The three rule tables (assocRuleTable, leftAsscomRuleTable, rightAsscomRuleTable) +// encode, for every pair of join types, whether the corresponding algebraic property +// holds. They are derived from Table 2 and Table 3 of the paper. Since TiDB does not +// support FULL OUTER JOIN, many conditional entries (requiring null-rejection checks) +// reduce to unconditional values. See the comments on each table for details. + +// ConflictDetector builds a join graph from the original plan tree and attaches +// conflict rules to each edge. It is then used by the join enumerator (greedy or +// DP) to validate candidate join pairs at enumeration time. +// +// # Workflow +// +// The lifecycle has two phases: +// +// Phase 1 — Build (called once per join group): +// +// Build() walks the plan tree bottom-up via buildRecursive(). At each join +// node it creates one or more edges: +// - Inner join: each conjunct becomes a separate edge (makeInnerEdge()), +// expanding the search space. +// - Non-inner join: all predicates stay in a single edge (makeNonInnerEdge()), +// keeping the join atomic. +// For every new edge, makeEdge() computes its TES(calcSES()) and generates conflict rules +// by comparing it against child edges from both subtrees. +// +// Phase 2 — CheckConnection (called repeatedly by the join enumerator): +// +// CheckConnection(node1, node2) iterates over all edges and tests whether +// each edge can validly connect the two nodes. The check differs by join kind: +// - Inner edge (checkInnerEdgeApplicable): TES ⊆ (S1 ∪ S2) and TES intersects both +// S1 and S2, plus all conflict rules pass. +// - Non-inner edge (checkNonInnerEdgeApplicable): additionally requires that the +// original left/right vertexes (intersected with TES) are fully contained +// in node1/node2 respectively, preserving outer-join side semantics. +// When edges pass, MakeJoin() constructs the actual LogicalJoin plan from the +// collected edges and returns a new merged Node. +type ConflictDetector struct { + ctx base.PlanContext + groupRoot base.LogicalPlan + groupVertexes []*Node + innerEdges []*edge + nonInnerEdges []*edge + allInnerJoin bool +} + +// edge represents a single join predicate (or a group of predicates for non-inner +// joins) in the join graph. Each edge knows its join type, conditions, the base +// relations it originally connects (leftVertexes, rightVertexes), its TES, and +// any conflict rules that constrain how it may be applied. +type edge struct { + idx uint64 + joinType logicalop.JoinType + eqConds []*expression.ScalarFunction + // nonEQConds holds otherCond, leftCond, or rightCond — anything that is not + // an equi-join predicate. + nonEQConds expression.CNFExprs + + // TES is the Total Eligibility Set: the set of base relations that must be + // present in the candidate subgraph for this edge to be applicable. + // For now, TES is totally same with SES, check the TODO in makeEdge(). + tes intset.FastIntSet + // rules are conflict rules {from → to} derived during Build. They encode + // reordering constraints imposed by non-assoc/l-asscom/r-asscom join-type combinations. + rules []*rule + // skipRules is true when the entire join group is inner-join-only, in which + // case conflict rules are unnecessary. + skipRules bool + + // leftEdges/rightEdges are the child edges from the left/right subtrees at + // build time. They are used to derive conflict rules for this edge. + leftEdges []*edge + rightEdges []*edge + leftVertexes intset.FastIntSet + rightVertexes intset.FastIntSet +} + +// TryCreateCartesianCheckResult creates a CheckConnectionResult representing a +// cartesian product between left and right nodes. +// +// When checkResult.Connected() returns false, there are actually two situations: +// 1. The two nodes are truly invalid to join (e.g. conflict rules forbid it). +// 2. The two nodes have no shared edge, but a cartesian join is still legal. +// +// checkResult.Connected() itself does not distinguish them — both return false. +// We can handle case 2 by adding a fallback "cross edge" when building the ConflictDetector, +// so that Connected() returns true. +// But for now, we take a simpler approach: checkResult.Connected() return false for above both situations, +// and let the caller explicitly call TryCreateCartesianCheckResult to construct a +// cartesian edge when the join group is all-inner-join. +// +// The cartesian edge is created in two situations (callers that pass allowNoEQ=true +// to checkConnectionAndMakeJoin): +// 1. A leading hint forces the connection (e.g. LEADING(R1, R3) when there is no +// predicate between R1 and R3). +// 2. The greedy enumerator's second pass, where allowing cartesian joins may find +// a better plan. See https://github.com/pingcap/tidb/issues/63290. +func (d *ConflictDetector) TryCreateCartesianCheckResult(left, right *Node) *CheckConnectionResult { + if !d.allInnerJoin { + return nil + } + cartesianEdge := d.makeEdge(logicalop.InnerJoin, []expression.Expression{}, left.bitSet, right.bitSet, nil, nil) + return &CheckConnectionResult{ + node1: left, + node2: right, + appliedInnerEdges: []*edge{cartesianEdge}, + hasEQCond: false, + } +} + +func (d *ConflictDetector) iterateEdges(fn func(e *edge) bool) { + for _, e := range d.innerEdges { + if !fn(e) { + return + } + } + for _, e := range d.nonInnerEdges { + if !fn(e) { + return + } + } +} + +// rule is a conflict rule {from → to}: if any relation in `from` appears in the +// candidate set S, then every relation in `to` must also appear in S. Violating +// this would produce a semantically invalid join reordering. +type rule struct { + from intset.FastIntSet + to intset.FastIntSet +} + +// Node represents either a leaf vertex (a single base relation) or an +// intermediate result (a join of two nodes). During enumeration, the greedy +// algorithm repeatedly merges two Nodes into one via MakeJoin(). +type Node struct { + // bitSet tracks which base relations (by index) are contained in this node. + bitSet intset.FastIntSet + p base.LogicalPlan + // cumCost is the cumulative cost (sum of row counts) of this node and all + // its descendants. It is used by the enumerator for join ordering. + cumCost float64 + // usedEdges records which edges have already been consumed by joins that + // produced this node. An edge must not be applied twice. + usedEdges map[uint64]struct{} +} + +func calcCumCost(p base.LogicalPlan) float64 { + cost := p.StatsInfo().RowCount + for _, child := range p.Children() { + cost += calcCumCost(child) + } + return cost +} + +func (n *Node) checkUsedEdges(edgeIdx uint64) bool { + _, used := n.usedEdges[edgeIdx] + return used +} + +func newConflictDetector(ctx base.PlanContext) *ConflictDetector { + return &ConflictDetector{ + ctx: ctx, + } +} + +// Build constructs the join graph (edges + conflict rules) from a joinGroup. +// It returns the list of leaf Nodes (vertexes) of current join group, which will be merged to new join by the enumerator. +func (d *ConflictDetector) Build(group *joinGroup) ([]*Node, error) { + d.groupRoot = group.root + d.allInnerJoin = group.allInnerJoin + + vertexMap := make(map[int]*Node, len(group.vertexes)) + for i, v := range group.vertexes { + if _, err := v.RecursiveDeriveStats(nil); err != nil { + return nil, err + } + vertexMap[v.ID()] = &Node{ + bitSet: intset.NewFastIntSet(i), + p: v, + cumCost: calcCumCost(v), + } + } + + if _, _, err := d.buildRecursive(group.root, vertexMap); err != nil { + return nil, err + } + return d.groupVertexes, nil +} + +// buildRecursive walks the plan tree bottom-up. For each join node, it: +// 1. Recurses into left and right children to collect their edges and vertex sets. +// 2. Creates new edge(s) for the current join operator. +// 3. Returns the accumulated edges and the union of all vertex sets seen so far. +// +// The returned edges list is used by parent calls to generate conflict rules. +func (d *ConflictDetector) buildRecursive(p base.LogicalPlan, vertexMap map[int]*Node) ([]*edge, intset.FastIntSet, error) { + if vertexNode, ok := vertexMap[p.ID()]; ok { + d.groupVertexes = append(d.groupVertexes, vertexNode) + return nil, vertexNode.bitSet, nil + } + + var curVertexes intset.FastIntSet + // All internal nodes in the join group should be join operators. + joinop, ok := p.(*logicalop.LogicalJoin) + if !ok { + return nil, intset.FastIntSet{}, errors.New("unexpected plan type in conflict detector") + } + + leftEdges, leftVertexes, err := d.buildRecursive(joinop.Children()[0], vertexMap) + if err != nil { + return nil, curVertexes, err + } + rightEdges, rightVertexes, err := d.buildRecursive(joinop.Children()[1], vertexMap) + if err != nil { + return nil, curVertexes, err + } + + var curEdges []*edge + if joinop.JoinType == logicalop.InnerJoin { + if curEdges, err = d.makeInnerEdge(joinop, leftVertexes, rightVertexes, leftEdges, rightEdges); err != nil { + return nil, curVertexes, err + } + } else { + curEdge, err := d.makeNonInnerEdge(joinop, leftVertexes, rightVertexes, leftEdges, rightEdges) + if err != nil { + return nil, curVertexes, err + } + curEdges = []*edge{curEdge} + } + if leftVertexes.Intersects(rightVertexes) { + return nil, curVertexes, errors.New("conflicting join edges detected") + } + curVertexes = leftVertexes.Union(rightVertexes) + + return append(leftEdges, append(rightEdges, curEdges...)...), curVertexes, nil +} + +// makeInnerEdge splits an inner join into one edge per conjunct (eq-cond or +// non-eq-cond). We can enlarges the search space by allowing each predicate +// to be applied independently. +// For example: (R1 INNER JOIN R2 on P12) INNER JOIN R3 on P13 and P23 +// By spliting the CNF join condition of INNER JOIN, R2 and R3 can also be connected using P23. +func (d *ConflictDetector) makeInnerEdge(joinop *logicalop.LogicalJoin, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge) (res []*edge, err error) { + if len(joinop.NAEQConditions) > 0 { + return nil, errors.New("NAEQConditions not supported in conflict detector yet") + } + + conds := expression.ScalarFuncs2Exprs(joinop.EqualConditions) + nonEQConds := make([]expression.Expression, 0, len(joinop.LeftConditions)+len(joinop.RightConditions)+len(joinop.OtherConditions)) + nonEQConds = append(nonEQConds, joinop.OtherConditions...) + nonEQConds = append(nonEQConds, joinop.LeftConditions...) + nonEQConds = append(nonEQConds, joinop.RightConditions...) + + if len(conds) == 0 && len(nonEQConds) == 0 { + tmp := d.makeEdge(logicalop.InnerJoin, []expression.Expression{}, leftVertexes, rightVertexes, leftEdges, rightEdges) + res = append(res, tmp) + } + + condArg := make([]expression.Expression, 1) + for _, cond := range conds { + condArg[0] = cond + tmp := d.makeEdge(logicalop.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp.eqConds = append(tmp.eqConds, cond.(*expression.ScalarFunction)) + res = append(res, tmp) + } + + for _, cond := range nonEQConds { + condArg[0] = cond + tmp := d.makeEdge(logicalop.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp.nonEQConds = append(tmp.nonEQConds, cond) + res = append(res, tmp) + } + return +} + +// makeNonInnerEdge creates a single edge for a non-inner join. Unlike inner +// joins, all predicates are kept together because outer/semi/anti joins are +// atomic — their predicates cannot be applied independently. +func (d *ConflictDetector) makeNonInnerEdge(joinop *logicalop.LogicalJoin, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge) (*edge, error) { + if len(joinop.NAEQConditions) > 0 { + return nil, errors.New("NAEQConditions not supported in conflict detector yet") + } + + nonEQConds := make([]expression.Expression, 0, len(joinop.LeftConditions)+len(joinop.RightConditions)+len(joinop.OtherConditions)) + nonEQConds = append(nonEQConds, joinop.LeftConditions...) + nonEQConds = append(nonEQConds, joinop.RightConditions...) + nonEQConds = append(nonEQConds, joinop.OtherConditions...) + + conds := expression.ScalarFuncs2Exprs(joinop.EqualConditions) + if len(conds) == 0 && len(nonEQConds) == 0 { + return d.makeEdge(joinop.JoinType, []expression.Expression{}, leftVertexes, rightVertexes, leftEdges, rightEdges), nil + } + + conds = append(conds, nonEQConds...) + + e := d.makeEdge(joinop.JoinType, conds, leftVertexes, rightVertexes, leftEdges, rightEdges) + e.eqConds = make([]*expression.ScalarFunction, len(joinop.EqualConditions)) + copy(e.eqConds, joinop.EqualConditions) + e.nonEQConds = nonEQConds + + return e, nil +} + +// makeEdge basically implements the pseudocode for CD-C in paper(Figure-11). +func (d *ConflictDetector) makeEdge(joinType logicalop.JoinType, conds []expression.Expression, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge) *edge { + e := &edge{ + // Each new edge is appended to either d.innerEdges or d.nonInnerEdges + // (see below), so their combined length before the append is the next + // available unique index. + idx: uint64(len(d.innerEdges) + len(d.nonInnerEdges)), + joinType: joinType, + leftVertexes: leftVertexes, + rightVertexes: rightVertexes, + leftEdges: leftEdges, + rightEdges: rightEdges, + skipRules: d.allInnerJoin, + } + + // The following implements the first part of the pseudocode for CD-C in the paper(Figure-11): + // calc the SES(Syntactic Eligibility Set) and init TES(Total Eligibility Set) as SES. + e.tes = d.calcSES(conds) + + // The following corresponds to the secion 6.2 in the paper(Cross Products and Degenerate Predicates). + // For degenerate predicates (only one side referenced), force TES to include + // both sides so the edge can't connect unrelated subsets. + if !e.tes.Intersects(e.leftVertexes) { + e.tes = e.tes.Union(e.leftVertexes) + } + if !e.tes.Intersects(e.rightVertexes) { + e.tes = e.tes.Union(e.rightVertexes) + } + + if joinType == logicalop.InnerJoin { + d.innerEdges = append(d.innerEdges, e) + } else { + d.nonInnerEdges = append(d.nonInnerEdges, e) + } + + // The following implements the conflict rule part of the pseudocode for CD-C in the paper(Figure-11). + // Conflict rules are generated by checking assoc / l-asscom / r-asscom for every + // (child, parent) edge pair. Skipped when all joins are inner joins, because + // inner joins are freely reorderable. + // + // TODO: Implement TES extension via conflict rules later. + // In the section 5.5 of the paper, TES will be extended by conflict rules. + // The current implementation does not do this step for now. + // We defer this because the greedy enumerator has a much smaller search space than DP, so the rule-check overhead is low. + if d.allInnerJoin { + return e + } + for _, child := range leftEdges { + if !assoc(child, e) { + e.rules = append(e.rules, rightToLeftRule(child)) + } + if !leftAsscom(child, e) { + e.rules = append(e.rules, leftToRightRule(child)) + } + } + for _, child := range rightEdges { + if !assoc(e, child) { + e.rules = append(e.rules, leftToRightRule(child)) + } + if !rightAsscom(e, child) { + e.rules = append(e.rules, rightToLeftRule(child)) + } + } + + return e +} + +// rightToLeftRule creates a conflict rule: if child's right vertexes appear in S, +// then child's left vertexes (or the subset intersecting TES) must also be in S. +// The name means "from right to left": the presence of right-side relations +// requires the presence of left-side relations. +func rightToLeftRule(child *edge) *rule { + rule := &rule{from: child.rightVertexes} + if child.leftVertexes.Intersects(child.tes) { + rule.to = child.leftVertexes.Intersection(child.tes) + } else { + rule.to = child.leftVertexes + } + return rule +} + +// leftToRightRule creates a conflict rule: if child's left vertexes appear in S, +// then child's right vertexes (or the subset intersecting TES) must also be in S. +// The name means "from left to right": the presence of left-side relations +// requires the presence of right-side relations. +func leftToRightRule(child *edge) *rule { + rule := &rule{from: child.leftVertexes} + if child.rightVertexes.Intersects(child.tes) { + rule.to = child.rightVertexes.Intersection(child.tes) + } else { + rule.to = child.rightVertexes + } + return rule +} + +func (d *ConflictDetector) calcSES(conds []expression.Expression) intset.FastIntSet { + var res intset.FastIntSet + for _, cond := range conds { + for _, node := range d.groupVertexes { + if expression.ExprReferenceSchema(cond, node.p.Schema()) { + res = res.Union(node.bitSet) + } + } + } + return res +} + +// joinTypeConvertTable maps logicalop.JoinType to indices used in rule tables. +var joinTypeConvertTable = []int{ + 0, // INNER + 1, // LEFT OUTER + 2, // RIGHT OUTER + 3, // LEFT SEMI + 4, // LEFT ANTI + 3, // LEFT OUTER SEMI + 4, // ANTI LEFT OUTER SEMI +} + +func assoc(e1, e2 *edge) bool { + j1 := joinTypeConvertTable[e1.joinType] + j2 := joinTypeConvertTable[e2.joinType] + return assocRuleTable[j1][j2] == 1 +} + +func leftAsscom(e1, e2 *edge) bool { + j1 := joinTypeConvertTable[e1.joinType] + j2 := joinTypeConvertTable[e2.joinType] + return leftAsscomRuleTable[j1][j2] == 1 +} + +func rightAsscom(e1, e2 *edge) bool { + j1 := joinTypeConvertTable[e1.joinType] + j2 := joinTypeConvertTable[e2.joinType] + return rightAsscomRuleTable[j1][j2] == 1 +} + +// CheckConnectionResult contains the result of checking connection between two nodes. +type CheckConnectionResult struct { + node1 *Node + node2 *Node + appliedInnerEdges []*edge + appliedNonInnerEdge *edge + hasEQCond bool +} + +// Connected checks if two nodes are connected. +func (r *CheckConnectionResult) Connected() bool { + return len(r.appliedInnerEdges) > 0 || r.appliedNonInnerEdge != nil +} + +// NoEQEdge checks if there is no EQ edge between two nodes. +func (r *CheckConnectionResult) NoEQEdge() bool { + return !r.hasEQCond +} + +// CheckConnection tests whether any edge can validly connect node1 and node2. +// It's corresponding to the pseudocode for APPLICABLE(b/c) in the paper(Figure-9). +// The basic idea is: It collects all applicable inner edges (there can be many) and at most one +// non-inner edge. The result is later passed to MakeJoin() to build the plan. +func (d *ConflictDetector) CheckConnection(node1, node2 *Node) (*CheckConnectionResult, error) { + if node1 == nil || node2 == nil { + return nil, errors.Errorf("nil node found in CheckConnection, node1: %v, node2: %v", node1, node2) + } + + result := &CheckConnectionResult{ + node1: node1, + node2: node2, + } + for _, e := range d.innerEdges { + if node1.checkUsedEdges(e.idx) || node2.checkUsedEdges(e.idx) { + continue + } + if e.checkInnerEdgeApplicable(node1, node2) { + result.appliedInnerEdges = append(result.appliedInnerEdges, e) + result.hasEQCond = result.hasEQCond || len(e.eqConds) > 0 + } + } + for _, e := range d.nonInnerEdges { + if node1.checkUsedEdges(e.idx) || node2.checkUsedEdges(e.idx) { + continue + } + if e.checkNonInnerEdgeApplicable(node1, node2) { + if result.appliedNonInnerEdge != nil { + return nil, errors.New("multiple non-inner edges applied between two nodes") + } + result.appliedNonInnerEdge = e + result.hasEQCond = result.hasEQCond || len(e.eqConds) > 0 + } + } + return result, nil +} + +// checkInnerEdgeApplicable validates that this inner edge can connect node1 and node2. +// For inner joins the two sides are symmetric, so we only require: +// - All conflict rules are satisfied. +// - TES ⊆ (S1 ∪ S2): all required relations are present. +// - TES ∩ S1 ≠ ∅ and TES ∩ S2 ≠ ∅: the edge truly connects both sides. +func (e *edge) checkInnerEdgeApplicable(node1, node2 *Node) bool { + if !e.skipRules && !e.checkRules(node1, node2) { + return false + } + return e.tes.SubsetOf(node1.bitSet.Union(node2.bitSet)) && + e.tes.Intersects(node1.bitSet) && + e.tes.Intersects(node2.bitSet) +} + +// checkNonInnerEdgeApplicable validates that this non-inner edge can connect node1 (left) +// and node2 (right). Beyond the inner-edge checks, it enforces side semantics: +// the original left vertexes (∩ TES) must land entirely in node1, and the +// original right vertexes (∩ TES) must land entirely in node2. This prevents +// the outer-join's preserved side from being split across the two inputs. +func (e *edge) checkNonInnerEdgeApplicable(node1, node2 *Node) bool { + if !e.skipRules && !e.checkRules(node1, node2) { + return false + } + return e.leftVertexes.Intersection(e.tes).SubsetOf(node1.bitSet) && + e.rightVertexes.Intersection(e.tes).SubsetOf(node2.bitSet) && + e.tes.Intersects(node1.bitSet) && + e.tes.Intersects(node2.bitSet) +} + +// checkRules verifies that all conflict rules are satisfied for the candidate +// set S = S1 ∪ S2. A rule {from → to} fails if from ∩ S ≠ ∅ but to ⊄ S. +func (e *edge) checkRules(node1, node2 *Node) bool { + s := node1.bitSet.Union(node2.bitSet) + for _, r := range e.rules { + if r.from.Intersects(s) && !r.to.SubsetOf(s) { + return false + } + } + return true +} + +// MakeJoin construct a join plan from the check result. +func (d *ConflictDetector) MakeJoin(checkResult *CheckConnectionResult, vertexHints map[int]*JoinMethodHint) (*Node, error) { + numInnerEdges := len(checkResult.appliedInnerEdges) + var numNonInnerEdges int + if checkResult.appliedNonInnerEdge != nil { + numNonInnerEdges = 1 + } + + var err error + var p base.LogicalPlan + var newJoin *logicalop.LogicalJoin + // Note that non-inner edges should be processed first then inner edges, + // because inner joins can be appended to existing non-inner join as selections. + if numNonInnerEdges > 0 { + if newJoin, err = makeNonInnerJoin(d.ctx, checkResult, vertexHints); err != nil { + return nil, err + } + } + if numInnerEdges > 0 { + if p, err = makeInnerJoin(d.ctx, checkResult, newJoin, vertexHints); err != nil { + return nil, err + } + } else { + p = newJoin + } + if p == nil { + return nil, errors.New("failed to make join plan") + } + if _, err := p.RecursiveDeriveStats(nil); err != nil { + return nil, err + } + + node1 := checkResult.node1 + node2 := checkResult.node2 + usedEdges := make(map[uint64]struct{}, numInnerEdges+numNonInnerEdges+len(node1.usedEdges)+len(node2.usedEdges)) + for _, e := range checkResult.appliedInnerEdges { + usedEdges[e.idx] = struct{}{} + } + if checkResult.appliedNonInnerEdge != nil { + usedEdges[checkResult.appliedNonInnerEdge.idx] = struct{}{} + } + maps.Copy(usedEdges, node1.usedEdges) + maps.Copy(usedEdges, node2.usedEdges) + return &Node{ + bitSet: node1.bitSet.Union(node2.bitSet), + p: p, + cumCost: calcCumCost(p), + usedEdges: usedEdges, + }, nil +} + +func alignEQConds(ctx base.PlanContext, left, right base.LogicalPlan, eqConds []*expression.ScalarFunction) (newLeft base.LogicalPlan, newRight base.LogicalPlan, alignedEQConds []*expression.ScalarFunction, err error) { + if len(eqConds) == 0 { + return left, right, nil, nil + } + res := make([]*expression.ScalarFunction, 0, len(eqConds)) + for _, cond := range eqConds { + args := cond.GetArgs() + if len(args) != 2 { + return nil, nil, nil, errors.Errorf("unexpected eq condition args: %d", len(args)) + } + if expression.ExprFromSchema(args[0], left.Schema()) && expression.ExprFromSchema(args[1], right.Schema()) { + res = append(res, cond) + continue + } + if expression.ExprFromSchema(args[1], left.Schema()) && expression.ExprFromSchema(args[0], right.Schema()) { + swapped, ok := expression.NewFunctionInternal(ctx.GetExprCtx(), cond.FuncName.L, cond.GetStaticType(), args[1], args[0]).(*expression.ScalarFunction) + if !ok { + return nil, nil, nil, errors.New("failed to build swapped eq condition") + } + _, isCol0 := swapped.GetArgs()[0].(*expression.Column) + _, isCol1 := swapped.GetArgs()[1].(*expression.Column) + if !isCol0 || !isCol1 { + lCol := swapped.GetArgs()[0] + rCol := swapped.GetArgs()[1] + if !isCol0 { + left, lCol = logicalop.InjectExpr(left, swapped.GetArgs()[0]) + } + if !isCol1 { + right, rCol = logicalop.InjectExpr(right, swapped.GetArgs()[1]) + } + swapped = expression.NewFunctionInternal(ctx.GetExprCtx(), cond.FuncName.L, cond.GetStaticType(), + lCol, rCol).(*expression.ScalarFunction) + } + res = append(res, swapped) + continue + } + return nil, nil, nil, errors.New("eq condition does not match join sides") + } + return left, right, res, nil +} + +func makeNonInnerJoin(ctx base.PlanContext, checkResult *CheckConnectionResult, vertexHints map[int]*JoinMethodHint) (*logicalop.LogicalJoin, error) { + e := checkResult.appliedNonInnerEdge + var alignedEQConds []*expression.ScalarFunction + var err error + + checkResult.node1.p, checkResult.node2.p, alignedEQConds, err = alignEQConds(ctx, checkResult.node1.p, checkResult.node2.p, e.eqConds) + if err != nil { + return nil, err + } + + left := checkResult.node1.p + right := checkResult.node2.p + + join, err := newCartesianJoin(ctx, e.joinType, left, right, vertexHints) + if err != nil { + return nil, err + } + join.EqualConditions = alignedEQConds + for _, cond := range e.nonEQConds { + fromLeft := expression.ExprFromSchema(cond, left.Schema()) + fromRight := expression.ExprFromSchema(cond, right.Schema()) + if fromLeft && !fromRight { + join.LeftConditions = append(join.LeftConditions, cond) + } else if !fromLeft && fromRight { + join.RightConditions = append(join.RightConditions, cond) + } else { + join.OtherConditions = append(join.OtherConditions, cond) + } + } + return join, nil +} + +func makeInnerJoin(ctx base.PlanContext, checkResult *CheckConnectionResult, existingJoin *logicalop.LogicalJoin, vertexHints map[int]*JoinMethodHint) (base.LogicalPlan, error) { + if existingJoin != nil { + // Append selections to existing join. + // For example: (R1 LEFT JOIN R2 ON R1.c1 = R2.c1) INNER JOIN R3 ON R2.c2 = R3.c2 and (R1.c3 = R2.c3 and R1.c4 IS NULL) + // there will be two edges for R1 and R2, one is R1.c1 = R2.c1, the other is R1.c3 = R2.c3 and R1.c4 IS NULL, + // the second edge is a INNER JOIN edge, and we will append it as selection to the first LEFT JOIN edge. + condCap := 0 + for _, e := range checkResult.appliedInnerEdges { + condCap += len(e.eqConds) + len(e.nonEQConds) + } + selection := logicalop.LogicalSelection{ + Conditions: make([]expression.Expression, 0, condCap), + } + for _, e := range checkResult.appliedInnerEdges { + eqExprs := expression.ScalarFuncs2Exprs(e.eqConds) + selection.Conditions = append(selection.Conditions, eqExprs...) + selection.Conditions = append(selection.Conditions, e.nonEQConds...) + } + resSelection := selection.Init(ctx, existingJoin.QueryBlockOffset()) + resSelection.SetChildren(existingJoin) + return resSelection, nil + } + + var err error + var alignedEQConds []*expression.ScalarFunction + newEqConds := make([]*expression.ScalarFunction, 0, 8) + newOtherConds := make([]expression.Expression, 0, 8) + for _, e := range checkResult.appliedInnerEdges { + checkResult.node1.p, checkResult.node2.p, alignedEQConds, err = alignEQConds(ctx, checkResult.node1.p, checkResult.node2.p, e.eqConds) + if err != nil { + return nil, err + } + newEqConds = append(newEqConds, alignedEQConds...) + newOtherConds = append(newOtherConds, e.nonEQConds...) + } + join, err := newCartesianJoin(ctx, checkResult.appliedInnerEdges[0].joinType, checkResult.node1.p, checkResult.node2.p, vertexHints) + if err != nil { + return nil, err + } + join.EqualConditions = append(join.EqualConditions, newEqConds...) + join.OtherConditions = append(join.OtherConditions, newOtherConds...) + + return join, nil +} + +func newCartesianJoin(ctx base.PlanContext, joinType logicalop.JoinType, left, right base.LogicalPlan, vertexHints map[int]*JoinMethodHint) (*logicalop.LogicalJoin, error) { + offset := left.QueryBlockOffset() + if offset != right.QueryBlockOffset() { + offset = -1 + } + + join := logicalop.LogicalJoin{ + JoinType: joinType, + Reordered: true, + }.Init(ctx, offset) + join.SetSchema(expression.MergeSchema(left.Schema(), right.Schema())) + join.SetChildren(left, right) + SetNewJoinWithHint(join, vertexHints) + return join, nil +} + +// HasRemainingEdges checks if there are remaining edges not in usedEdges. +func (d *ConflictDetector) HasRemainingEdges(usedEdges map[uint64]struct{}) (remaining bool) { + d.iterateEdges(func(e *edge) bool { + if len(e.eqConds) > 0 || len(e.nonEQConds) > 0 { + if _, ok := usedEdges[e.idx]; !ok { + remaining = true + return false + } + } + return true + }) + return +} + +// ruleTableEntry encodes whether a given algebraic property holds for a pair of +// join types (see Table 2 and Table 3 in the paper): +// +// 0 — property does NOT hold; a conflict rule must be generated. +// 1 — property holds unconditionally. +// 2 — property holds only when the null-rejection condition is satisfied. +// +// Currently, value 2 is unused because: +// 1. TiDB does not support FULL OUTER JOIN, which is the main source of +// conditional entries in the paper's tables. +// 2. extractJoinGroup() only admits non-inner joins that have at least one +// equi-condition, which implicitly guarantees null-rejection on both sides. +// This allows assoc(LEFT, LEFT) and assoc(RIGHT, RIGHT) to be treated as +// unconditional (value 1). If non-inner joins without equi-conditions are +// admitted in the future, null-rejection checks must be added here. +// +// The value 2 is retained as a placeholder for future extension. +type ruleTableEntry int + +// assocRuleTable[e1][e2] indicates whether the associativity transformation +// +// (R1 ⋈_e1 R2) ⋈_e2 R3 ⟺ R1 ⋈_e1 (R2 ⋈_e2 R3) +// +// is valid for the given pair of join types. +// Rows = join type of e1 (left/child edge), Columns = join type of e2 (right/parent edge). +var assocRuleTable = [][]ruleTableEntry{ + // INNER + { + 1, // INNER + 1, // LEFT OUTER + 0, // RIGHT OUTER + 1, // LEFT SEMI and LEFT OUTER SEMI + 1, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT OUTER + { + 0, // INNER + 1, // LEFT OUTER, check NOTE above. + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // RIGHT OUTER + { + 1, // INNER + 1, // LEFT OUTER + 1, // RIGHT OUTER, check NOTE above. + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT SEMI and LEFT OUTER SEMI + { + 0, // INNER + 0, // LEFT OUTER + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + + // LEFT ANTI and ANTI LEFT OUTER SEMI + { + 0, // INNER + 0, // LEFT OUTER + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, +} + +// leftAsscomRuleTable[e1][e2] indicates whether the left-asscom transformation +// +// (R1 ⋈_e1 R2) ⋈_e2 R3 ⟺ (R1 ⋈_e2 R3) ⋈_e1 R2 +// +// is valid. Here e1 is the child edge (in leftEdges) and e2 is the parent edge. +var leftAsscomRuleTable = [][]ruleTableEntry{ + // INNER + { + 1, // INNER + 1, // LEFT OUTER + 0, // RIGHT OUTER + 1, // LEFT SEMI and LEFT OUTER SEMI + 1, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT OUTER + { + 1, // INNER + 1, // LEFT OUTER + 0, // RIGHT OUTER + 1, // LEFT SEMI and LEFT OUTER SEMI + 1, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // RIGHT OUTER + { + 0, // INNER + 0, // LEFT OUTER + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT SEMI and LEFT OUTER SEMI + { + 1, // INNER + 1, // LEFT OUTER + 1, // RIGHT OUTER + 1, // LEFT SEMI and LEFT OUTER SEMI + 1, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT ANTI and ANTI LEFT OUTER SEMI + { + 1, // INNER + 1, // LEFT OUTER + 1, // RIGHT OUTER + 1, // LEFT SEMI and LEFT OUTER SEMI + 1, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, +} + +// rightAsscomRuleTable[e1][e2] indicates whether the right-asscom transformation +// +// R1 ⋈_e1 (R2 ⋈_e2 R3) ⟺ R2 ⋈_e2 (R1 ⋈_e1 R3) +// +// is valid. Here e1 is the parent edge and e2 is the child edge (in rightEdges). +var rightAsscomRuleTable = [][]ruleTableEntry{ + // INNER + { + 1, // INNER + 1, // LEFT OUTER + 1, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT OUTER + { + 0, // INNER + 0, // LEFT OUTER + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // RIGHT OUTER + { + 0, // INNER + 1, // LEFT OUTER + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT SEMI and LEFT OUTER SEMI + { + 0, // INNER + 0, // LEFT OUTER + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, + // LEFT ANTI and ANTI LEFT OUTER SEMI + { + 0, // INNER + 0, // LEFT OUTER + 0, // RIGHT OUTER + 0, // LEFT SEMI and LEFT OUTER SEMI + 0, // LEFT ANTI and ANTI LEFT OUTER SEMI + }, +} diff --git a/pkg/planner/core/joinorder/join_order.go b/pkg/planner/core/joinorder/join_order.go new file mode 100644 index 0000000000000..a0ac6f0ef83ab --- /dev/null +++ b/pkg/planner/core/joinorder/join_order.go @@ -0,0 +1,605 @@ +// Copyright 2026 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package joinorder + +import ( + "cmp" + "fmt" + "maps" + "slices" + "strings" + + "github.com/cockroachdb/errors" + "github.com/pingcap/tidb/pkg/expression" + "github.com/pingcap/tidb/pkg/parser/ast" + "github.com/pingcap/tidb/pkg/planner/core/base" + "github.com/pingcap/tidb/pkg/planner/core/operator/logicalop" + "github.com/pingcap/tidb/pkg/util/hint" + "github.com/pingcap/tidb/pkg/util/logutil" + "go.uber.org/zap" +) + +// JoinOrder is the base struct for join order optimization. +type JoinOrder struct { + ctx base.PlanContext + group *joinGroup +} + +// A joinGroup is a subtree of the original plan tree. It's the unit for join order. +// root is the root of the subtree, if root is not a join, then the joinGroup only contains one vertex. +// vertexes are the leaf nodes of the subtree, it may have its children, but they are considered as a vertex in this subtree. +type joinGroup struct { + root base.LogicalPlan + // All vertexes in this join group. + // A vertex means a leaf node in this join group tree, + // it may have its own children, but they are considered as a single unit in this join group. + vertexes []base.LogicalPlan + + // All leading hints for this join group. + leadingHints []*hint.PlanHints + // Join method hints for each vertex in this join group. + // Key is the planID of the vertex. + // This is for restore join method hints after join reorder. + vertexHints map[int]*JoinMethodHint + + // There is no need to check ConflictRules if all joins in this group are inner join. + // This can speed up the join reorder process. + allInnerJoin bool +} + +func (g *joinGroup) merge(other *joinGroup) { + g.vertexes = append(g.vertexes, other.vertexes...) + g.leadingHints = append(g.leadingHints, other.leadingHints...) + if len(other.vertexHints) > 0 { + if g.vertexHints == nil { + g.vertexHints = make(map[int]*JoinMethodHint, len(other.vertexHints)) + } + maps.Copy(g.vertexHints, other.vertexHints) + } + g.allInnerJoin = g.allInnerJoin && other.allInnerJoin +} + +func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { + join, isJoin := p.(*logicalop.LogicalJoin) + if !isJoin { + return makeSingleGroup(p) + } + + var curLeadingHint *hint.PlanHints + if join.PreferJoinOrder { + curLeadingHint = join.HintInfo + } + defer func() { + if curLeadingHint != nil { + resJoinGroup.leadingHints = append(resJoinGroup.leadingHints, curLeadingHint) + } + }() + + if join.StraightJoin { + return makeSingleGroup(p) + } + + // For now, we only handle inner join and left/right outer join. + if join.JoinType != logicalop.InnerJoin && join.JoinType != logicalop.LeftOuterJoin && join.JoinType != logicalop.RightOuterJoin { + return makeSingleGroup(p) + } + + if join.PreferJoinType > uint(0) && !p.SCtx().GetSessionVars().EnableAdvancedJoinHint { + return makeSingleGroup(p) + } + + if slices.ContainsFunc(join.EqualConditions, func(expr *expression.ScalarFunction) bool { + return expr.FuncName.L == ast.NullEQ + }) { + return makeSingleGroup(p) + } + + // Due to the limited search space of the greedy algorithm and our currently rudimentary cost model, suboptimal join orders may occasionally be generated. + // For example: + // Original Order: (R1 INNER R2 ON P12) LEFT JOIN (R3 INNER R4 ON P34) ON P23 (Pxy denotes a join condition using Rx and Ry as inputs.) + // The LEFT JOIN condition P23 contains only otherCond (non-equi conditions) without any eqCond. + // Potential Suboptimal Order: R1 INNER (R2 LEFT JOIN (R3 INNER R4 ON P34) ON P23) ON P12 + // This implies that the edge P23 (lacking an eqCond) is applied earlier than in the original order. + // Since edges without equi-conditions perform poorly (as the executor cannot utilize Hash Join), + // and the current single-sequence greedy algorithm cannot explore enough alternative sequences, it may return this poor-performing order directly. + // So We have temporarily disabled reordering for non INNER JOIN that without eqCond. + // For INNER JOINs, we introduced a penalty factor. If the factor is set less equal to 0, + // Cartesian products will only be applied at the final step(which will generate a bushy tree). + // + // Also we allow both assoc(left, left) and assoc(right, right) without considering null-rejective property, + // Because for NON-INNER JOIN with eqCond, it must be null-rejective on both sides. + // If we support reorder NON-INNER JOIN without eqCond in the future, we need to consider null-rejective property here. + // See assocRuleTable in conflict_detector.go for more details. + if join.JoinType != logicalop.InnerJoin && len(join.EqualConditions) == 0 { + return makeSingleGroup(p) + } + + var leftHasHint, rightHasHint bool + var vertexHints map[int]*JoinMethodHint + if p.SCtx().GetSessionVars().EnableAdvancedJoinHint && join.PreferJoinType > uint(0) { + vertexHints = make(map[int]*JoinMethodHint) + if join.LeftPreferJoinType > uint(0) { + vertexHints[join.Children()[0].ID()] = &JoinMethodHint{ + PreferJoinMethod: join.LeftPreferJoinType, + HintInfo: join.HintInfo, + } + leftHasHint = true + } + if join.RightPreferJoinType > uint(0) { + vertexHints[join.Children()[1].ID()] = &JoinMethodHint{ + PreferJoinMethod: join.RightPreferJoinType, + HintInfo: join.HintInfo, + } + rightHasHint = true + } + } + + resJoinGroup = &joinGroup{ + root: p, + vertexes: []base.LogicalPlan{}, + vertexHints: vertexHints, + allInnerJoin: join.JoinType == logicalop.InnerJoin, + } + + leftShouldPreserve := curLeadingHint != nil && IsDerivedTableInLeadingHint(join.Children()[0], curLeadingHint) + var leftJoinGroup, rightJoinGroup *joinGroup + if !leftHasHint && !leftShouldPreserve { + leftJoinGroup = extractJoinGroup(join.Children()[0]) + } else { + leftJoinGroup = makeSingleGroup(join.Children()[0]) + } + resJoinGroup.merge(leftJoinGroup) + + rightShouldPreserve := curLeadingHint != nil && IsDerivedTableInLeadingHint(join.Children()[1], curLeadingHint) + if !rightHasHint && !rightShouldPreserve { + rightJoinGroup = extractJoinGroup(join.Children()[1]) + } else { + rightJoinGroup = makeSingleGroup(join.Children()[1]) + } + resJoinGroup.merge(rightJoinGroup) + return resJoinGroup +} + +func makeSingleGroup(p base.LogicalPlan) *joinGroup { + return &joinGroup{ + root: p, + vertexes: []base.LogicalPlan{p}, + allInnerJoin: true, + } +} + +// Optimize performs join order optimization on the given plan. +func Optimize(p base.LogicalPlan) (base.LogicalPlan, error) { + return optimizeRecursive(p) +} + +func optimizeRecursive(p base.LogicalPlan) (base.LogicalPlan, error) { + if p == nil { + return nil, nil + } + if _, ok := p.(*logicalop.LogicalCTE); ok { + return p, nil + } + + var err error + joinGroup := extractJoinGroup(p) + if len(joinGroup.vertexes) <= 0 { + return nil, errors.Errorf("join group has no vertexes, p: %v", p) + } + + // Only one vertex, no need to reorder. Only need to optimize its children. + if len(joinGroup.vertexes) == 1 { + newChildren := make([]base.LogicalPlan, 0, len(p.Children())) + for _, child := range p.Children() { + newChild, err := optimizeRecursive(child) + if err != nil { + return nil, err + } + newChildren = append(newChildren, newChild) + } + p.SetChildren(newChildren...) + + if len(joinGroup.leadingHints) > 0 { + p.SCtx().GetSessionVars().StmtCtx.SetHintWarning("leading hint is inapplicable, check the join type or the join algorithm hint") + } + return p, nil + } + + // Multiple vertexes, starts to reorder. + vertexMap := make(map[int]base.LogicalPlan, len(joinGroup.vertexes)) + for i, v := range joinGroup.vertexes { + // Make sure the vertexes are all optimized. + oldID := v.ID() + if joinGroup.vertexes[i], err = optimizeRecursive(v); err != nil { + return nil, err + } + vertexMap[oldID] = joinGroup.vertexes[i] + } + if len(vertexMap) > 0 { + joinGroup.root = replaceJoinGroupVertexes(joinGroup.root, vertexMap) + } + if p, err = optimizeForJoinGroup(p.SCtx(), joinGroup); err != nil { + return nil, err + } + return p, nil +} + +// replaceJoinGroupVertexes walks the join-group subtree rooted at `root` and +// swaps every leaf vertex with its optimized replacement from vertexMap. +// +// Why this is needed: each vertex in the join group is recursively optimized +// (optimizeRecursive) before join reorder runs. That optimisation may rebuild +// the plan node (new ID, new children), so the original plan tree still points +// to the stale, pre-optimisation nodes. This function patches the tree so that +// the ConflictDetector.Build(), which traverses from root down to locate +// vertexes by plan ID, sees the up-to-date nodes. +func replaceJoinGroupVertexes(root base.LogicalPlan, vertexMap map[int]base.LogicalPlan) base.LogicalPlan { + if root == nil { + return nil + } + if replacement, ok := vertexMap[root.ID()]; ok { + return replacement + } + children := root.Children() + if len(children) == 0 { + return root + } + newChildren := make([]base.LogicalPlan, len(children)) + for i, child := range children { + newChildren[i] = replaceJoinGroupVertexes(child, vertexMap) + } + root.SetChildren(newChildren...) + return root +} + +func optimizeForJoinGroup(ctx base.PlanContext, group *joinGroup) (p base.LogicalPlan, err error) { + originalSchema := group.root.Schema() + + // TODO impl DP OR merge the old DP impl with the new CD-C impl. + // Make sure there is no behavior change since some users already rely on the old DP impl. + // useGreedy := len(group.vertexes) > ctx.GetSessionVars().TiDBOptJoinReorderThreshold + useGreedy := true + if useGreedy { + joinOrderGreedy := newJoinOrderGreedy(ctx, group) + if p, err = joinOrderGreedy.optimize(); err != nil { + return nil, err + } + } else { + joinOrderDP := newJoinOrderDP(ctx, group) + if p, err = joinOrderDP.optimize(); err != nil { + return nil, err + } + } + + // Ensure the schema is not changed after join reorder. + if !p.Schema().Equal(originalSchema) { + proj := logicalop.LogicalProjection{ + Exprs: expression.Column2Exprs(originalSchema.Columns), + }.Init(p.SCtx(), p.QueryBlockOffset()) + proj.SetSchema(originalSchema.Clone()) + proj.SetChildren(p) + return proj, nil + } + return p, nil +} + +type joinOrderDP struct { + JoinOrder +} + +func newJoinOrderDP(_ base.PlanContext, _ *joinGroup) *joinOrderDP { + panic("not implement yet") +} + +func (*joinOrderDP) optimize() (base.LogicalPlan, error) { + panic("not implement yet") +} + +type joinOrderGreedy struct { + JoinOrder +} + +func newJoinOrderGreedy(ctx base.PlanContext, group *joinGroup) *joinOrderGreedy { + return &joinOrderGreedy{ + JoinOrder: JoinOrder{ + ctx: ctx, + group: group, + }, + } +} + +// buildJoinByHint builds a join tree according to the leading hints. +func (j *joinOrderGreedy) buildJoinByHint(detector *ConflictDetector, nodes []*Node) (*Node, []*Node, error) { + if len(j.group.leadingHints) == 0 { + return nil, nodes, nil + } + + leadingHint, hasDifferent := CheckAndGenerateLeadingHint(j.group.leadingHints) + if hasDifferent { + j.ctx.GetSessionVars().StmtCtx.SetHintWarning( + "We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid") + } + + if leadingHint == nil || leadingHint.LeadingList == nil { + return nil, nodes, nil + } + + findAndRemoveByHint := func(available []*Node, hint *ast.HintTable) (*Node, []*Node, bool) { + return FindAndRemovePlanByAstHint(j.ctx, available, hint, func(node *Node) base.LogicalPlan { + return node.p + }) + } + joiner := func(left, right *Node) (*Node, bool, error) { + _, newNode, err := checkConnectionAndMakeJoin(detector, left, right, j.group.vertexHints, true) + if err != nil { + return nil, false, err + } + if newNode == nil { + return nil, false, nil + } + return newNode, true, nil + } + warn := func() { + j.ctx.GetSessionVars().StmtCtx.SetHintWarning("leading hint contains unexpected element type") + } + + // BuildLeadingTreeFromList may modify nodes slice, so we need to clone it first. + // And only return the modified nodes(nodesAfterHint) when the leading hint is applicable, + // and original nodes slice will be returned when the leading hint is inapplicable. + nodeWithHint, nodesAfterHint, ok, err := BuildLeadingTreeFromList(leadingHint.LeadingList, slices.Clone(nodes), findAndRemoveByHint, joiner, warn) + if err != nil { + return nil, nil, err + } + if !ok { + j.ctx.GetSessionVars().StmtCtx.SetHintWarning("leading hint is inapplicable, check if the leading hint table is valid") + return nil, nodes, nil + } + return nodeWithHint, nodesAfterHint, nil +} + +func checkConnection(detector *ConflictDetector, leftPlan, rightPlan *Node) (*CheckConnectionResult, error) { + checkResult, err := detector.CheckConnection(leftPlan, rightPlan) + if err != nil { + return nil, err + } + if checkResult.Connected() { + return checkResult, nil + } + checkResult, err = detector.CheckConnection(rightPlan, leftPlan) + if err != nil { + return nil, err + } + return checkResult, nil +} + +func checkConnectionAndMakeJoin(detector *ConflictDetector, leftPlan, rightPlan *Node, vertexHints map[int]*JoinMethodHint, allowNoEQ bool) (*CheckConnectionResult, *Node, error) { + checkResult, err := checkConnection(detector, leftPlan, rightPlan) + if err != nil { + return nil, nil, err + } + if !checkResult.Connected() { + if !allowNoEQ { + return nil, nil, nil + } + if checkResult = detector.TryCreateCartesianCheckResult(leftPlan, rightPlan); checkResult == nil { + return nil, nil, nil + } + } + newNode, err := detector.MakeJoin(checkResult, vertexHints) + if err != nil { + return nil, nil, err + } + return checkResult, newNode, nil +} + +func (j *joinOrderGreedy) optimize() (base.LogicalPlan, error) { + group := j.group + detector := newConflictDetector(j.ctx) + nodes, err := detector.Build(group) + if err != nil { + return nil, err + } + nodeWithHint, nodes, err := j.buildJoinByHint(detector, nodes) + if err != nil { + return nil, err + } + if len(nodes) < 1 { + return nodeWithHint.p, nil + } + + slices.SortFunc(nodes, func(a, b *Node) int { + return cmp.Compare(a.cumCost, b.cumCost) + }) + + if nodeWithHint != nil { + newNodes := make([]*Node, 0, len(nodes)+1) + newNodes = append(newNodes, nodeWithHint) + newNodes = append(newNodes, nodes...) + nodes = newNodes + } + + // In master branch, there is a sysvar called tidb_opt_cartesian_join_order_threshold. + // In release-8.5, just set it as 0.0. + var cartesianFactor float64 + var disableCartesian = cartesianFactor <= 0 + allowNoEQ := !disableCartesian && j.group.allInnerJoin + if nodes, err = greedyConnectJoinNodes(detector, nodes, j.group.vertexHints, cartesianFactor, allowNoEQ); err != nil { + return nil, err + } + + usedEdges := collectUsedEdges(nodes) + if !allowNoEQ && detector.HasRemainingEdges(usedEdges) { + // After the first round of greedy connection, there are still some remaining edges, + // for example: R1 INNER JOIN R2 ON R1.c1 < R2.c2 + // the above join can only be connected when non-eq edges are allowed, + // and the first round of greedy enumeration is not allowed to use non-eq edges. + // So we got here and we need to the second round of enumeration with `allowNoEQ` as true. + befLen := len(nodes) + if nodes, err = greedyConnectJoinNodes(detector, nodes, j.group.vertexHints, cartesianFactor, true); err != nil { + return nil, err + } + if len(nodes) != befLen { + // Only collect usedEdges when new joins are made in the second round. + usedEdges = collectUsedEdges(nodes) + } + } + if detector.HasRemainingEdges(usedEdges) { + totalEdges, usedEdgeCount, missingEdges, missingDetail, nodeSets := summarizeEdges(detector, usedEdges, nodes, 4) + logutil.BgLogger().Warn("join reorder skipped because not all edges are used", + zap.Int("rootID", group.root.ID()), + zap.Int("nodes", len(nodes)), + zap.Int("totalEdges", totalEdges), + zap.Int("usedEdges", usedEdgeCount), + zap.Int("missingEdges", missingEdges), + zap.String("missingDetail", missingDetail), + zap.String("nodeSets", nodeSets), + zap.Bool("allInnerJoin", group.allInnerJoin)) + return group.root, nil + } + if len(nodes) <= 0 { + return nil, errors.New("internal error: bushy join tree nodes is empty") + } + // makeBushyTree connects the remaining nodes into a bushy tree using cartesian joins, + // It handles situations where there is no edges between different subgraphs, + return makeBushyTree(j.ctx, nodes, j.group.vertexHints) +} + +func greedyConnectJoinNodes(detector *ConflictDetector, nodes []*Node, vertexHints map[int]*JoinMethodHint, cartesianFactor float64, allowNoEQ bool) ([]*Node, error) { + // Outer loop: keep trying while we have multiple nodes and made progress in the last iteration. + // This handles cases where conflict rules block some joins until other joins are completed. + for len(nodes) > 1 { + madeProgress := false + var curJoinIdx int + for curJoinIdx < len(nodes)-1 { + var bestNode *Node + var bestIdx int + curJoinTree := nodes[curJoinIdx] + for iterIdx := curJoinIdx + 1; iterIdx < len(nodes); iterIdx++ { + iterNode := nodes[iterIdx] + checkResult, newNode, err := checkConnectionAndMakeJoin(detector, curJoinTree, iterNode, vertexHints, allowNoEQ) + if err != nil { + return nil, err + } + if newNode == nil { + continue + } + if checkResult.NoEQEdge() { + // The original plan tree may have cartesian edges, to avoid cartesian join happens first, + // we need the check here. + if !allowNoEQ { + continue + } + // TODO: Non INNER JOIN without eqCond is not supported for now. + // For INNER JOIN, if cartesianFactor > 0, we apply a penalty to the cost of the newNode, + // and we might generate a tree with cartesian edge. + // For non INNER JOIN, the logic in extractJoinGroup ensures we will not reach here, + // check the comment in extractJoinGroup for more details. + newNode.cumCost = newNode.cumCost * cartesianFactor + } + if bestNode == nil || newNode.cumCost < bestNode.cumCost { + bestNode = newNode + bestIdx = iterIdx + } + } + if bestNode == nil { + curJoinIdx++ + } else { + nodes[curJoinIdx] = bestNode + nodes = append(nodes[:bestIdx], nodes[bestIdx+1:]...) + madeProgress = true + } + } + // If no progress was made in this iteration, we cannot connect any more nodes. + if !madeProgress { + break + } + } + return nodes, nil +} + +func collectUsedEdges(nodes []*Node) map[uint64]struct{} { + usedEdges := make(map[uint64]struct{}) + for _, node := range nodes { + if node != nil && node.usedEdges != nil { + maps.Copy(usedEdges, node.usedEdges) + } + } + return usedEdges +} + +func summarizeEdges(detector *ConflictDetector, usedEdges map[uint64]struct{}, nodes []*Node, limit int) (total, used, missing int, detail, nodeSets string) { + if usedEdges == nil { + usedEdges = make(map[uint64]struct{}) + } + addEdge := func(e *edge, missingList *[]string) { + if len(e.eqConds) == 0 && len(e.nonEQConds) == 0 { + return + } + total++ + if _, ok := usedEdges[e.idx]; ok { + used++ + return + } + missing++ + if len(*missingList) < limit { + *missingList = append(*missingList, fmt.Sprintf("{idx:%d type:%v eq:%d nonEq:%d tes:%v left:%v right:%v}", + e.idx, e.joinType, len(e.eqConds), len(e.nonEQConds), e.tes.String(), e.leftVertexes.String(), e.rightVertexes.String())) + } + } + + var missingList []string + for _, e := range detector.innerEdges { + addEdge(e, &missingList) + } + for _, e := range detector.nonInnerEdges { + addEdge(e, &missingList) + } + if missing > limit { + missingList = append(missingList, fmt.Sprintf("...(+%d more)", missing-limit)) + } + detail = strings.Join(missingList, ", ") + + if len(nodes) > 0 { + nodeBits := make([]string, 0, len(nodes)) + for _, n := range nodes { + if n == nil { + continue + } + nodeBits = append(nodeBits, n.bitSet.String()) + } + nodeSets = strings.Join(nodeBits, ",") + } + return total, used, missing, detail, nodeSets +} + +func makeBushyTree(ctx base.PlanContext, cartesianNodes []*Node, vertexHints map[int]*JoinMethodHint) (base.LogicalPlan, error) { + var iterNodes []*Node + for len(cartesianNodes) > 1 { + for i := 0; i < len(cartesianNodes); i += 2 { + if i+1 >= len(cartesianNodes) { + iterNodes = append(iterNodes, cartesianNodes[i]) + break + } + newJoin, err := newCartesianJoin(ctx, logicalop.InnerJoin, cartesianNodes[i].p, cartesianNodes[i+1].p, vertexHints) + if err != nil { + return nil, err + } + iterNodes = append(iterNodes, &Node{p: newJoin}) + } + cartesianNodes = iterNodes + iterNodes = iterNodes[:0] + } + return cartesianNodes[0].p, nil +} diff --git a/pkg/planner/core/operator/logicalop/logical_join.go b/pkg/planner/core/operator/logicalop/logical_join.go index abf074219eb36..43f3ab69ff512 100644 --- a/pkg/planner/core/operator/logicalop/logical_join.go +++ b/pkg/planner/core/operator/logicalop/logical_join.go @@ -39,6 +39,7 @@ import ( utilhint "github.com/pingcap/tidb/pkg/util/hint" "github.com/pingcap/tidb/pkg/util/intset" "github.com/pingcap/tidb/pkg/util/plancodec" + "github.com/pingcap/tidb/pkg/util/intest" ) // JoinType contains CrossJoin, InnerJoin, LeftOuterJoin, RightOuterJoin, SemiJoin, AntiJoin. @@ -61,6 +62,17 @@ const ( AntiLeftOuterSemiJoin ) +// NOTE: keep JoinType value unchanged, because they are used in conflict_detector.go +func init() { + intest.Assert(InnerJoin == 0 && + LeftOuterJoin == 1 && + RightOuterJoin == 2 && + SemiJoin == 3 && + AntiSemiJoin == 4 && + LeftOuterSemiJoin == 5 && + AntiLeftOuterSemiJoin == 6) +} + // IsOuterJoin returns if this joiner is an outer joiner func (tp JoinType) IsOuterJoin() bool { return tp == LeftOuterJoin || tp == RightOuterJoin || diff --git a/pkg/planner/core/rule_join_reorder.go b/pkg/planner/core/rule_join_reorder.go index c456c88f1cf8e..c641197dbae18 100644 --- a/pkg/planner/core/rule_join_reorder.go +++ b/pkg/planner/core/rule_join_reorder.go @@ -20,6 +20,7 @@ import ( "fmt" "slices" + "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/expression" "github.com/pingcap/tidb/pkg/planner/core/joinorder" "github.com/pingcap/tidb/pkg/parser/ast" @@ -251,6 +252,12 @@ type joinTypeWithExtMsg struct { // Optimize implements the base.LogicalOptRule.<0th> interface. func (s *JoinReOrderSolver) Optimize(_ context.Context, p base.LogicalPlan, opt *optimizetrace.LogicalOptimizeOp) (base.LogicalPlan, bool, error) { + failpoint.Inject("enableCDCJoinReorder", func(val failpoint.Value) { + if val.(bool) { + p2, err := joinorder.Optimize(p) + failpoint.Return(p2, false, err) + } + }) planChanged := false tracer := &joinReorderTrace{cost: map[string]float64{}, opt: opt} tracer.traceJoinReorder(p) From 7bd27fcf32ad8cc85a4b3dd66d537473ac84c129 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Tue, 2 Jun 2026 16:05:55 +0800 Subject: [PATCH 06/25] update Signed-off-by: guo-shaoge --- pkg/planner/core/casetest/rule/BUILD.bazel | 3 +- .../core/operator/logicalop/logical_join.go | 2 +- pkg/planner/core/rule_join_reorder.go | 2 +- pkg/util/hint/hint.go | 32 +++++++++---------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/pkg/planner/core/casetest/rule/BUILD.bazel b/pkg/planner/core/casetest/rule/BUILD.bazel index 9117e06be03d7..e221631e60736 100644 --- a/pkg/planner/core/casetest/rule/BUILD.bazel +++ b/pkg/planner/core/casetest/rule/BUILD.bazel @@ -16,7 +16,7 @@ go_test( ], data = glob(["testdata/**"]), flaky = True, - shard_count = 12, + shard_count = 13, deps = [ "//pkg/config", "//pkg/domain", @@ -28,6 +28,7 @@ go_test( "//pkg/planner/util/coreusage", "//pkg/testkit", "//pkg/testkit/testdata", + "//pkg/testkit/testfailpoint", "//pkg/testkit/testmain", "//pkg/testkit/testsetup", "//pkg/types", diff --git a/pkg/planner/core/operator/logicalop/logical_join.go b/pkg/planner/core/operator/logicalop/logical_join.go index 43f3ab69ff512..c2435b7aa35e0 100644 --- a/pkg/planner/core/operator/logicalop/logical_join.go +++ b/pkg/planner/core/operator/logicalop/logical_join.go @@ -37,9 +37,9 @@ import ( "github.com/pingcap/tidb/pkg/planner/util/utilfuncp" "github.com/pingcap/tidb/pkg/types" utilhint "github.com/pingcap/tidb/pkg/util/hint" + "github.com/pingcap/tidb/pkg/util/intest" "github.com/pingcap/tidb/pkg/util/intset" "github.com/pingcap/tidb/pkg/util/plancodec" - "github.com/pingcap/tidb/pkg/util/intest" ) // JoinType contains CrossJoin, InnerJoin, LeftOuterJoin, RightOuterJoin, SemiJoin, AntiJoin. diff --git a/pkg/planner/core/rule_join_reorder.go b/pkg/planner/core/rule_join_reorder.go index c641197dbae18..28ead289f9ef7 100644 --- a/pkg/planner/core/rule_join_reorder.go +++ b/pkg/planner/core/rule_join_reorder.go @@ -22,9 +22,9 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/expression" - "github.com/pingcap/tidb/pkg/planner/core/joinorder" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/planner/core/base" + "github.com/pingcap/tidb/pkg/planner/core/joinorder" "github.com/pingcap/tidb/pkg/planner/core/operator/logicalop" "github.com/pingcap/tidb/pkg/planner/util" "github.com/pingcap/tidb/pkg/planner/util/optimizetrace" diff --git a/pkg/util/hint/hint.go b/pkg/util/hint/hint.go index e70f0ba52ae48..3c3e4d2176f5d 100644 --- a/pkg/util/hint/hint.go +++ b/pkg/util/hint/hint.go @@ -537,23 +537,23 @@ type IndexJoinHints struct { // PlanHints are hints that are used to control the optimizer plan choices like 'use_index', 'hash_join'. // TODO: move ignore_plan_cache, straight_join, no_decorrelate here. type PlanHints struct { - IndexJoin IndexJoinHints // inlj_join, inlhj_join, inlmj_join - NoIndexJoin IndexJoinHints // no_inlj_join, no_inlhj_join, no_inlmj_join - HashJoin []HintedTable // hash_join - NoHashJoin []HintedTable // no_hash_join - SortMergeJoin []HintedTable // merge_join - NoMergeJoin []HintedTable // no_merge_join - BroadcastJoin []HintedTable // bcj_join - ShuffleJoin []HintedTable // shuffle_join - IndexHintList []HintedIndex // use_index, ignore_index - IndexMergeHintList []HintedIndex // use_index_merge - TiFlashTables []HintedTable // isolation_read_engines(xx=tiflash) - TiKVTables []HintedTable // isolation_read_engines(xx=tikv) - LeadingJoinOrder []HintedTable // leading + IndexJoin IndexJoinHints // inlj_join, inlhj_join, inlmj_join + NoIndexJoin IndexJoinHints // no_inlj_join, no_inlhj_join, no_inlmj_join + HashJoin []HintedTable // hash_join + NoHashJoin []HintedTable // no_hash_join + SortMergeJoin []HintedTable // merge_join + NoMergeJoin []HintedTable // no_merge_join + BroadcastJoin []HintedTable // bcj_join + ShuffleJoin []HintedTable // shuffle_join + IndexHintList []HintedIndex // use_index, ignore_index + IndexMergeHintList []HintedIndex // use_index_merge + TiFlashTables []HintedTable // isolation_read_engines(xx=tiflash) + TiKVTables []HintedTable // isolation_read_engines(xx=tikv) + LeadingJoinOrder []HintedTable // leading LeadingList *ast.LeadingList // leading recursive - HJBuild []HintedTable // hash_join_build - HJProbe []HintedTable // hash_join_probe - NoIndexLookUpPushDown []HintedTable // no_index_lookup_pushdown + HJBuild []HintedTable // hash_join_build + HJProbe []HintedTable // hash_join_probe + NoIndexLookUpPushDown []HintedTable // no_index_lookup_pushdown // Hints belows are not associated with any particular table. PreferAggType uint // hash_agg, merge_agg, agg_to_cop and so on From 33dbf9667a672e90aed343664d6989cf46529912 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Fri, 5 Jun 2026 10:16:18 +0800 Subject: [PATCH 07/25] fmt Signed-off-by: guo-shaoge --- pkg/planner/core/operator/logicalop/logical_join.go | 2 +- pkg/planner/core/rule_join_reorder.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/planner/core/operator/logicalop/logical_join.go b/pkg/planner/core/operator/logicalop/logical_join.go index 6f1e8ac108700..90ea418ecabb8 100644 --- a/pkg/planner/core/operator/logicalop/logical_join.go +++ b/pkg/planner/core/operator/logicalop/logical_join.go @@ -37,9 +37,9 @@ import ( "github.com/pingcap/tidb/pkg/planner/util/utilfuncp" "github.com/pingcap/tidb/pkg/types" utilhint "github.com/pingcap/tidb/pkg/util/hint" + "github.com/pingcap/tidb/pkg/util/intest" "github.com/pingcap/tidb/pkg/util/intset" "github.com/pingcap/tidb/pkg/util/plancodec" - "github.com/pingcap/tidb/pkg/util/intest" ) // JoinType contains CrossJoin, InnerJoin, LeftOuterJoin, RightOuterJoin, SemiJoin, AntiJoin. diff --git a/pkg/planner/core/rule_join_reorder.go b/pkg/planner/core/rule_join_reorder.go index 83c320e6cbb0a..6b09285bf35bd 100644 --- a/pkg/planner/core/rule_join_reorder.go +++ b/pkg/planner/core/rule_join_reorder.go @@ -22,7 +22,6 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/expression" - "github.com/pingcap/tidb/pkg/planner/core/joinorder" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/planner/core/base" "github.com/pingcap/tidb/pkg/planner/core/joinorder" From 0669e00bdc5f0a60f66341b03dc4e016f999bc32 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Fri, 5 Jun 2026 10:19:07 +0800 Subject: [PATCH 08/25] bazel Signed-off-by: guo-shaoge --- pkg/planner/core/joinorder/BUILD.bazel | 26 ++++++++++++++++++++++++-- pkg/session/bootstraptest/BUILD.bazel | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/pkg/planner/core/joinorder/BUILD.bazel b/pkg/planner/core/joinorder/BUILD.bazel index af9d0ae09f67f..5a1e270a46a24 100644 --- a/pkg/planner/core/joinorder/BUILD.bazel +++ b/pkg/planner/core/joinorder/BUILD.bazel @@ -1,16 +1,38 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "joinorder", - srcs = ["util.go"], + srcs = [ + "conflict_detector.go", + "join_order.go", + "util.go", + ], importpath = "github.com/pingcap/tidb/pkg/planner/core/joinorder", visibility = ["//visibility:public"], deps = [ + "//pkg/expression", "//pkg/parser/ast", "//pkg/planner/core/base", "//pkg/planner/core/operator/logicalop", "//pkg/planner/util", "//pkg/util/hint", "//pkg/util/intest", + "//pkg/util/intset", + "//pkg/util/logutil", + "@com_github_cockroachdb_errors//:errors", + "@com_github_pingcap_errors//:errors", + "@org_uber_go_zap//:zap", + ], +) + +go_test( + name = "joinorder_test", + timeout = "short", + srcs = ["bitset_bench_test.go"], + embed = [":joinorder"], + flaky = True, + deps = [ + "//pkg/util/intset", + "@com_github_bits_and_blooms_bitset//:bitset", ], ) diff --git a/pkg/session/bootstraptest/BUILD.bazel b/pkg/session/bootstraptest/BUILD.bazel index 440048d99963d..78289838abcff 100644 --- a/pkg/session/bootstraptest/BUILD.bazel +++ b/pkg/session/bootstraptest/BUILD.bazel @@ -8,7 +8,7 @@ go_test( "main_test.go", ], flaky = True, - shard_count = 15, + shard_count = 16, deps = [ "//pkg/config", "//pkg/ddl", From 9ef21cc211149c926292f0ff4e2bb0881f684895 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Fri, 5 Jun 2026 11:18:19 +0800 Subject: [PATCH 09/25] sync with master branch Signed-off-by: guo-shaoge --- .../core/joinorder/conflict_detector.go | 376 +++++++++++------- pkg/planner/core/joinorder/join_order.go | 358 +++++++++++++++-- 2 files changed, 545 insertions(+), 189 deletions(-) diff --git a/pkg/planner/core/joinorder/conflict_detector.go b/pkg/planner/core/joinorder/conflict_detector.go index 32c8575f52a56..b53e0a51fb8b6 100644 --- a/pkg/planner/core/joinorder/conflict_detector.go +++ b/pkg/planner/core/joinorder/conflict_detector.go @@ -16,9 +16,12 @@ package joinorder import ( "maps" + "math" + "slices" "github.com/pingcap/errors" "github.com/pingcap/tidb/pkg/expression" + "github.com/pingcap/tidb/pkg/parser/mysql" "github.com/pingcap/tidb/pkg/planner/core/base" "github.com/pingcap/tidb/pkg/planner/core/operator/logicalop" "github.com/pingcap/tidb/pkg/util/intset" @@ -114,15 +117,17 @@ type ConflictDetector struct { // any conflict rules that constrain how it may be applied. type edge struct { idx uint64 - joinType logicalop.JoinType + joinType base.JoinType eqConds []*expression.ScalarFunction - // nonEQConds holds otherCond, leftCond, or rightCond — anything that is not - // an equi-join predicate. + // nonEQConds are used in two situations: + // 1. store all non-eq conds for LogicalJoin, like otherCond, leftCond, or rightCond. + // 2. store selection conditions for LogicalSelection-derived edge, which are looked through during buildRecursive. nonEQConds expression.CNFExprs // TES is the Total Eligibility Set: the set of base relations that must be // present in the candidate subgraph for this edge to be applicable. // For now, TES is totally same with SES, check the TODO in makeEdge(). + // Note: didn't use pointer for TES because FastIntSet is relatively small and copying it is cheap. tes intset.FastIntSet // rules are conflict rules {from → to} derived during Build. They encode // reordering constraints imposed by non-assoc/l-asscom/r-asscom join-type combinations. @@ -163,7 +168,7 @@ func (d *ConflictDetector) TryCreateCartesianCheckResult(left, right *Node) *Che if !d.allInnerJoin { return nil } - cartesianEdge := d.makeEdge(logicalop.InnerJoin, []expression.Expression{}, left.bitSet, right.bitSet, nil, nil) + cartesianEdge := d.makeEdge(base.InnerJoin, []expression.Expression{}, left.bitSet, right.bitSet, nil, nil) return &CheckConnectionResult{ node1: left, node2: right, @@ -208,10 +213,34 @@ type Node struct { usedEdges map[uint64]struct{} } -func calcCumCost(p base.LogicalPlan) float64 { +func validateCumCost(cost float64) error { + switch { + case math.IsNaN(cost): + return errors.New("invalid cumulative cost: NaN") + case math.IsInf(cost, -1): + return errors.New("invalid cumulative cost: -Inf") + case cost < 0: + return errors.Errorf("invalid cumulative cost: negative value %v", cost) + default: + return nil + } +} + +func calcCumCost(p base.LogicalPlan, node1, node2 *Node) float64 { + var cost1, cost2 float64 + if node1 != nil { + cost1 = node1.cumCost + } + if node2 != nil { + cost2 = node2.cumCost + } + return p.StatsInfo().RowCount + cost1 + cost2 +} + +func calcCumCostByChildren(p base.LogicalPlan) float64 { cost := p.StatsInfo().RowCount for _, child := range p.Children() { - cost += calcCumCost(child) + cost += calcCumCostByChildren(child) } return cost } @@ -235,17 +264,20 @@ func (d *ConflictDetector) Build(group *joinGroup) ([]*Node, error) { vertexMap := make(map[int]*Node, len(group.vertexes)) for i, v := range group.vertexes { - if _, err := v.RecursiveDeriveStats(nil); err != nil { + if _, _, err := v.RecursiveDeriveStats(nil); err != nil { return nil, err } vertexMap[v.ID()] = &Node{ bitSet: intset.NewFastIntSet(i), p: v, - cumCost: calcCumCost(v), + cumCost: calcCumCostByChildren(v), + } + if err := validateCumCost(vertexMap[v.ID()].cumCost); err != nil { + return nil, err } } - if _, _, err := d.buildRecursive(group.root, vertexMap); err != nil { + if _, _, err := d.buildRecursive(group, group.root, vertexMap); err != nil { return nil, err } return d.groupVertexes, nil @@ -257,12 +289,34 @@ func (d *ConflictDetector) Build(group *joinGroup) ([]*Node, error) { // 3. Returns the accumulated edges and the union of all vertex sets seen so far. // // The returned edges list is used by parent calls to generate conflict rules. -func (d *ConflictDetector) buildRecursive(p base.LogicalPlan, vertexMap map[int]*Node) ([]*edge, intset.FastIntSet, error) { +func (d *ConflictDetector) buildRecursive(group *joinGroup, p base.LogicalPlan, vertexMap map[int]*Node) ([]*edge, intset.FastIntSet, error) { if vertexNode, ok := vertexMap[p.ID()]; ok { d.groupVertexes = append(d.groupVertexes, vertexNode) return nil, vertexNode.bitSet, nil } + // Look through Selection nodes that were kept in the original tree + // (e.g., Selection between two joins in a nested case). + if sel, ok := p.(*logicalop.LogicalSelection); ok { + childEdges, childVertexes, err := d.buildRecursive(group, sel.Children()[0], vertexMap) + if err != nil { + return nil, intset.FastIntSet{}, err + } + selID := sel.ID() + conds, ok := group.selConds[selID] + if !ok { + return nil, intset.FastIntSet{}, errors.Errorf("unexpected Selection node (ID: %d) found in buildRecursive", selID) + } + // Create a Selection edge for filter conditions collected from Selection + // operators that were looked through during extractJoinGroup. + // Selection-derived edge doesn't have child-edges and child-vertexes, + // because no need to generate ConflictRule for this edge. + // But its TES is its all children vertexes for correctness. + selEdge := d.makeEdgeInternal(base.InnerJoin, intset.FastIntSet{}, intset.FastIntSet{}, nil, nil, childVertexes) + selEdge.nonEQConds = conds + return append(childEdges, selEdge), childVertexes, nil + } + var curVertexes intset.FastIntSet // All internal nodes in the join group should be join operators. joinop, ok := p.(*logicalop.LogicalJoin) @@ -270,17 +324,17 @@ func (d *ConflictDetector) buildRecursive(p base.LogicalPlan, vertexMap map[int] return nil, intset.FastIntSet{}, errors.New("unexpected plan type in conflict detector") } - leftEdges, leftVertexes, err := d.buildRecursive(joinop.Children()[0], vertexMap) + leftEdges, leftVertexes, err := d.buildRecursive(group, joinop.Children()[0], vertexMap) if err != nil { return nil, curVertexes, err } - rightEdges, rightVertexes, err := d.buildRecursive(joinop.Children()[1], vertexMap) + rightEdges, rightVertexes, err := d.buildRecursive(group, joinop.Children()[1], vertexMap) if err != nil { return nil, curVertexes, err } var curEdges []*edge - if joinop.JoinType == logicalop.InnerJoin { + if joinop.JoinType == base.InnerJoin { if curEdges, err = d.makeInnerEdge(joinop, leftVertexes, rightVertexes, leftEdges, rightEdges); err != nil { return nil, curVertexes, err } @@ -316,21 +370,21 @@ func (d *ConflictDetector) makeInnerEdge(joinop *logicalop.LogicalJoin, leftVert nonEQConds = append(nonEQConds, joinop.RightConditions...) if len(conds) == 0 && len(nonEQConds) == 0 { - tmp := d.makeEdge(logicalop.InnerJoin, []expression.Expression{}, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp := d.makeEdge(base.InnerJoin, []expression.Expression{}, leftVertexes, rightVertexes, leftEdges, rightEdges) res = append(res, tmp) } condArg := make([]expression.Expression, 1) for _, cond := range conds { condArg[0] = cond - tmp := d.makeEdge(logicalop.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp := d.makeEdge(base.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) tmp.eqConds = append(tmp.eqConds, cond.(*expression.ScalarFunction)) res = append(res, tmp) } for _, cond := range nonEQConds { condArg[0] = cond - tmp := d.makeEdge(logicalop.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp := d.makeEdge(base.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) tmp.nonEQConds = append(tmp.nonEQConds, cond) res = append(res, tmp) } @@ -366,7 +420,14 @@ func (d *ConflictDetector) makeNonInnerEdge(joinop *logicalop.LogicalJoin, leftV } // makeEdge basically implements the pseudocode for CD-C in paper(Figure-11). -func (d *ConflictDetector) makeEdge(joinType logicalop.JoinType, conds []expression.Expression, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge) *edge { +func (d *ConflictDetector) makeEdge(joinType base.JoinType, conds []expression.Expression, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge) *edge { + // The following implements the first part of the pseudocode for CD-C in the paper(Figure-11): + // calc the SES(Syntactic Eligibility Set) and init TES(Total Eligibility Set) as SES. + tes := d.calcSES(conds) + return d.makeEdgeInternal(joinType, leftVertexes, rightVertexes, leftEdges, rightEdges, tes) +} + +func (d *ConflictDetector) makeEdgeInternal(joinType base.JoinType, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge, tes intset.FastIntSet) *edge { e := &edge{ // Each new edge is appended to either d.innerEdges or d.nonInnerEdges // (see below), so their combined length before the append is the next @@ -378,12 +439,9 @@ func (d *ConflictDetector) makeEdge(joinType logicalop.JoinType, conds []express leftEdges: leftEdges, rightEdges: rightEdges, skipRules: d.allInnerJoin, + tes: tes.Copy(), } - // The following implements the first part of the pseudocode for CD-C in the paper(Figure-11): - // calc the SES(Syntactic Eligibility Set) and init TES(Total Eligibility Set) as SES. - e.tes = d.calcSES(conds) - // The following corresponds to the secion 6.2 in the paper(Cross Products and Degenerate Predicates). // For degenerate predicates (only one side referenced), force TES to include // both sides so the edge can't connect unrelated subsets. @@ -394,7 +452,7 @@ func (d *ConflictDetector) makeEdge(joinType logicalop.JoinType, conds []express e.tes = e.tes.Union(e.rightVertexes) } - if joinType == logicalop.InnerJoin { + if joinType == base.InnerJoin { d.innerEdges = append(d.innerEdges, e) } else { d.nonInnerEdges = append(d.nonInnerEdges, e) @@ -472,7 +530,7 @@ func (d *ConflictDetector) calcSES(conds []expression.Expression) intset.FastInt return res } -// joinTypeConvertTable maps logicalop.JoinType to indices used in rule tables. +// joinTypeConvertTable maps base.JoinType to indices used in rule tables. var joinTypeConvertTable = []int{ 0, // INNER 1, // LEFT OUTER @@ -529,10 +587,7 @@ func (d *ConflictDetector) CheckConnection(node1, node2 *Node) (*CheckConnection return nil, errors.Errorf("nil node found in CheckConnection, node1: %v, node2: %v", node1, node2) } - result := &CheckConnectionResult{ - node1: node1, - node2: node2, - } + result := &CheckConnectionResult{} for _, e := range d.innerEdges { if node1.checkUsedEdges(e.idx) || node2.checkUsedEdges(e.idx) { continue @@ -542,18 +597,34 @@ func (d *ConflictDetector) CheckConnection(node1, node2 *Node) (*CheckConnection result.hasEQCond = result.hasEQCond || len(e.eqConds) > 0 } } + var swapNode bool for _, e := range d.nonInnerEdges { if node1.checkUsedEdges(e.idx) || node2.checkUsedEdges(e.idx) { continue } - if e.checkNonInnerEdgeApplicable(node1, node2) { + ok1 := e.checkNonInnerEdgeApplicable(node1, node2) + ok2 := e.checkNonInnerEdgeApplicable(node2, node1) + if ok1 && ok2 { + return nil, errors.New("node1 and node2 cannot be connected by non-inner edges of different direction") + } + if ok1 || ok2 { if result.appliedNonInnerEdge != nil { return nil, errors.New("multiple non-inner edges applied between two nodes") } result.appliedNonInnerEdge = e result.hasEQCond = result.hasEQCond || len(e.eqConds) > 0 + // No need to worry about `swapNode` changing from true to false in the next loop, + // because an error will be returned if there are multiple different non-inner edges. + swapNode = ok2 } } + if swapNode { + result.node1 = node2 + result.node2 = node1 + } else { + result.node1 = node1 + result.node2 = node2 + } return result, nil } @@ -626,7 +697,7 @@ func (d *ConflictDetector) MakeJoin(checkResult *CheckConnectionResult, vertexHi if p == nil { return nil, errors.New("failed to make join plan") } - if _, err := p.RecursiveDeriveStats(nil); err != nil { + if _, _, err := p.RecursiveDeriveStats(nil); err != nil { return nil, err } @@ -641,10 +712,14 @@ func (d *ConflictDetector) MakeJoin(checkResult *CheckConnectionResult, vertexHi } maps.Copy(usedEdges, node1.usedEdges) maps.Copy(usedEdges, node2.usedEdges) + cumCost := calcCumCost(p, node1, node2) + if err := validateCumCost(cumCost); err != nil { + return nil, err + } return &Node{ bitSet: node1.bitSet.Union(node2.bitSet), p: p, - cumCost: calcCumCost(p), + cumCost: cumCost, usedEdges: usedEdges, }, nil } @@ -707,8 +782,23 @@ func makeNonInnerJoin(ctx base.PlanContext, checkResult *CheckConnectionResult, if err != nil { return nil, err } + // After join reorder, the NOT_NULL flag of the null-producing side should be removed. + // We've done this for new join's output schema in LogicalJoin.MergeSchema(). + // Here we do the same thing for expressions in join conditions. + // For example: + // Before reorder: t1 left (t2 left t3 on t2.c2 = t3.c2) on t1.c1 = t2.c1 + // After reorder, (t1 left t2 on t1.c1 = t2.c1) left t3 on t2.c2 = t3.c2; + // We should make sure there is no NOT_NULL flag in `t2.c1`. + for i, cond := range alignedEQConds { + newCond, _ := alignNotNullWithSchema(cond, join.Schema()) + alignedEQConds[i] = newCond.(*expression.ScalarFunction) + } + alignedNonEQConds := make([]expression.Expression, len(e.nonEQConds)) + for i, cond := range e.nonEQConds { + alignedNonEQConds[i], _ = alignNotNullWithSchema(cond, join.Schema()) + } join.EqualConditions = alignedEQConds - for _, cond := range e.nonEQConds { + for _, cond := range alignedNonEQConds { fromLeft := expression.ExprFromSchema(cond, left.Schema()) fromRight := expression.ExprFromSchema(cond, right.Schema()) if fromLeft && !fromRight { @@ -722,6 +812,66 @@ func makeNonInnerJoin(ctx base.PlanContext, checkResult *CheckConnectionResult, return join, nil } +// alignNotNullWithSchema update the columns in expression with the one from schema, +// whose NOT_NULL flag has already been updated by LogicalJoin.MergeSchema(). +func alignNotNullWithSchema(expr expression.Expression, schema *expression.Schema) (expression.Expression, bool) { + if schema == nil || expr == nil { + return expr, false + } + tryUpdateNotNullFlag := func(dstCol, srcCol *expression.Column) (*expression.Column, bool) { + srcNotNullFlag := mysql.HasNotNullFlag(srcCol.RetType.GetFlag()) + dstNotNullFlag := mysql.HasNotNullFlag(dstCol.RetType.GetFlag()) + if srcNotNullFlag != dstNotNullFlag { + newTp := dstCol.RetType.DeepCopy() + // Make sure NOT_NULL flag of dstCol be same with srcCol. + if srcNotNullFlag { + newTp.AddFlag(mysql.NotNullFlag) + } else { + newTp.DelFlag(mysql.NotNullFlag) + } + newCol := dstCol.Clone().(*expression.Column) + newCol.RetType = newTp + return newCol, true + } + return dstCol, false + } + switch e := expr.(type) { + case *expression.Column: + if schemaCol := schema.RetrieveColumn(e); schemaCol != nil { + return tryUpdateNotNullFlag(e, schemaCol) + } + return e, false + case *expression.CorrelatedColumn: + if schemaCol := schema.RetrieveColumn(&e.Column); schemaCol != nil { + if newCol, updated := tryUpdateNotNullFlag(&e.Column, schemaCol); updated { + clone := e.Clone().(*expression.CorrelatedColumn) + clone.Column = *newCol + return clone, true + } + } + return e, false + case *expression.ScalarFunction: + var needClone bool + newArgs := slices.Clone(e.GetArgs()) + for i, arg := range newArgs { + if newArg, updated := alignNotNullWithSchema(arg, schema); updated { + newArgs[i] = newArg + needClone = true + } + } + if needClone { + clone := e.Clone().(*expression.ScalarFunction) + for i, arg := range newArgs { + clone.GetArgs()[i] = arg + } + return clone, true + } + return e, false + default: + return expr, false + } +} + func makeInnerJoin(ctx base.PlanContext, checkResult *CheckConnectionResult, existingJoin *logicalop.LogicalJoin, vertexHints map[int]*JoinMethodHint) (base.LogicalPlan, error) { if existingJoin != nil { // Append selections to existing join. @@ -767,7 +917,7 @@ func makeInnerJoin(ctx base.PlanContext, checkResult *CheckConnectionResult, exi return join, nil } -func newCartesianJoin(ctx base.PlanContext, joinType logicalop.JoinType, left, right base.LogicalPlan, vertexHints map[int]*JoinMethodHint) (*logicalop.LogicalJoin, error) { +func newCartesianJoin(ctx base.PlanContext, joinType base.JoinType, left, right base.LogicalPlan, vertexHints map[int]*JoinMethodHint) (*logicalop.LogicalJoin, error) { offset := left.QueryBlockOffset() if offset != right.QueryBlockOffset() { offset = -1 @@ -779,6 +929,7 @@ func newCartesianJoin(ctx base.PlanContext, joinType logicalop.JoinType, left, r }.Init(ctx, offset) join.SetSchema(expression.MergeSchema(left.Schema(), right.Schema())) join.SetChildren(left, right) + join.MergeSchema() SetNewJoinWithHint(join, vertexHints) return join, nil } @@ -797,6 +948,28 @@ func (d *ConflictDetector) HasRemainingEdges(usedEdges map[uint64]struct{}) (rem return } +// HasRemainingEdgesInSubset checks whether a subset still misses any real edge +// whose referenced relations are fully contained in the subset. +func (d *ConflictDetector) HasRemainingEdgesInSubset(subset intset.FastIntSet, usedEdges map[uint64]struct{}) (remaining bool) { + d.iterateEdges(func(e *edge) bool { + if len(e.eqConds) == 0 && len(e.nonEQConds) == 0 { + return true + } + if _, ok := usedEdges[e.idx]; ok { + return true + } + if !e.tes.SubsetOf(subset) { + return true + } + if !e.leftVertexes.Union(e.rightVertexes).SubsetOf(subset) { + return true + } + remaining = true + return false + }) + return +} + // ruleTableEntry encodes whether a given algebraic property holds for a pair of // join types (see Table 2 and Table 3 in the paper): // @@ -823,47 +996,12 @@ type ruleTableEntry int // is valid for the given pair of join types. // Rows = join type of e1 (left/child edge), Columns = join type of e2 (right/parent edge). var assocRuleTable = [][]ruleTableEntry{ - // INNER - { - 1, // INNER - 1, // LEFT OUTER - 0, // RIGHT OUTER - 1, // LEFT SEMI and LEFT OUTER SEMI - 1, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT OUTER - { - 0, // INNER - 1, // LEFT OUTER, check NOTE above. - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // RIGHT OUTER - { - 1, // INNER - 1, // LEFT OUTER - 1, // RIGHT OUTER, check NOTE above. - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT SEMI and LEFT OUTER SEMI - { - 0, // INNER - 0, // LEFT OUTER - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - - // LEFT ANTI and ANTI LEFT OUTER SEMI - { - 0, // INNER - 0, // LEFT OUTER - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, + // INNER LEFT RIGHT SEMI ANTI + /* INNER */ {1, 1, 0, 1, 1}, + /* LEFT */ {0, 1, 0, 0, 0}, // assoc(LEFT,LEFT)=1: see NOTE above. + /* RIGHT */ {1, 1, 1, 1, 1}, // assoc(RIGHT,RIGHT)=1: see NOTE above. + /* SEMI */ {0, 0, 0, 0, 0}, + /* ANTI */ {0, 0, 0, 0, 0}, } // leftAsscomRuleTable[e1][e2] indicates whether the left-asscom transformation @@ -872,46 +1010,12 @@ var assocRuleTable = [][]ruleTableEntry{ // // is valid. Here e1 is the child edge (in leftEdges) and e2 is the parent edge. var leftAsscomRuleTable = [][]ruleTableEntry{ - // INNER - { - 1, // INNER - 1, // LEFT OUTER - 0, // RIGHT OUTER - 1, // LEFT SEMI and LEFT OUTER SEMI - 1, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT OUTER - { - 1, // INNER - 1, // LEFT OUTER - 0, // RIGHT OUTER - 1, // LEFT SEMI and LEFT OUTER SEMI - 1, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // RIGHT OUTER - { - 0, // INNER - 0, // LEFT OUTER - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT SEMI and LEFT OUTER SEMI - { - 1, // INNER - 1, // LEFT OUTER - 1, // RIGHT OUTER - 1, // LEFT SEMI and LEFT OUTER SEMI - 1, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT ANTI and ANTI LEFT OUTER SEMI - { - 1, // INNER - 1, // LEFT OUTER - 1, // RIGHT OUTER - 1, // LEFT SEMI and LEFT OUTER SEMI - 1, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, + // INNER LEFT RIGHT SEMI ANTI + /* INNER */ {1, 1, 0, 1, 1}, + /* LEFT */ {1, 1, 1, 1, 1}, // l-asscom(LEFT, RIGHT)=1; see NOTE above. + /* RIGHT */ {0, 1, 0, 0, 0}, // l-asscom(RIGHT, LEFT)=1; see NOTE above. + /* SEMI */ {1, 1, 0, 1, 1}, + /* ANTI */ {1, 1, 0, 1, 1}, } // rightAsscomRuleTable[e1][e2] indicates whether the right-asscom transformation @@ -920,44 +1024,10 @@ var leftAsscomRuleTable = [][]ruleTableEntry{ // // is valid. Here e1 is the parent edge and e2 is the child edge (in rightEdges). var rightAsscomRuleTable = [][]ruleTableEntry{ - // INNER - { - 1, // INNER - 1, // LEFT OUTER - 1, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT OUTER - { - 0, // INNER - 0, // LEFT OUTER - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // RIGHT OUTER - { - 0, // INNER - 1, // LEFT OUTER - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT SEMI and LEFT OUTER SEMI - { - 0, // INNER - 0, // LEFT OUTER - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, - // LEFT ANTI and ANTI LEFT OUTER SEMI - { - 0, // INNER - 0, // LEFT OUTER - 0, // RIGHT OUTER - 0, // LEFT SEMI and LEFT OUTER SEMI - 0, // LEFT ANTI and ANTI LEFT OUTER SEMI - }, + // INNER LEFT RIGHT SEMI ANTI + /* INNER */ {1, 0, 1, 0, 0}, + /* LEFT */ {0, 0, 1, 0, 0}, // r-asscom(LEFT, RIGHT)=1; see NOTE above. + /* RIGHT */ {1, 1, 1, 0, 0}, // r-asscom(RIGHT, LEFT)=1; see NOTE above. + /* SEMI */ {0, 0, 0, 0, 0}, + /* ANTI */ {0, 0, 0, 0, 0}, } diff --git a/pkg/planner/core/joinorder/join_order.go b/pkg/planner/core/joinorder/join_order.go index a0ac6f0ef83ab..b5ff9f355f853 100644 --- a/pkg/planner/core/joinorder/join_order.go +++ b/pkg/planner/core/joinorder/join_order.go @@ -18,6 +18,8 @@ import ( "cmp" "fmt" "maps" + "math" + "math/bits" "slices" "strings" @@ -27,6 +29,8 @@ import ( "github.com/pingcap/tidb/pkg/planner/core/base" "github.com/pingcap/tidb/pkg/planner/core/operator/logicalop" "github.com/pingcap/tidb/pkg/util/hint" + "github.com/pingcap/tidb/pkg/util/intest" + "github.com/pingcap/tidb/pkg/util/intset" "github.com/pingcap/tidb/pkg/util/logutil" "go.uber.org/zap" ) @@ -57,6 +61,10 @@ type joinGroup struct { // There is no need to check ConflictRules if all joins in this group are inner join. // This can speed up the join reorder process. allInnerJoin bool + + // selConds holds filter conditions collected from Selection operators + // that were looked through during extractJoinGroup. + selConds map[int][]expression.Expression } func (g *joinGroup) merge(other *joinGroup) { @@ -69,9 +77,36 @@ func (g *joinGroup) merge(other *joinGroup) { maps.Copy(g.vertexHints, other.vertexHints) } g.allInnerJoin = g.allInnerJoin && other.allInnerJoin + + if len(other.selConds) > 0 { + if g.selConds == nil { + g.selConds = make(map[int][]expression.Expression, len(other.selConds)) + } + maps.Copy(g.selConds, other.selConds) + } } func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { + if sel, isSel := p.(*logicalop.LogicalSelection); isSel { + if p.SCtx().GetSessionVars().TiDBOptJoinReorderThroughSel && + !slices.ContainsFunc(sel.Conditions, expression.IsMutableEffectsExpr) { + childGroup := extractJoinGroup(sel.Children()[0]) + // This check is necessary: the child JoinGroup must contain at least one join operator. + // If a table outside the Selection subtree needs to be reordered with tables inside it, + // the connectivity must be verified through CR. Since the CR of Selection-derived edge will not be generated, + // so we need rely on CRs of joins in Selection's subtree. + if len(childGroup.vertexes) > 1 { + if childGroup.selConds == nil { + childGroup.selConds = make(map[int][]expression.Expression) + } + childGroup.selConds[sel.ID()] = sel.Conditions + childGroup.root = sel + return childGroup + } + } + return makeSingleGroup(p) + } + join, isJoin := p.(*logicalop.LogicalJoin) if !isJoin { return makeSingleGroup(p) @@ -92,7 +127,11 @@ func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { } // For now, we only handle inner join and left/right outer join. - if join.JoinType != logicalop.InnerJoin && join.JoinType != logicalop.LeftOuterJoin && join.JoinType != logicalop.RightOuterJoin { + if join.JoinType != base.InnerJoin && join.JoinType != base.LeftOuterJoin && join.JoinType != base.RightOuterJoin { + return makeSingleGroup(p) + } + + if !p.SCtx().GetSessionVars().EnableOuterJoinReorder && (join.JoinType == base.LeftOuterJoin || join.JoinType == base.RightOuterJoin) { return makeSingleGroup(p) } @@ -122,7 +161,7 @@ func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { // Because for NON-INNER JOIN with eqCond, it must be null-rejective on both sides. // If we support reorder NON-INNER JOIN without eqCond in the future, we need to consider null-rejective property here. // See assocRuleTable in conflict_detector.go for more details. - if join.JoinType != logicalop.InnerJoin && len(join.EqualConditions) == 0 { + if join.JoinType != base.InnerJoin && len(join.EqualConditions) == 0 { return makeSingleGroup(p) } @@ -150,7 +189,7 @@ func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { root: p, vertexes: []base.LogicalPlan{}, vertexHints: vertexHints, - allInnerJoin: join.JoinType == logicalop.InnerJoin, + allInnerJoin: join.JoinType == base.InnerJoin, } leftShouldPreserve := curLeadingHint != nil && IsDerivedTableInLeadingHint(join.Children()[0], curLeadingHint) @@ -267,10 +306,9 @@ func replaceJoinGroupVertexes(root base.LogicalPlan, vertexMap map[int]base.Logi func optimizeForJoinGroup(ctx base.PlanContext, group *joinGroup) (p base.LogicalPlan, err error) { originalSchema := group.root.Schema() - // TODO impl DP OR merge the old DP impl with the new CD-C impl. - // Make sure there is no behavior change since some users already rely on the old DP impl. - // useGreedy := len(group.vertexes) > ctx.GetSessionVars().TiDBOptJoinReorderThreshold - useGreedy := true + // Use DP for any join group under the configured threshold. ConflictDetector + // is responsible for validating both inner and non-inner join transitions. + useGreedy := len(group.vertexes) > ctx.GetSessionVars().TiDBOptJoinReorderThreshold if useGreedy { joinOrderGreedy := newJoinOrderGreedy(ctx, group) if p, err = joinOrderGreedy.optimize(); err != nil { @@ -299,12 +337,128 @@ type joinOrderDP struct { JoinOrder } -func newJoinOrderDP(_ base.PlanContext, _ *joinGroup) *joinOrderDP { - panic("not implement yet") +func newJoinOrderDP(ctx base.PlanContext, group *joinGroup) *joinOrderDP { + return &joinOrderDP{ + JoinOrder: JoinOrder{ + ctx: ctx, + group: group, + }, + } +} + +func (j *joinOrderDP) optimize() (base.LogicalPlan, error) { + if len(j.group.leadingHints) > 0 { + // TODO: Old join reorder doesn't support leading hint either, + // we can consider supporting leading hint in DP join reorder in the future, but for now we just return a warning. + j.ctx.GetSessionVars().StmtCtx.SetHintWarning("leading hint is inapplicable for the DP join reorder algorithm") + } + + detector := newConflictDetector(j.ctx) + nodes, err := detector.Build(j.group) + if err != nil { + return nil, err + } + + plan, ok, err := j.optimizeWithDetector(detector, nodes) + if err != nil { + return nil, err + } + if !ok { + j.ctx.GetSessionVars().StmtCtx.SetHintWarning("no valid join order found, the original join order will be used") + return j.group.root, nil + } + return plan, nil } -func (*joinOrderDP) optimize() (base.LogicalPlan, error) { - panic("not implement yet") +func (j *joinOrderDP) optimizeWithDetector(detector *ConflictDetector, nodes []*Node) (base.LogicalPlan, bool, error) { + if len(nodes) == 0 { + return nil, false, errors.New("internal error: join group has no nodes") + } + if len(nodes) == 1 { + return nodes[0].p, true, nil + } + + nodeCount := len(nodes) + if nodeCount >= 63 { + // Sanity check: TiDBOptJoinReorderThreshold should prevent this from happening, but we check it here just in case. + // And 63 for TiDBOptJoinReorderThreshold is too large, we need to decrease it later. + return nil, false, errors.Errorf("DP join reorder supports at most 62 nodes, got %d", nodeCount) + } + + bestPlan := make([]*Node, 1< 0; left = (left - 1) & subset { + right := subset ^ left + if left > right { + // We only need to consider one direction of the partition (left, right) and skip the other (right, left) to avoid duplicate work, + // because the join order (A join B) and (B join A) will be considered in the same iteration when left and right are swapped, + // check ConflictDetector.CheckConnection() for more details. + continue + } + leftPlan := bestPlan[left] + rightPlan := bestPlan[right] + if leftPlan == nil || rightPlan == nil { + // leftPlan or rightPlan will be nil if there is no valid join order for the corresponding subset, + // for example, when the subset contains two nodes but they cannot be joined together. + continue + } + + checkResult, newNode, err := checkConnectionAndMakeJoin(detector, leftPlan, rightPlan, j.group.vertexHints, true) + if err != nil { + return nil, false, err + } + if newNode == nil { + continue + } + if checkResult.NoEQEdge() { + newNode.cumCost, err = applyCartesianFactor(newNode.cumCost, cartesianFactor) + if err != nil { + return nil, false, err + } + } + if bestPlan[subset] == nil || newNode.cumCost < bestPlan[subset].cumCost { + bestPlan[subset] = newNode + } + } + } + + finalPlan := bestPlan[fullMask] + // Example: for (t1 ⋈ t2), (t3 ⋈ t4) with cartesianFactor <= 0, every full plan + // needs one cartesian edge and therefore has +Inf cost. Returning the first + // non-nil fullMask plan directly could keep a shape like (t1 × (t3 ⋈ t4)) ⋈ t2. + // We only return finite full plans here; +Inf full plans go through + // buildBushyTreeFromDP() so cartesian joins are pushed to the final stitch. + if finalPlan != nil && !math.IsInf(finalPlan.cumCost, 1) && !detector.HasRemainingEdges(finalPlan.usedEdges) { + return finalPlan.p, true, nil + } + + bushyPlan, err := buildBushyTreeFromDP(j.ctx, detector, nodes, bestPlan, j.group.vertexHints) + if err != nil { + return nil, false, err + } + if bushyPlan != nil && !detector.HasRemainingEdges(bushyPlan.usedEdges) { + return bushyPlan.p, true, nil + } + + if finalPlan != nil && math.IsInf(finalPlan.cumCost, 1) && !detector.HasRemainingEdges(finalPlan.usedEdges) { + return finalPlan.p, true, nil + } + return nil, false, nil } type joinOrderGreedy struct { @@ -369,23 +523,8 @@ func (j *joinOrderGreedy) buildJoinByHint(detector *ConflictDetector, nodes []*N return nodeWithHint, nodesAfterHint, nil } -func checkConnection(detector *ConflictDetector, leftPlan, rightPlan *Node) (*CheckConnectionResult, error) { - checkResult, err := detector.CheckConnection(leftPlan, rightPlan) - if err != nil { - return nil, err - } - if checkResult.Connected() { - return checkResult, nil - } - checkResult, err = detector.CheckConnection(rightPlan, leftPlan) - if err != nil { - return nil, err - } - return checkResult, nil -} - func checkConnectionAndMakeJoin(detector *ConflictDetector, leftPlan, rightPlan *Node, vertexHints map[int]*JoinMethodHint, allowNoEQ bool) (*CheckConnectionResult, *Node, error) { - checkResult, err := checkConnection(detector, leftPlan, rightPlan) + checkResult, err := detector.CheckConnection(leftPlan, rightPlan) if err != nil { return nil, nil, err } @@ -430,9 +569,7 @@ func (j *joinOrderGreedy) optimize() (base.LogicalPlan, error) { nodes = newNodes } - // In master branch, there is a sysvar called tidb_opt_cartesian_join_order_threshold. - // In release-8.5, just set it as 0.0. - var cartesianFactor float64 + var cartesianFactor float64 = j.ctx.GetSessionVars().CartesianJoinOrderThreshold var disableCartesian = cartesianFactor <= 0 allowNoEQ := !disableCartesian && j.group.allInnerJoin if nodes, err = greedyConnectJoinNodes(detector, nodes, j.group.vertexHints, cartesianFactor, allowNoEQ); err != nil { @@ -447,6 +584,10 @@ func (j *joinOrderGreedy) optimize() (base.LogicalPlan, error) { // and the first round of greedy enumeration is not allowed to use non-eq edges. // So we got here and we need to the second round of enumeration with `allowNoEQ` as true. befLen := len(nodes) + // Clamp to 1 to avoid cumCost*0=0 making non-EQ joins appear free. + if cartesianFactor <= 0 { + cartesianFactor = 1 + } if nodes, err = greedyConnectJoinNodes(detector, nodes, j.group.vertexHints, cartesianFactor, true); err != nil { return nil, err } @@ -466,6 +607,9 @@ func (j *joinOrderGreedy) optimize() (base.LogicalPlan, error) { zap.String("missingDetail", missingDetail), zap.String("nodeSets", nodeSets), zap.Bool("allInnerJoin", group.allInnerJoin)) + if intest.InTest { + return nil, errors.New("got remaining edges during join reorder") + } return group.root, nil } if len(nodes) <= 0 { @@ -473,7 +617,11 @@ func (j *joinOrderGreedy) optimize() (base.LogicalPlan, error) { } // makeBushyTree connects the remaining nodes into a bushy tree using cartesian joins, // It handles situations where there is no edges between different subgraphs, - return makeBushyTree(j.ctx, nodes, j.group.vertexHints) + root, err := makeBushyTree(j.ctx, detector, nodes, j.group.vertexHints, true) + if err != nil { + return nil, err + } + return root.p, nil } func greedyConnectJoinNodes(detector *ConflictDetector, nodes []*Node, vertexHints map[int]*JoinMethodHint, cartesianFactor float64, allowNoEQ bool) ([]*Node, error) { @@ -506,7 +654,10 @@ func greedyConnectJoinNodes(detector *ConflictDetector, nodes []*Node, vertexHin // and we might generate a tree with cartesian edge. // For non INNER JOIN, the logic in extractJoinGroup ensures we will not reach here, // check the comment in extractJoinGroup for more details. - newNode.cumCost = newNode.cumCost * cartesianFactor + newNode.cumCost, err = applyCartesianFactor(newNode.cumCost, cartesianFactor) + if err != nil { + return nil, err + } } if bestNode == nil || newNode.cumCost < bestNode.cumCost { bestNode = newNode @@ -584,22 +735,157 @@ func summarizeEdges(detector *ConflictDetector, usedEdges map[uint64]struct{}, n return total, used, missing, detail, nodeSets } -func makeBushyTree(ctx base.PlanContext, cartesianNodes []*Node, vertexHints map[int]*JoinMethodHint) (base.LogicalPlan, error) { +func applyCartesianFactor(cost, cartesianFactor float64) (float64, error) { + if err := validateCumCost(cost); err != nil { + return 0, err + } + if cartesianFactor <= 0 { + return math.Inf(1), nil + } + if math.IsNaN(cartesianFactor) || math.IsInf(cartesianFactor, 0) { + return 0, errors.Errorf("invalid cartesian factor: %v", cartesianFactor) + } + adjustedCost := cost * cartesianFactor + if err := validateCumCost(adjustedCost); err != nil { + return 0, err + } + return adjustedCost, nil +} + +type dpSubsetCandidate struct { + mask uint64 + node *Node +} + +// buildBushyTreeFromDP reconstructs a valid forest from the DP table and then +// stitches that forest into the final bushy tree. +// +// Why this is needed: +// - The single DP pass may fail to produce a finite full-mask plan even though +// some large subsets were optimized successfully. +// - bestPlan contains many overlapping subset candidates, and not every +// candidate is safe to reuse as a final subtree. In particular, a subset may +// exist only because cartesian/no-EQ joins were introduced early, while that +// subset still has real edges inside it that were never consumed. +// +// The reconstruction therefore does three things: +// 1. Keep only finite, subset-complete candidates (no remaining real edges +// whose TES is fully inside the subset). +// 2. Greedily pick a disjoint set of the largest/cheapest candidates to form +// forest roots. +// 3. Add any uncovered leaf back into the forest so every base relation is +// represented before the final bushy-tree stitch. +func buildBushyTreeFromDP(ctx base.PlanContext, detector *ConflictDetector, leaves []*Node, bestPlan []*Node, vertexHints map[int]*JoinMethodHint) (*Node, error) { + candidates := make([]dpSubsetCandidate, 0, len(bestPlan)) + for mask, node := range bestPlan { + if node == nil || math.IsInf(node.cumCost, 1) { + continue + } + if detector.HasRemainingEdgesInSubset(node.bitSet, node.usedEdges) { + continue + } + candidates = append(candidates, dpSubsetCandidate{ + mask: uint64(mask), + node: node, + }) + } + slices.SortFunc(candidates, func(a, b dpSubsetCandidate) int { + if cmpVal := cmp.Compare(bits.OnesCount64(b.mask), bits.OnesCount64(a.mask)); cmpVal != 0 { + return cmpVal + } + if cmpVal := cmp.Compare(a.node.cumCost, b.node.cumCost); cmpVal != 0 { + return cmpVal + } + return cmp.Compare(a.mask, b.mask) + }) + + forest := make([]*Node, 0, len(candidates)) + var covered intset.FastIntSet + for _, candidate := range candidates { + if candidate.node.bitSet.Intersects(covered) { + continue + } + forest = append(forest, candidate.node) + covered.UnionWith(candidate.node.bitSet) + } + for _, leaf := range leaves { + if leaf.bitSet.Intersects(covered) { + continue + } + forest = append(forest, leaf) + covered.UnionWith(leaf.bitSet) + } + if len(forest) == 0 { + return nil, nil + } + if len(forest) == 1 { + return forest[0], nil + } + return makeBushyTree(ctx, detector, forest, vertexHints, false) +} + +// makeJoinWithDetector is for the final bushy-tree stitching stage. +// +// We keep it separate from checkConnectionAndMakeJoin() because that helper is +// designed for search-time candidate enumeration, where nil means "skip this +// candidate". Here we are no longer searching: we must connect the remaining +// groups deterministically, preferring real edges and otherwise creating an +// explicit cartesian edge through ConflictDetector. +func makeJoinWithDetector(detector *ConflictDetector, left, right *Node, vertexHints map[int]*JoinMethodHint) (*Node, error) { + checkResult, err := detector.CheckConnection(left, right) + if err != nil { + return nil, err + } + if !checkResult.Connected() { + checkResult = detector.TryCreateCartesianCheckResult(left, right) + if checkResult == nil { + return nil, errors.New("failed to construct bushy tree: no valid join edge found") + } + } + + return detector.MakeJoin(checkResult, vertexHints) +} + +// makeBushyTree connects the remaining nodes into a bushy tree. +// +// `fastPath` controls how each pairwise merge is performed: +// - true: build a pure cartesian join directly with newCartesianJoin(), +// without consulting the ConflictDetector. In this mode, only Node.p is +// valid; the other fields are not initialized. This should be used only +// in the final step of bushy-tree construction. +// - false: use makeJoinWithDetector(), which prefers a real edge selected +// through the ConflictDetector and falls back to an explicit cartesian +// edge only if no real edge exists. This path returns a fully initialized +// *Node. +// +// NOTE: The `true` branch currently serves only the greedy algorithm's final +// stitching step, where the caller reads only root.p. It does not populate +// metadata such as usedEdges. If future callers need bitSet/cumCost/usedEdges, +// this branch must be extended to build a fully initialized Node. +func makeBushyTree(ctx base.PlanContext, detector *ConflictDetector, cartesianNodes []*Node, vertexHints map[int]*JoinMethodHint, fastPath bool) (*Node, error) { var iterNodes []*Node + var err error for len(cartesianNodes) > 1 { for i := 0; i < len(cartesianNodes); i += 2 { if i+1 >= len(cartesianNodes) { iterNodes = append(iterNodes, cartesianNodes[i]) break } - newJoin, err := newCartesianJoin(ctx, logicalop.InnerJoin, cartesianNodes[i].p, cartesianNodes[i+1].p, vertexHints) + var newJoin *Node + if fastPath { + p, err1 := newCartesianJoin(ctx, base.InnerJoin, cartesianNodes[i].p, cartesianNodes[i+1].p, vertexHints) + newJoin = &Node{p: p} + err = err1 + } else { + newJoin, err = makeJoinWithDetector(detector, cartesianNodes[i], cartesianNodes[i+1], vertexHints) + } if err != nil { return nil, err } - iterNodes = append(iterNodes, &Node{p: newJoin}) + iterNodes = append(iterNodes, newJoin) } cartesianNodes = iterNodes iterNodes = iterNodes[:0] } - return cartesianNodes[0].p, nil + return cartesianNodes[0], nil } From fdb0eae8b99ff2f92b625fb09b777b6cd52ce4b2 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Fri, 5 Jun 2026 11:34:07 +0800 Subject: [PATCH 10/25] base.xxx -> logicalop.xxx Signed-off-by: guo-shaoge --- .../core/joinorder/conflict_detector.go | 28 +++++++++---------- pkg/planner/core/joinorder/join_order.go | 18 +++++++----- pkg/util/intset/fast_int_set.go | 9 ++++++ 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/pkg/planner/core/joinorder/conflict_detector.go b/pkg/planner/core/joinorder/conflict_detector.go index b53e0a51fb8b6..30aae2c2aec38 100644 --- a/pkg/planner/core/joinorder/conflict_detector.go +++ b/pkg/planner/core/joinorder/conflict_detector.go @@ -117,7 +117,7 @@ type ConflictDetector struct { // any conflict rules that constrain how it may be applied. type edge struct { idx uint64 - joinType base.JoinType + joinType logicalop.JoinType eqConds []*expression.ScalarFunction // nonEQConds are used in two situations: // 1. store all non-eq conds for LogicalJoin, like otherCond, leftCond, or rightCond. @@ -168,7 +168,7 @@ func (d *ConflictDetector) TryCreateCartesianCheckResult(left, right *Node) *Che if !d.allInnerJoin { return nil } - cartesianEdge := d.makeEdge(base.InnerJoin, []expression.Expression{}, left.bitSet, right.bitSet, nil, nil) + cartesianEdge := d.makeEdge(logicalop.InnerJoin, []expression.Expression{}, left.bitSet, right.bitSet, nil, nil) return &CheckConnectionResult{ node1: left, node2: right, @@ -264,7 +264,7 @@ func (d *ConflictDetector) Build(group *joinGroup) ([]*Node, error) { vertexMap := make(map[int]*Node, len(group.vertexes)) for i, v := range group.vertexes { - if _, _, err := v.RecursiveDeriveStats(nil); err != nil { + if _, err := v.RecursiveDeriveStats(nil); err != nil { return nil, err } vertexMap[v.ID()] = &Node{ @@ -312,7 +312,7 @@ func (d *ConflictDetector) buildRecursive(group *joinGroup, p base.LogicalPlan, // Selection-derived edge doesn't have child-edges and child-vertexes, // because no need to generate ConflictRule for this edge. // But its TES is its all children vertexes for correctness. - selEdge := d.makeEdgeInternal(base.InnerJoin, intset.FastIntSet{}, intset.FastIntSet{}, nil, nil, childVertexes) + selEdge := d.makeEdgeInternal(logicalop.InnerJoin, intset.FastIntSet{}, intset.FastIntSet{}, nil, nil, childVertexes) selEdge.nonEQConds = conds return append(childEdges, selEdge), childVertexes, nil } @@ -334,7 +334,7 @@ func (d *ConflictDetector) buildRecursive(group *joinGroup, p base.LogicalPlan, } var curEdges []*edge - if joinop.JoinType == base.InnerJoin { + if joinop.JoinType == logicalop.InnerJoin { if curEdges, err = d.makeInnerEdge(joinop, leftVertexes, rightVertexes, leftEdges, rightEdges); err != nil { return nil, curVertexes, err } @@ -370,21 +370,21 @@ func (d *ConflictDetector) makeInnerEdge(joinop *logicalop.LogicalJoin, leftVert nonEQConds = append(nonEQConds, joinop.RightConditions...) if len(conds) == 0 && len(nonEQConds) == 0 { - tmp := d.makeEdge(base.InnerJoin, []expression.Expression{}, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp := d.makeEdge(logicalop.InnerJoin, []expression.Expression{}, leftVertexes, rightVertexes, leftEdges, rightEdges) res = append(res, tmp) } condArg := make([]expression.Expression, 1) for _, cond := range conds { condArg[0] = cond - tmp := d.makeEdge(base.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp := d.makeEdge(logicalop.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) tmp.eqConds = append(tmp.eqConds, cond.(*expression.ScalarFunction)) res = append(res, tmp) } for _, cond := range nonEQConds { condArg[0] = cond - tmp := d.makeEdge(base.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) + tmp := d.makeEdge(logicalop.InnerJoin, condArg, leftVertexes, rightVertexes, leftEdges, rightEdges) tmp.nonEQConds = append(tmp.nonEQConds, cond) res = append(res, tmp) } @@ -420,14 +420,14 @@ func (d *ConflictDetector) makeNonInnerEdge(joinop *logicalop.LogicalJoin, leftV } // makeEdge basically implements the pseudocode for CD-C in paper(Figure-11). -func (d *ConflictDetector) makeEdge(joinType base.JoinType, conds []expression.Expression, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge) *edge { +func (d *ConflictDetector) makeEdge(joinType logicalop.JoinType, conds []expression.Expression, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge) *edge { // The following implements the first part of the pseudocode for CD-C in the paper(Figure-11): // calc the SES(Syntactic Eligibility Set) and init TES(Total Eligibility Set) as SES. tes := d.calcSES(conds) return d.makeEdgeInternal(joinType, leftVertexes, rightVertexes, leftEdges, rightEdges, tes) } -func (d *ConflictDetector) makeEdgeInternal(joinType base.JoinType, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge, tes intset.FastIntSet) *edge { +func (d *ConflictDetector) makeEdgeInternal(joinType logicalop.JoinType, leftVertexes, rightVertexes intset.FastIntSet, leftEdges, rightEdges []*edge, tes intset.FastIntSet) *edge { e := &edge{ // Each new edge is appended to either d.innerEdges or d.nonInnerEdges // (see below), so their combined length before the append is the next @@ -452,7 +452,7 @@ func (d *ConflictDetector) makeEdgeInternal(joinType base.JoinType, leftVertexes e.tes = e.tes.Union(e.rightVertexes) } - if joinType == base.InnerJoin { + if joinType == logicalop.InnerJoin { d.innerEdges = append(d.innerEdges, e) } else { d.nonInnerEdges = append(d.nonInnerEdges, e) @@ -530,7 +530,7 @@ func (d *ConflictDetector) calcSES(conds []expression.Expression) intset.FastInt return res } -// joinTypeConvertTable maps base.JoinType to indices used in rule tables. +// joinTypeConvertTable maps logicalop.JoinType to indices used in rule tables. var joinTypeConvertTable = []int{ 0, // INNER 1, // LEFT OUTER @@ -697,7 +697,7 @@ func (d *ConflictDetector) MakeJoin(checkResult *CheckConnectionResult, vertexHi if p == nil { return nil, errors.New("failed to make join plan") } - if _, _, err := p.RecursiveDeriveStats(nil); err != nil { + if _, err := p.RecursiveDeriveStats(nil); err != nil { return nil, err } @@ -917,7 +917,7 @@ func makeInnerJoin(ctx base.PlanContext, checkResult *CheckConnectionResult, exi return join, nil } -func newCartesianJoin(ctx base.PlanContext, joinType base.JoinType, left, right base.LogicalPlan, vertexHints map[int]*JoinMethodHint) (*logicalop.LogicalJoin, error) { +func newCartesianJoin(ctx base.PlanContext, joinType logicalop.JoinType, left, right base.LogicalPlan, vertexHints map[int]*JoinMethodHint) (*logicalop.LogicalJoin, error) { offset := left.QueryBlockOffset() if offset != right.QueryBlockOffset() { offset = -1 diff --git a/pkg/planner/core/joinorder/join_order.go b/pkg/planner/core/joinorder/join_order.go index b5ff9f355f853..80c1e79c04c03 100644 --- a/pkg/planner/core/joinorder/join_order.go +++ b/pkg/planner/core/joinorder/join_order.go @@ -127,11 +127,11 @@ func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { } // For now, we only handle inner join and left/right outer join. - if join.JoinType != base.InnerJoin && join.JoinType != base.LeftOuterJoin && join.JoinType != base.RightOuterJoin { + if join.JoinType != logicalop.InnerJoin && join.JoinType != logicalop.LeftOuterJoin && join.JoinType != logicalop.RightOuterJoin { return makeSingleGroup(p) } - if !p.SCtx().GetSessionVars().EnableOuterJoinReorder && (join.JoinType == base.LeftOuterJoin || join.JoinType == base.RightOuterJoin) { + if !p.SCtx().GetSessionVars().EnableOuterJoinReorder && (join.JoinType == logicalop.LeftOuterJoin || join.JoinType == logicalop.RightOuterJoin) { return makeSingleGroup(p) } @@ -161,7 +161,7 @@ func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { // Because for NON-INNER JOIN with eqCond, it must be null-rejective on both sides. // If we support reorder NON-INNER JOIN without eqCond in the future, we need to consider null-rejective property here. // See assocRuleTable in conflict_detector.go for more details. - if join.JoinType != base.InnerJoin && len(join.EqualConditions) == 0 { + if join.JoinType != logicalop.InnerJoin && len(join.EqualConditions) == 0 { return makeSingleGroup(p) } @@ -189,7 +189,7 @@ func extractJoinGroup(p base.LogicalPlan) (resJoinGroup *joinGroup) { root: p, vertexes: []base.LogicalPlan{}, vertexHints: vertexHints, - allInnerJoin: join.JoinType == base.InnerJoin, + allInnerJoin: join.JoinType == logicalop.InnerJoin, } leftShouldPreserve := curLeadingHint != nil && IsDerivedTableInLeadingHint(join.Children()[0], curLeadingHint) @@ -396,7 +396,9 @@ func (j *joinOrderDP) optimizeWithDetector(detector *ConflictDetector, nodes []* bestPlan[mask] = node } - cartesianFactor := j.ctx.GetSessionVars().CartesianJoinOrderThreshold + // In master branch, there is a sysvar called tidb_opt_cartesian_join_order_threshold. + // We don't have it in other branch, so just set it to 0.0 + cartesianFactor := 0.0 fullMask := (uint64(1) << uint(nodeCount)) - 1 for subset := uint64(1); subset <= fullMask; subset++ { if bits.OnesCount64(subset) == 1 { @@ -569,7 +571,9 @@ func (j *joinOrderGreedy) optimize() (base.LogicalPlan, error) { nodes = newNodes } - var cartesianFactor float64 = j.ctx.GetSessionVars().CartesianJoinOrderThreshold + // In master branch, there is a sysvar called tidb_opt_cartesian_join_order_threshold. + // We don't have it in other branch, so just set it to 0.0 + var cartesianFactor float64 = 0.0 var disableCartesian = cartesianFactor <= 0 allowNoEQ := !disableCartesian && j.group.allInnerJoin if nodes, err = greedyConnectJoinNodes(detector, nodes, j.group.vertexHints, cartesianFactor, allowNoEQ); err != nil { @@ -873,7 +877,7 @@ func makeBushyTree(ctx base.PlanContext, detector *ConflictDetector, cartesianNo } var newJoin *Node if fastPath { - p, err1 := newCartesianJoin(ctx, base.InnerJoin, cartesianNodes[i].p, cartesianNodes[i+1].p, vertexHints) + p, err1 := newCartesianJoin(ctx, logicalop.InnerJoin, cartesianNodes[i].p, cartesianNodes[i+1].p, vertexHints) newJoin = &Node{p: p} err = err1 } else { diff --git a/pkg/util/intset/fast_int_set.go b/pkg/util/intset/fast_int_set.go index 67cb5d2b3c94c..286ffab57ef38 100644 --- a/pkg/util/intset/fast_int_set.go +++ b/pkg/util/intset/fast_int_set.go @@ -16,6 +16,7 @@ package intset import ( "bytes" + "errors" "fmt" "math/bits" @@ -221,6 +222,14 @@ func (s FastIntSet) largeToSmall() (small uint64, otherValues bool) { return s.small, s.large.Min() < 0 || s.large.Max() >= smallCutOff } +// GetSmallUInt64 returns the small uint64 if the set contains only small values, otherwise returns an error. +func (s FastIntSet) GetSmallUInt64() (uint64, error) { + if s.large != nil { + return 0, errors.New("set contains large values, cannot get small uint64") + } + return s.small, nil +} + // ************************************************************************* // * Logic Operators * // ************************************************************************* From 7697f92421aa0b3090f7c2b7dfb4ec4dde03fa36 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Fri, 5 Jun 2026 13:08:38 +0800 Subject: [PATCH 11/25] bazel Signed-off-by: guo-shaoge --- pkg/planner/core/joinorder/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/planner/core/joinorder/BUILD.bazel b/pkg/planner/core/joinorder/BUILD.bazel index 5a1e270a46a24..1ba3093341595 100644 --- a/pkg/planner/core/joinorder/BUILD.bazel +++ b/pkg/planner/core/joinorder/BUILD.bazel @@ -12,6 +12,7 @@ go_library( deps = [ "//pkg/expression", "//pkg/parser/ast", + "//pkg/parser/mysql", "//pkg/planner/core/base", "//pkg/planner/core/operator/logicalop", "//pkg/planner/util", From 04cd6df97e77ddd7fe83a60c02061be42190fe62 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Fri, 5 Jun 2026 13:23:46 +0800 Subject: [PATCH 12/25] fix Signed-off-by: guo-shaoge --- pkg/planner/core/joinorder/join_order.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/planner/core/joinorder/join_order.go b/pkg/planner/core/joinorder/join_order.go index 80c1e79c04c03..3e279f4d07b36 100644 --- a/pkg/planner/core/joinorder/join_order.go +++ b/pkg/planner/core/joinorder/join_order.go @@ -573,7 +573,7 @@ func (j *joinOrderGreedy) optimize() (base.LogicalPlan, error) { // In master branch, there is a sysvar called tidb_opt_cartesian_join_order_threshold. // We don't have it in other branch, so just set it to 0.0 - var cartesianFactor float64 = 0.0 + cartesianFactor := 0.0 var disableCartesian = cartesianFactor <= 0 allowNoEQ := !disableCartesian && j.group.allInnerJoin if nodes, err = greedyConnectJoinNodes(detector, nodes, j.group.vertexHints, cartesianFactor, allowNoEQ); err != nil { From c6f0148983198c4dcd00eff9421948629c7d92ea Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Fri, 5 Jun 2026 15:17:07 +0800 Subject: [PATCH 13/25] fix case Signed-off-by: guo-shaoge --- .../rule/rule_cdc_join_reorder_test.go | 12 +- .../testdata/cdc_join_reorder_suite_out.json | 1442 ++++++++--------- .../testdata/cdc_join_reorder_suite_xut.json | 1207 -------------- 3 files changed, 727 insertions(+), 1934 deletions(-) delete mode 100644 pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json diff --git a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go index 51892bf4f27f5..ae1f6f9f4ef7e 100644 --- a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go +++ b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go @@ -23,8 +23,9 @@ import ( "github.com/stretchr/testify/require" ) -func TestCDCJoinReorder(tt *testing.T) { - testkit.RunTestUnderCascades(tt, func(t *testing.T, tk *testkit.TestKit, cascades, caller string) { +func TestCDCJoinReorder(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) tk.MustExec("use test") tk.MustExec("drop table if exists t1, t2, t3, t4, t5") tk.MustExec("CREATE TABLE t1 (a INT, b INT)") @@ -52,7 +53,7 @@ func TestCDCJoinReorder(tt *testing.T) { Result []string } suite := GetCDCJoinReorderSuiteData() - suite.LoadTestCases(t, &input, &output, cascades, caller) + suite.LoadTestCases(t, &input, &output) // Phase 1: Collect expected results using the old join reorder algorithm // (CD-C is NOT enabled yet). These serve as the ground-truth baseline. @@ -68,15 +69,14 @@ func TestCDCJoinReorder(tt *testing.T) { for i, sql := range input { testdata.OnRecord(func() { output[i].SQL = sql - output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN FORMAT='plan_tree' " + sql).Rows()) + output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN FORMAT='brief' " + sql).Rows()) output[i].Result = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) }) - tk.MustQuery("EXPLAIN FORMAT='plan_tree' " + sql).Check(testkit.Rows(output[i].Plan...)) + tk.MustQuery("EXPLAIN FORMAT='brief' " + sql).Check(testkit.Rows(output[i].Plan...)) // Run with CD-C and cross-validate against the old algorithm baseline. cdcResult := testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) require.Equalf(t, expectedResults[i], cdcResult, "CD-C result differs from old algorithm for case[%d]: %s", i, sql) } - }) } diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json index d0dd4dfcd3050..20309bdd6a009 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json @@ -5,18 +5,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -25,22 +25,22 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000" @@ -49,18 +49,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", "Plan": [ - "Sort root test.t1.a, test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a, test.t2.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -70,18 +70,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -91,18 +91,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -111,18 +111,18 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t2.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -131,17 +131,17 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t3.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:TableFullScan", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -152,17 +152,17 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -173,17 +173,17 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -194,17 +194,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t3.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:TableFullScan", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -215,17 +215,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:TableFullScan", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t2.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -236,17 +236,17 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t1.a = t3.a ORDER BY t3.a", "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t3.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:TableFullScan", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -257,17 +257,17 @@ { "SQL": "SELECT * FROM t2 LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t1 ON t2.a = t1.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t1.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t2.a, test.t3.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t1.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:TableFullScan", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 100 1 1000 1 10", @@ -278,22 +278,22 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -303,21 +303,21 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t4.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -328,21 +328,21 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t4.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -353,18 +353,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -373,36 +373,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a, t2.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.b))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t2.a = t1.a JOIN t3 ON t3.a = t2.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -411,37 +411,37 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t2.b > 150 JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", "Plan": [ - "Sort root test.t1.a, test.t2.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 2.00 root test.t1.a, test.t2.a", + "└─Projection 2.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin 2.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 2.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader(Build) 2.00 root data:Selection", + " │ │ └─Selection 2.00 cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b > 15 JOIN t3 ON t2.a = t3.a WHERE t1.a = 3 ORDER BY t2.a, t3.a", "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root CARTESIAN inner join", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] eq(test.t1.a, 3), gt(test.t1.b, 15)", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan cop[tikv] table:t2 keep order:false" + "Sort 2.00 root test.t2.a, test.t3.a", + "└─HashJoin 2.00 root CARTESIAN inner join", + " ├─TableReader(Build) 0.67 root data:Selection", + " │ └─Selection 0.67 cop[tikv] eq(test.t1.a, 3), gt(test.t1.b, 15)", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false" ], "Result": [ "3 30 1 100 1 1000" @@ -450,18 +450,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 JOIN t3 ON t2.a = t3.a WHERE t1.a = t2.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -470,18 +470,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a <=> t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─HashJoin(Build) root inner join, equal:[nulleq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a", + "└─Projection 3.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin(Build) 3.00 root inner join, equal:[nulleq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -490,19 +490,19 @@ { "SQL": "SELECT * FROM t1 STRAIGHT_JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a", + "└─Projection 3.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -511,19 +511,19 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a < t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t2.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t2.a, test.t3.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t1.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root CARTESIAN left outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 9.00 root test.t1.a, test.t2.a, test.t3.a", + "└─Projection 9.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin 9.00 root inner join, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 9.00 root CARTESIAN left outer join, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 2 200 1 1000", @@ -534,19 +534,19 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a < t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root CARTESIAN right outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 9.00 root test.t2.a, test.t3.a", + "└─Projection 9.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin 9.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 9.00 root CARTESIAN right outer join, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ " 1 100 1 1000" @@ -555,22 +555,22 @@ { "SQL": "SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) JOIN (t3 JOIN t4 ON t3.a = t4.a) ON t1.a = t3.a ORDER BY t1.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000" @@ -579,17 +579,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN (t2 LEFT JOIN t3 ON t2.a = t3.a) ON t1.a = t2.a ORDER BY t2.a, t1.a", "Plan": [ - "Sort root test.t2.a, test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:TableFullScan", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t2.a, test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -600,18 +600,18 @@ { "SQL": "SELECT * FROM (SELECT a, b FROM t1 WHERE a <= 3) x JOIN (SELECT a, b FROM t2 WHERE a <= 2) y ON x.a = y.a JOIN t3 ON y.a = t3.a ORDER BY x.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] le(test.t2.a, 2), le(test.t2.a, 3), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] le(test.t1.a, 2), le(test.t1.a, 3), not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 2.00 root test.t1.a", + "└─HashJoin 2.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 2.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 2.00 root data:Selection", + " │ │ └─Selection 2.00 cop[tikv] le(test.t2.a, 2), le(test.t2.a, 3), not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 2.00 root data:Selection", + " │ └─Selection 2.00 cop[tikv] le(test.t1.a, 2), le(test.t1.a, 3), not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -620,22 +620,22 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t2.b > 150 LEFT JOIN t3 ON t1.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a, t4.a", "Plan": [ - "Sort root test.t1.a, test.t4.a", - "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a, test.t4.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 2.00 root data:Selection", + " │ │ └─Selection 2.00 cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 1000 1 10000" @@ -644,51 +644,51 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a JOIN t4 ON t1.a = t4.a RIGHT JOIN t5 ON t4.a = t5.a ORDER BY t5.a", "Plan": [ - "Sort root test.t5.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t5.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ " 2 20000", @@ -699,25 +699,25 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a LEFT JOIN t5 ON t4.a = t5.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000 ", @@ -728,21 +728,21 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -753,21 +753,21 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t4.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -778,21 +778,21 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t3.a", "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t3.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -803,21 +803,21 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t4.a", + "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -828,18 +828,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t1.b, 10)", - " │ │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 2.00 root test.t1.a", + "└─HashJoin 2.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 2.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 2.00 root data:Selection", + " │ │ └─Selection 2.00 cop[tikv] gt(test.t1.b, 10)", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "2 20 2 200 ", @@ -849,18 +849,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a WHERE t2.a IS NULL ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:Projection, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─Projection(Probe) root test.t1.a, test.t1.b, ->test.t2.a, ->test.t2.b", - " └─HashJoin root anti semi join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 2.40 root test.t1.a", + "└─HashJoin 2.40 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─Selection(Build) 2.40 root isnull(test.t2.a)", + " │ └─HashJoin 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "3 30 3 3000" @@ -869,51 +869,51 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a WHERE t2.b > 100 ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t2.b, 100), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 2.00 root test.t1.a", + "└─Projection 2.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin 2.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) 2.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader(Build) 2.00 root data:Selection", + " │ │ └─Selection 2.00 cop[tikv] gt(test.t2.b, 100), not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 x JOIN t1 y ON x.a = y.b ORDER BY x.a, y.a", "Plan": [ - "Sort root test.t1.a, test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t1.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.b))", - " │ └─TableFullScan cop[tikv] table:y keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:x keep order:false" + "Sort 3.00 root test.t1.a, test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan 3.00 cop[tikv] table:y keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:x keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 x LEFT JOIN t1 y ON x.a = y.b JOIN t2 ON x.a = t2.a ORDER BY x.a, t2.a", "Plan": [ - "Sort root test.t1.a, test.t2.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t1.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.b))", - " │ └─TableFullScan cop[tikv] table:y keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:x keep order:false" + "Sort 3.00 root test.t1.a, test.t2.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan 3.00 cop[tikv] table:y keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:x keep order:false" ], "Result": [ "1 10 1 100", @@ -923,18 +923,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -944,18 +944,18 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:gt(test.t1.b, test.t2.b)", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t2.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)], other cond:gt(test.t1.b, test.t2.b)", + " │ ├─TableReader(Build) 3.00 root data:Selection", + " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ " 1 100 1 1000" @@ -964,17 +964,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:TableFullScan", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t2.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -985,18 +985,18 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t2.a, test.t3.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1005,18 +1005,18 @@ { "SQL": "SELECT * FROM t2 JOIN t3 ON t2.a = t3.a LEFT JOIN t1 ON t1.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t1.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan cop[tikv] table:t2 keep order:false" + "Sort 3.00 root test.t2.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false" ], "Result": [ "1 100 1 1000 1 10" @@ -1025,20 +1025,20 @@ { "SQL": "SELECT t1.a, COUNT(*) FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a GROUP BY t1.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, Column", - " └─HashAgg root group by:test.t1.a, funcs:count(1)->Column, funcs:firstrow(test.t1.a)->test.t1.a", - " └─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─Projection 3.00 root test.t1.a, Column#10", + " └─HashAgg 3.00 root group by:test.t1.a, funcs:count(1)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " └─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 1", @@ -1048,18 +1048,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a LIMIT 2", "Plan": [ - "TopN root test.t1.a, offset:0, count:2", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "TopN 2.00 root test.t1.a, offset:0, count:2", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1068,18 +1068,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 2.40 root test.t1.a", + "└─HashJoin 2.40 root semi join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100" @@ -1088,16 +1088,16 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root anti semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 2.40 root test.t1.a", + "└─HashJoin 2.40 root anti semi join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:TableFullScan", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:TableFullScan", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "2 20 2 200" @@ -1106,19 +1106,19 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE t1.a IN (SELECT a FROM t3) ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashAgg(Build) root group by:test.t3.a, funcs:firstrow(test.t3.a)->test.t3.a", - " │ └─TableReader root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashAgg(Build) 3.00 root group by:test.t3.a, funcs:firstrow(test.t3.a)->test.t3.a", + " │ └─TableReader 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100" @@ -1127,36 +1127,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 OR t2.b > 150 ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:or(gt(test.t1.b, 10), gt(test.t2.b, 150))", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:or(gt(test.t1.b, 10), gt(test.t2.b, 150))", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND (t2.b > 100 OR t2.b < 50) JOIN t3 ON t1.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), or(gt(test.t2.b, 100), lt(test.t2.b, 50))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) 2.00 root data:Selection", + " │ │ └─Selection 2.00 cop[tikv] not(isnull(test.t2.a)), or(gt(test.t2.b, 100), lt(test.t2.b, 50))", + " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 1000", @@ -1166,36 +1166,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b = t2.b LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.b))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.b, test.t2.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.b))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.b))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.b, test.t2.b)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.b))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.b))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.b))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort 3.00 root test.t1.a", + "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) 3.00 root data:Selection", + " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 ", diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json deleted file mode 100644 index d0dd4dfcd3050..0000000000000 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_xut.json +++ /dev/null @@ -1,1207 +0,0 @@ -[ - { - "Name": "TestCDCJoinReorder", - "Cases": [ - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", - "Plan": [ - "Sort root test.t1.a, test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "2 20 2 200 " - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", - "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "3 30 3 3000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a, t3.a", - "Plan": [ - "Sort root test.t1.a, test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", - "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", - "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - " 3 3000", - " 5 5000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "2 20 2 200 ", - "3 30 " - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "2 20 2 200 ", - "3 30 3 3000" - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", - "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - " 3 3000", - " 5 5000" - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t2.a", - "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:TableFullScan", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "2 20 2 200 ", - " 4 400 " - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t1.a = t3.a ORDER BY t3.a", - "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "3 30 3 3000", - " 5 5000" - ] - }, - { - "SQL": "SELECT * FROM t2 LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t1 ON t2.a = t1.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t1.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t2.a, test.t3.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 100 1 1000 1 10", - "2 200 2 20", - " 3 30" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000", - "3 30 3 3000 " - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", - "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000", - " 4 40000", - " 6 60000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", - "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000", - " 4 40000", - " 6 60000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a, t2.a, t3.a", - "Plan": [ - "Sort root test.t1.a, test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.b))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": null - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t2.a = t1.a JOIN t3 ON t3.a = t2.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t2.b > 150 JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", - "Plan": [ - "Sort root test.t1.a, test.t2.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": null - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b > 15 JOIN t3 ON t2.a = t3.a WHERE t1.a = 3 ORDER BY t2.a, t3.a", - "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root CARTESIAN inner join", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] eq(test.t1.a, 3), gt(test.t1.b, 15)", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan cop[tikv] table:t2 keep order:false" - ], - "Result": [ - "3 30 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 JOIN t3 ON t2.a = t3.a WHERE t1.a = t2.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a <=> t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─HashJoin(Build) root inner join, equal:[nulleq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 STRAIGHT_JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a < t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t2.a, t3.a", - "Plan": [ - "Sort root test.t1.a, test.t2.a, test.t3.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t1.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root CARTESIAN left outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 2 200 1 1000", - "1 10 4 400 1 1000", - "3 30 4 400 3 3000" - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a < t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", - "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root CARTESIAN right outer join, left side:TableReader, other cond:lt(test.t1.a, test.t2.a)", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - " 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) JOIN (t3 JOIN t4 ON t3.a = t4.a) ON t1.a = t3.a ORDER BY t1.a, t3.a", - "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000" - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN (t2 LEFT JOIN t3 ON t2.a = t3.a) ON t1.a = t2.a ORDER BY t2.a, t1.a", - "Plan": [ - "Sort root test.t2.a, test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:TableFullScan", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "2 20 2 200 ", - " 4 400 " - ] - }, - { - "SQL": "SELECT * FROM (SELECT a, b FROM t1 WHERE a <= 3) x JOIN (SELECT a, b FROM t2 WHERE a <= 2) y ON x.a = y.a JOIN t3 ON y.a = t3.a ORDER BY x.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] le(test.t2.a, 2), le(test.t2.a, 3), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] le(test.t1.a, 2), le(test.t1.a, 3), not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t2.b > 150 LEFT JOIN t3 ON t1.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a, t4.a", - "Plan": [ - "Sort root test.t1.a, test.t4.a", - "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 1000 1 10000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": null - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a JOIN t4 ON t1.a = t4.a RIGHT JOIN t5 ON t4.a = t5.a ORDER BY t5.a", - "Plan": [ - "Sort root test.t5.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - " 2 20000", - " 5 50000", - " 7 70000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a LEFT JOIN t5 ON t4.a = t5.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000 ", - "2 20 2 200 ", - "3 30 " - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000", - "2 20 2 200 ", - "3 30 " - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", - "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000", - " 4 40000", - " 6 60000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t3.a", - "Plan": [ - "Sort root test.t3.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000", - " 3 3000 ", - " 5 5000 " - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", - "Plan": [ - "Sort root test.t4.a", - "└─HashJoin root right outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000 1 10000", - " 4 40000", - " 6 60000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t1.b, 10)", - " │ │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "2 20 2 200 ", - "3 30 " - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a WHERE t2.a IS NULL ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:Projection, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─Projection(Probe) root test.t1.a, test.t1.b, ->test.t2.a, ->test.t2.b", - " └─HashJoin root anti semi join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "3 30 3 3000" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a WHERE t2.b > 100 ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] gt(test.t2.b, 100), not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": null - }, - { - "SQL": "SELECT * FROM t1 x JOIN t1 y ON x.a = y.b ORDER BY x.a, y.a", - "Plan": [ - "Sort root test.t1.a, test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t1.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.b))", - " │ └─TableFullScan cop[tikv] table:y keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:x keep order:false" - ], - "Result": null - }, - { - "SQL": "SELECT * FROM t1 x LEFT JOIN t1 y ON x.a = y.b JOIN t2 ON x.a = t2.a ORDER BY x.a, t2.a", - "Plan": [ - "Sort root test.t1.a, test.t2.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t1.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.b))", - " │ └─TableFullScan cop[tikv] table:y keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:x keep order:false" - ], - "Result": [ - "1 10 1 100", - "2 20 2 200" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", - "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "3 30 3 3000" - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", - "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)], other cond:gt(test.t1.b, test.t2.b)", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - " 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t2.a", - "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:TableFullScan", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000", - "2 20 2 200 ", - " 4 400 " - ] - }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t2.a, t3.a", - "Plan": [ - "Sort root test.t2.a, test.t3.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t2 JOIN t3 ON t2.a = t3.a LEFT JOIN t1 ON t1.a = t3.a ORDER BY t2.a", - "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t1.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan cop[tikv] table:t2 keep order:false" - ], - "Result": [ - "1 100 1 1000 1 10" - ] - }, - { - "SQL": "SELECT t1.a, COUNT(*) FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a GROUP BY t1.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─Projection root test.t1.a, Column", - " └─HashAgg root group by:test.t1.a, funcs:count(1)->Column, funcs:firstrow(test.t1.a)->test.t1.a", - " └─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 1", - "2 1" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a LIMIT 2", - "Plan": [ - "TopN root test.t1.a, offset:0, count:2", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100" - ] - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root anti semi join, left side:HashJoin, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "2 20 2 200" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE t1.a IN (SELECT a FROM t3) ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashAgg(Build) root group by:test.t3.a, funcs:firstrow(test.t3.a)->test.t3.a", - " │ └─TableReader root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 OR t2.b > 150 ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:or(gt(test.t1.b, 10), gt(test.t2.b, 150))", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": null - }, - { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND (t2.b > 100 OR t2.b < 50) JOIN t3 ON t1.a = t3.a ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), or(gt(test.t2.b, 100), lt(test.t2.b, 50))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" - ], - "Result": [ - "1 10 1 1000", - "3 30 3 3000" - ] - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b = t2.b LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.b))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.b, test.t2.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.b))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.b))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": null - }, - { - "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", - "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t2.b, test.t3.b)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.b))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 ", - "2 20 2 200 " - ] - } - ] - } -] From a7a758ee4f5d47d858b8e8195173707a3e1d7d26 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 10:54:49 +0800 Subject: [PATCH 14/25] update case Signed-off-by: guo-shaoge --- .../rule/rule_cdc_join_reorder_test.go | 252 ++- .../testdata/cdc_join_reorder_suite_in.json | 61 + .../testdata/cdc_join_reorder_suite_out.json | 1846 ++++++++++------- 3 files changed, 1388 insertions(+), 771 deletions(-) diff --git a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go index ae1f6f9f4ef7e..978d0b6e00998 100644 --- a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go +++ b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go @@ -15,6 +15,8 @@ package rule import ( + "fmt" + "strings" "testing" "github.com/pingcap/tidb/pkg/testkit" @@ -26,57 +28,207 @@ import ( func TestCDCJoinReorder(t *testing.T) { store := testkit.CreateMockStore(t) tk := testkit.NewTestKit(t, store) - tk.MustExec("use test") - tk.MustExec("drop table if exists t1, t2, t3, t4, t5") - tk.MustExec("CREATE TABLE t1 (a INT, b INT)") - tk.MustExec("CREATE TABLE t2 (a INT, b INT)") - tk.MustExec("CREATE TABLE t3 (a INT, b INT)") - tk.MustExec("CREATE TABLE t4 (a INT, b INT)") - tk.MustExec("CREATE TABLE t5 (a INT, b INT)") - - tk.MustExec("INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30)") - tk.MustExec("INSERT INTO t2 VALUES (1, 100), (2, 200), (4, 400)") - tk.MustExec("INSERT INTO t3 VALUES (1, 1000), (3, 3000), (5, 5000)") - tk.MustExec("INSERT INTO t4 VALUES (1, 10000), (4, 40000), (6, 60000)") - tk.MustExec("INSERT INTO t5 VALUES (2, 20000), (5, 50000), (7, 70000)") - - tk.MustExec("analyze table t1 all columns;") - tk.MustExec("analyze table t2 all columns;") - tk.MustExec("analyze table t3 all columns;") - tk.MustExec("analyze table t4 all columns;") - tk.MustExec("analyze table t5 all columns;") - - var input []string - var output []struct { - SQL string - Plan []string - Result []string - } - suite := GetCDCJoinReorderSuiteData() - suite.LoadTestCases(t, &input, &output) - - // Phase 1: Collect expected results using the old join reorder algorithm - // (CD-C is NOT enabled yet). These serve as the ground-truth baseline. - expectedResults := make([][]string, len(input)) - for i, sql := range input { - expectedResults[i] = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + tk.MustExec("use test") + tk.MustExec("drop table if exists t1, t2, t3, t4, t5") + tk.MustExec("CREATE TABLE t1 (a INT, b INT)") + tk.MustExec("CREATE TABLE t2 (a INT, b INT)") + tk.MustExec("CREATE TABLE t3 (a INT, b INT)") + tk.MustExec("CREATE TABLE t4 (a INT, b INT)") + tk.MustExec("CREATE TABLE t5 (a INT, b INT)") + + tk.MustExec("INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30)") + tk.MustExec("INSERT INTO t2 VALUES (1, 100), (2, 200), (4, 400)") + tk.MustExec("INSERT INTO t3 VALUES (1, 1000), (3, 3000), (5, 5000)") + tk.MustExec("INSERT INTO t4 VALUES (1, 10000), (4, 40000), (6, 60000)") + tk.MustExec("INSERT INTO t5 VALUES (2, 20000), (5, 50000), (7, 70000)") + + tk.MustExec("analyze table t1 all columns;") + tk.MustExec("analyze table t2 all columns;") + tk.MustExec("analyze table t3 all columns;") + tk.MustExec("analyze table t4 all columns;") + tk.MustExec("analyze table t5 all columns;") + + var input []string + var output []struct { + SQL string + Plan []string + Result []string + } + suite := GetCDCJoinReorderSuiteData() + suite.LoadTestCases(t, &input, &output) + + // Phase 1: Collect expected results using the old join reorder algorithm + // (CD-C is NOT enabled yet). These serve as the ground-truth baseline. + expectedResults := make([][]string, len(input)) + for i, sql := range input { + expectedResults[i] = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + } + + // Phase 2: Enable CD-C algorithm, then verify both the plan and the + // result correctness for every case. + tk.MustExec("set @@tidb_opt_enable_advanced_join_reorder = 1") + testfailpoint.Enable(t, "github.com/pingcap/tidb/pkg/planner/core/enableCDCJoinReorder", `return(true)`) + + for i, sql := range input { + testdata.OnRecord(func() { + output[i].SQL = sql + output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN " + sql).Rows()) + output[i].Result = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + }) + tk.MustQuery("EXPLAIN " + sql).Check(testkit.Rows(output[i].Plan...)) + + // Run with CD-C and cross-validate against the old algorithm baseline. + cdcResult := testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + require.Equalf(t, expectedResults[i], cdcResult, + "CD-C result differs from old algorithm for case[%d]: %s", i, sql) + } +} + +func TestJoinReorderPushSelection(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + tk.MustExec("drop table if exists t1, t2, t3, t4, t5") + tk.MustExec("create table t1(id int not null primary key, name varchar(100))") + tk.MustExec("create table t2(id int not null primary key, name varchar(100))") + tk.MustExec("create table t3(id int not null primary key, name varchar(100))") + tk.MustExec("create table t4(id int not null primary key, name varchar(100))") + tk.MustExec("create table t5(id int not null primary key, name varchar(100))") + tk.MustExec("set @@tidb_opt_join_reorder_through_sel = 1") + + tk.MustExec("insert into t1 values (1,'a'),(2,'b'),(3,'c')") + tk.MustExec("insert into t2 values (1,'a'),(2,'b'),(4,'d')") + tk.MustExec("insert into t3 values (1,'a'),(3,'c'),(5,'e')") + tk.MustExec("insert into t4 values (1,'a'),(4,'d'),(6,'f')") + tk.MustExec("insert into t5 values (2,'b'),(5,'e'),(7,'g')") + tk.MustExec("analyze table t1 all columns") + tk.MustExec("analyze table t2 all columns") + tk.MustExec("analyze table t3 all columns") + tk.MustExec("analyze table t4 all columns") + tk.MustExec("analyze table t5 all columns") + + tk.MustExec("set @@tidb_opt_enable_advanced_join_reorder = 1") + + var input []string + var output []struct { + SQL string + Plan []string + } + suite := GetCDCJoinReorderSuiteData() + suite.LoadTestCasesByName("TestJoinReorderPushSelection", t, &input, &output) + + planCaseIdx := 0 + for _, sql := range input { + normalized := strings.ToLower(strings.TrimSpace(sql)) + if strings.HasPrefix(normalized, "set ") { + tk.MustExec(sql) + continue } - // Phase 2: Enable CD-C algorithm, then verify both the plan and the - // result correctness for every case. - testfailpoint.Enable(t, "github.com/pingcap/tidb/pkg/planner/core/enableCDCJoinReorder", `return(true)`) - - for i, sql := range input { - testdata.OnRecord(func() { - output[i].SQL = sql - output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN FORMAT='brief' " + sql).Rows()) - output[i].Result = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) - }) - tk.MustQuery("EXPLAIN FORMAT='brief' " + sql).Check(testkit.Rows(output[i].Plan...)) - - // Run with CD-C and cross-validate against the old algorithm baseline. - cdcResult := testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) - require.Equalf(t, expectedResults[i], cdcResult, - "CD-C result differs from old algorithm for case[%d]: %s", i, sql) + plan := tk.MustQuery(sql) + testdata.OnRecord(func() { + if planCaseIdx >= len(output) { + output = append(output, struct { + SQL string + Plan []string + }{}) + } + output[planCaseIdx].SQL = sql + output[planCaseIdx].Plan = testdata.ConvertRowsToStrings(plan.Rows()) + }) + + require.Lessf(t, planCaseIdx, len(output), + "missing expected output for plan case[%d], sql: %s", planCaseIdx, sql) + require.Equalf(t, sql, output[planCaseIdx].SQL, + "input/output SQL mismatch at plan case[%d]", planCaseIdx) + plan.Check(testkit.Rows(output[planCaseIdx].Plan...)) + planCaseIdx++ + } + require.Equalf(t, len(output), planCaseIdx, + "unexpected output case count, output=%d, actual explain cases=%d", len(output), planCaseIdx) +} + +// TestDPJoinReorder verifies the DP join reorder algorithm produces correct results. +// It enables the advanced join reorder framework and sets the threshold high enough +// so that all test groups (≤5 tables) are handled by DP rather than greedy. +// Results are cross-validated against the greedy baseline to ensure correctness. +func TestDPJoinReorder(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + tk.MustExec("drop table if exists t1, t2, t3, t4, t5") + tk.MustExec("CREATE TABLE t1 (a INT, b INT)") + tk.MustExec("CREATE TABLE t2 (a INT, b INT)") + tk.MustExec("CREATE TABLE t3 (a INT, b INT)") + tk.MustExec("CREATE TABLE t4 (a INT, b INT)") + tk.MustExec("CREATE TABLE t5 (a INT, b INT)") + + tk.MustExec("INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 30)") + tk.MustExec("INSERT INTO t2 VALUES (1, 100), (2, 200), (4, 400)") + tk.MustExec("INSERT INTO t3 VALUES (1, 1000), (3, 3000), (5, 5000)") + tk.MustExec("INSERT INTO t4 VALUES (1, 10000), (4, 40000), (6, 60000)") + tk.MustExec("INSERT INTO t5 VALUES (2, 20000), (5, 50000), (7, 70000)") + + tk.MustExec("analyze table t1 all columns") + tk.MustExec("analyze table t2 all columns") + tk.MustExec("analyze table t3 all columns") + tk.MustExec("analyze table t4 all columns") + tk.MustExec("analyze table t5 all columns") + + var input []string + var output []struct { + SQL string + Plan []string + Result []string + } + suite := GetCDCJoinReorderSuiteData() + suite.LoadTestCasesByName("TestDPJoinReorder", t, &input, &output) + + // Phase 1: collect greedy baseline results (threshold=0, DP is not used). + tk.MustExec("set @@tidb_opt_enable_advanced_join_reorder = 1") + tk.MustExec("set @@tidb_opt_join_reorder_threshold = 0") + greedyResults := make([][]string, len(input)) + for i, sql := range input { + greedyResults[i] = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + } + + // Phase 2: enable DP (threshold=10 covers all test groups with ≤5 tables). + tk.MustExec("set @@tidb_opt_join_reorder_threshold = 10") + for i, sql := range input { + testdata.OnRecord(func() { + output[i].SQL = sql + output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN " + sql).Rows()) + output[i].Result = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + }) + tk.MustQuery("EXPLAIN " + sql).Check(testkit.Rows(output[i].Plan...)) + + dpResult := testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) + require.Equalf(t, greedyResults[i], dpResult, + "DP result differs from greedy baseline for case[%d]: %s", i, sql) + } +} + +// TestDPJoinReorderLeadingHint verifies that a leading hint produces a warning +// when the DP algorithm is active, since DP does not support leading hints. +func TestDPJoinReorderLeadingHint(t *testing.T) { + store := testkit.CreateMockStore(t) + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + tk.MustExec("drop table if exists t1, t2, t3") + tk.MustExec("CREATE TABLE t1 (a INT, b INT)") + tk.MustExec("CREATE TABLE t2 (a INT, b INT)") + tk.MustExec("CREATE TABLE t3 (a INT, b INT)") + tk.MustExec("set @@tidb_opt_enable_advanced_join_reorder = 1") + tk.MustExec("set @@tidb_opt_join_reorder_threshold = 10") + + tk.MustQuery("SELECT /*+ LEADING(t2, t3) */ * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a") + warnings := tk.MustQuery("show warnings").Rows() + found := false + for _, w := range warnings { + if strings.Contains(fmt.Sprintf("%v", w), "leading hint is inapplicable for the DP join reorder algorithm") { + found = true + break } + } + require.Truef(t, found, "expected warning about leading hint being inapplicable for DP, got: %v", warnings) } diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json index b166c3b8fb820..68ff7b71fb7ca 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json @@ -243,5 +243,66 @@ // Mixed columns: a for one edge, b for another. "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a" ] + }, + { + "name": "TestJoinReorderPushSelection", + "cases": [ + "explain format = 'plan_tree' select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "explain format = 'plan_tree' select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", + "explain format = 'plan_tree' select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", + "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", + "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", + "explain format = 'plan_tree' select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id" + ] + }, + { + "name": "TestDPJoinReorder", + "cases": [ + // ============================================= + // Group 1: Inner joins - DP enumeration basics + // ============================================= + + // 2-table inner join: simplest nontrivial DP case. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a ORDER BY t1.a", + // 3-table chain: t1-t2-t3. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // 4-table chain: t1-t2-t3-t4. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + // 5-table chain: exercises all subset sizes up to 5. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + // Star join: t2 as hub connected to t1, t3, t4. + "SELECT * FROM t2 JOIN t1 ON t2.a = t1.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t2.a = t4.a ORDER BY t2.a", + + // ============================================= + // Group 2: Inner joins with multi-column predicates + // ============================================= + + // Multi-condition inner join. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // Mixed join columns (a and b). + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a", + + // ============================================= + // Group 3: Cartesian product fallback + // ============================================= + + // All-inner group with disconnected components: DP should attempt Cartesian fallback. + "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t3.b > 0 ORDER BY t1.a, t3.a", + // 4-table disconnected components with cartesian penalty disabled: + // DP should still finish each EQ-connected subset and stitch the final cartesian join as a bushy tree. + "SELECT /*+ set_var(tidb_opt_cartesian_join_order_threshold=0) */ * FROM (t1 JOIN t2 ON t1.a = t2.a), (t3 JOIN t4 ON t3.a = t4.a) ORDER BY t1.a, t3.a", + + // ============================================= + // Group 4: Mixed outer joins with DP + // ============================================= + + // LEFT JOIN + INNER: allInnerJoin=false, DP processes non-inner edges via ConflictDetector. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + // RIGHT JOIN + INNER: similar non-inner edge handling. + "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a", + // 4-table LEFT + INNER + LEFT chain. + "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a" + ] } ] diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json index 20309bdd6a009..4a2a6dcb98b4f 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json @@ -5,18 +5,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 3.00 root test.t1.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -25,22 +25,22 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_16 3.00 root test.t1.a", + "└─HashJoin_19 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_36(Build) 3.00 root data:Selection_35", + " │ └─Selection_35 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_34 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_21(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_33(Build) 3.00 root data:Selection_32", + " │ └─Selection_32 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_31 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_23(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_30(Build) 3.00 root data:Selection_29", + " │ └─Selection_29 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_28 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_27(Probe) 3.00 root data:Selection_26", + " └─Selection_26 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_25 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000" @@ -49,18 +49,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t2.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 3.00 root test.t1.a, test.t2.a", + "└─HashJoin_14 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_16(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -70,18 +70,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 3.00 root test.t1.a, test.t3.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -91,18 +91,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a, t3.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t2.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 3.00 root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin_14 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_16(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -111,18 +111,18 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort 3.00 root test.t2.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 3.00 root test.t2.a, test.t3.a", + "└─HashJoin_14 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_16(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -131,17 +131,17 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", "Plan": [ - "Sort 3.00 root test.t3.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:TableFullScan", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_11 3.00 root test.t3.a", + "└─HashJoin_15 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_16(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_20(Probe) 3.00 root data:Selection_19", + " │ └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:TableFullScan_24", + " └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -152,17 +152,17 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_10 3.00 root test.t1.a", + "└─HashJoin_14 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_15(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_21(Build) 3.00 root data:Selection_20", + " │ │ └─Selection_20 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_19 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_18(Probe) 3.00 root data:TableFullScan_17", + " │ └─TableFullScan_17 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -173,17 +173,17 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_11 3.00 root test.t1.a", + "└─HashJoin_15 3.00 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin_16(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_22(Build) 3.00 root data:Selection_21", + " │ │ └─Selection_21 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_20 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_19(Probe) 3.00 root data:TableFullScan_18", + " │ └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:Selection_24", + " └─Selection_24 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_23 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -194,17 +194,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a ORDER BY t3.a", "Plan": [ - "Sort 3.00 root test.t3.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:TableFullScan", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_10 3.00 root test.t3.a", + "└─HashJoin_14 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_15(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_22(Build) 3.00 root data:Selection_21", + " │ │ └─Selection_21 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_20 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_19(Probe) 3.00 root data:Selection_18", + " │ └─Selection_18 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_17 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:TableFullScan_23", + " └─TableFullScan_23 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -215,17 +215,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort 3.00 root test.t2.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_10 3.00 root test.t2.a", + "└─HashJoin_14 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_15(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_21(Build) 3.00 root data:TableFullScan_20", + " │ │ └─TableFullScan_20 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_19(Probe) 3.00 root data:Selection_18", + " │ └─Selection_18 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_17 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -236,17 +236,17 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t1.a = t3.a ORDER BY t3.a", "Plan": [ - "Sort 3.00 root test.t3.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:TableFullScan", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_11 3.00 root test.t3.a", + "└─HashJoin_15 3.00 root right outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin_16(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_20(Probe) 3.00 root data:Selection_19", + " │ └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:TableFullScan_24", + " └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -257,17 +257,17 @@ { "SQL": "SELECT * FROM t2 LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t1 ON t2.a = t1.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t1.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:TableFullScan", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 3.00 root test.t1.a", + "└─HashJoin_15 3.00 root right outer join, equal:[eq(test.t2.a, test.t1.a)]", + " ├─HashJoin_16(Build) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " │ ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ │ └─TableFullScan_21 3.00 cop[tikv] table:t3 keep order:false", + " │ └─TableReader_20(Probe) 3.00 root data:Selection_19", + " │ └─Selection_19 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_18 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:TableFullScan_24", + " └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 100 1 1000 1 10", @@ -278,22 +278,22 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_15 3.00 root test.t1.a", + "└─HashJoin_18 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_35(Build) 3.00 root data:Selection_34", + " │ └─Selection_34 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_33 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_20(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_32(Build) 3.00 root data:Selection_31", + " │ └─Selection_31 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_30 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_22(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_29(Build) 3.00 root data:Selection_28", + " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_27 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_26(Probe) 3.00 root data:Selection_25", + " └─Selection_25 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -303,21 +303,21 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort 3.00 root test.t4.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_14 3.00 root test.t4.a", + "└─HashJoin_17 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_33(Build) 3.00 root data:TableFullScan_32", + " │ └─TableFullScan_32 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_19(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_31(Build) 3.00 root data:Selection_30", + " │ └─Selection_30 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_29 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_21(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_26 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:Selection_24", + " └─Selection_24 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -328,21 +328,21 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort 3.00 root test.t4.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_14 3.00 root test.t4.a", + "└─HashJoin_17 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_33(Build) 3.00 root data:TableFullScan_32", + " │ └─TableFullScan_32 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_19(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_31(Build) 3.00 root data:Selection_30", + " │ └─Selection_30 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_29 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_21(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_26 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:Selection_24", + " └─Selection_24 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -353,18 +353,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 3.00 root test.t1.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -373,36 +373,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a, t2.a, t3.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t2.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_12 3.00 root test.t1.a, test.t2.a, test.t3.a", + "└─HashJoin_16 3.00 root inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─HashJoin_17(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_21(Probe) 3.00 root data:Selection_20", + " │ └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_27(Probe) 3.00 root data:Selection_26", + " └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.b))", + " └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t2.a = t1.a JOIN t3 ON t3.a = t2.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 3.00 root test.t1.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -411,37 +411,37 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t2.b > 150 JOIN t3 ON t2.a = t3.a ORDER BY t1.a, t2.a", "Plan": [ - "Sort 2.00 root test.t1.a, test.t2.a", - "└─Projection 2.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin 2.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 2.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " │ ├─TableReader(Build) 2.00 root data:Selection", - " │ │ └─Selection 2.00 cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_14 2.00 root test.t1.a, test.t2.a", + "└─Projection_17 2.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin_19 2.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_21(Build) 2.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader_24(Build) 2.00 root data:Selection_23", + " │ │ └─Selection_23 2.00 cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_27(Probe) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_30(Probe) 3.00 root data:Selection_29", + " └─Selection_29 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_28 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b > 15 JOIN t3 ON t2.a = t3.a WHERE t1.a = 3 ORDER BY t2.a, t3.a", "Plan": [ - "Sort 2.00 root test.t2.a, test.t3.a", - "└─HashJoin 2.00 root CARTESIAN inner join", - " ├─TableReader(Build) 0.67 root data:Selection", - " │ └─Selection 0.67 cop[tikv] eq(test.t1.a, 3), gt(test.t1.b, 15)", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false" + "Sort_15 2.00 root test.t2.a, test.t3.a", + "└─HashJoin_19 2.00 root CARTESIAN inner join", + " ├─TableReader_22(Build) 0.67 root data:Selection_21", + " │ └─Selection_21 0.67 cop[tikv] eq(test.t1.a, 3), gt(test.t1.b, 15)", + " │ └─TableFullScan_20 3.00 cop[tikv] table:t1 keep order:false", + " └─HashJoin_23(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_30(Build) 3.00 root data:Selection_29", + " │ └─Selection_29 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_28 3.00 cop[tikv] table:t3 keep order:false", + " └─TableReader_27(Probe) 3.00 root data:Selection_26", + " └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false" ], "Result": [ "3 30 1 100 1 1000" @@ -450,18 +450,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 JOIN t3 ON t2.a = t3.a WHERE t1.a = t2.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 3.00 root test.t1.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -470,18 +470,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a <=> t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─Projection 3.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─HashJoin(Build) 3.00 root inner join, equal:[nulleq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_12 3.00 root test.t1.a", + "└─Projection_15 3.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin_16 3.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin_21(Build) 3.00 root inner join, equal:[nulleq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_24(Probe) 3.00 root data:TableFullScan_23", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -490,19 +490,19 @@ { "SQL": "SELECT * FROM t1 STRAIGHT_JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─Projection 3.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_12 3.00 root test.t1.a", + "└─Projection_15 3.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin_16 3.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─HashJoin_21(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_26 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_25(Probe) 3.00 root data:Selection_24", + " │ └─Selection_24 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -511,19 +511,19 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a < t2.a JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t2.a, t3.a", "Plan": [ - "Sort 9.00 root test.t1.a, test.t2.a, test.t3.a", - "└─Projection 9.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin 9.00 root inner join, equal:[eq(test.t3.a, test.t1.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 9.00 root CARTESIAN left outer join, other cond:lt(test.t1.a, test.t2.a)", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 9.00 root test.t1.a, test.t2.a, test.t3.a", + "└─Projection_14 9.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin_16 9.00 root inner join, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader_19(Build) 3.00 root data:Selection_18", + " │ └─Selection_18 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_17 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_20(Probe) 9.00 root CARTESIAN left outer join, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 2 200 1 1000", @@ -534,19 +534,19 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a < t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort 9.00 root test.t2.a, test.t3.a", - "└─Projection 9.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin 9.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 9.00 root CARTESIAN right outer join, other cond:lt(test.t1.a, test.t2.a)", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 9.00 root test.t2.a, test.t3.a", + "└─Projection_14 9.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin_16 9.00 root inner join, equal:[eq(test.t3.a, test.t2.a)]", + " ├─TableReader_19(Build) 3.00 root data:Selection_18", + " │ └─Selection_18 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_17 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_20(Probe) 9.00 root CARTESIAN right outer join, other cond:lt(test.t1.a, test.t2.a)", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ " 1 100 1 1000" @@ -555,22 +555,22 @@ { "SQL": "SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) JOIN (t3 JOIN t4 ON t3.a = t4.a) ON t1.a = t3.a ORDER BY t1.a, t3.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_16 3.00 root test.t1.a, test.t3.a", + "└─HashJoin_19 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_36(Build) 3.00 root data:Selection_35", + " │ └─Selection_35 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_34 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_21(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_33(Build) 3.00 root data:Selection_32", + " │ └─Selection_32 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_31 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_23(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_30(Build) 3.00 root data:Selection_29", + " │ └─Selection_29 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_28 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_27(Probe) 3.00 root data:Selection_26", + " └─Selection_26 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_25 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000" @@ -579,17 +579,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN (t2 LEFT JOIN t3 ON t2.a = t3.a) ON t1.a = t2.a ORDER BY t2.a, t1.a", "Plan": [ - "Sort 3.00 root test.t2.a, test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_10 3.00 root test.t2.a, test.t1.a", + "└─HashJoin_14 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_15(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_21(Build) 3.00 root data:TableFullScan_20", + " │ │ └─TableFullScan_20 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_19(Probe) 3.00 root data:Selection_18", + " │ └─Selection_18 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_17 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -600,18 +600,18 @@ { "SQL": "SELECT * FROM (SELECT a, b FROM t1 WHERE a <= 3) x JOIN (SELECT a, b FROM t2 WHERE a <= 2) y ON x.a = y.a JOIN t3 ON y.a = t3.a ORDER BY x.a", "Plan": [ - "Sort 2.00 root test.t1.a", - "└─HashJoin 2.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 2.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 2.00 root data:Selection", - " │ │ └─Selection 2.00 cop[tikv] le(test.t2.a, 2), le(test.t2.a, 3), not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 2.00 root data:Selection", - " │ └─Selection 2.00 cop[tikv] le(test.t1.a, 2), le(test.t1.a, 3), not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_17 2.00 root test.t1.a", + "└─HashJoin_21 2.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_22(Build) 2.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_29(Build) 2.00 root data:Selection_28", + " │ │ └─Selection_28 2.00 cop[tikv] le(test.t2.a, 2), le(test.t2.a, 3), not(isnull(test.t2.a))", + " │ │ └─TableFullScan_27 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_26(Probe) 2.00 root data:Selection_25", + " │ └─Selection_25 2.00 cop[tikv] le(test.t1.a, 2), le(test.t1.a, 3), not(isnull(test.t1.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_32(Probe) 3.00 root data:Selection_31", + " └─Selection_31 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_30 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -620,22 +620,22 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t2.b > 150 LEFT JOIN t3 ON t1.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a, t4.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t4.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 2.00 root data:Selection", - " │ │ └─Selection 2.00 cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_14 3.00 root test.t1.a, test.t4.a", + "└─HashJoin_17 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_34(Build) 3.00 root data:Selection_33", + " │ └─Selection_33 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_32 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_20(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin_21(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_28(Build) 2.00 root data:Selection_27", + " │ │ └─Selection_27 2.00 cop[tikv] gt(test.t2.b, 150), not(isnull(test.t2.a))", + " │ │ └─TableFullScan_26 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_25(Probe) 3.00 root data:Selection_24", + " │ └─Selection_24 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_31(Probe) 3.00 root data:Selection_30", + " └─Selection_30 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_29 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 1000 1 10000" @@ -644,51 +644,51 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_20 3.00 root test.t1.a", + "└─HashJoin_23 3.00 root inner join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader_45(Build) 3.00 root data:Selection_44", + " │ └─Selection_44 3.00 cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan_43 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin_25(Probe) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_42(Build) 3.00 root data:Selection_41", + " │ └─Selection_41 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_40 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_27(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_39(Build) 3.00 root data:Selection_38", + " │ └─Selection_38 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_37 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_29(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_36(Build) 3.00 root data:Selection_35", + " │ └─Selection_35 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_34 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_33(Probe) 3.00 root data:Selection_32", + " └─Selection_32 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_31 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a JOIN t4 ON t1.a = t4.a RIGHT JOIN t5 ON t4.a = t5.a ORDER BY t5.a", "Plan": [ - "Sort 3.00 root test.t5.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_20 3.00 root test.t5.a", + "└─HashJoin_23 3.00 root right outer join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader_44(Build) 3.00 root data:TableFullScan_43", + " │ └─TableFullScan_43 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin_25(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t4.a)]", + " ├─TableReader_42(Build) 3.00 root data:Selection_41", + " │ └─Selection_41 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_40 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_27(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_39(Build) 3.00 root data:Selection_38", + " │ └─Selection_38 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_37 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_29(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_36(Build) 3.00 root data:Selection_35", + " │ └─Selection_35 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_34 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_33(Probe) 3.00 root data:Selection_32", + " └─Selection_32 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_31 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ " 2 20000", @@ -699,25 +699,25 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a LEFT JOIN t5 ON t4.a = t5.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_16 3.00 root test.t1.a", + "└─HashJoin_19 3.00 root left outer join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader_40(Build) 3.00 root data:Selection_39", + " │ └─Selection_39 3.00 cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan_38 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin_21(Probe) 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_37(Build) 3.00 root data:Selection_36", + " │ └─Selection_36 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_35 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_24(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_25(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_31(Build) 3.00 root data:Selection_30", + " │ │ └─Selection_30 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_29 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_28(Probe) 3.00 root data:TableFullScan_27", + " │ └─TableFullScan_27 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_34(Probe) 3.00 root data:Selection_33", + " └─Selection_33 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_32 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000 ", @@ -728,21 +728,21 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_13 3.00 root test.t1.a", + "└─HashJoin_16 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_32(Build) 3.00 root data:Selection_31", + " │ └─Selection_31 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_30 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_19(Probe) 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_20(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_24 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_23(Probe) 3.00 root data:TableFullScan_22", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_29(Probe) 3.00 root data:Selection_28", + " └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -753,21 +753,21 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort 3.00 root test.t4.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_13 3.00 root test.t4.a", + "└─HashJoin_16 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_32(Build) 3.00 root data:TableFullScan_31", + " │ └─TableFullScan_31 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_18(Probe) 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_30(Build) 3.00 root data:Selection_29", + " │ └─Selection_29 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_28 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_20(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -778,21 +778,21 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a RIGHT JOIN t3 ON t2.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t3.a", "Plan": [ - "Sort 3.00 root test.t3.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_13 3.00 root test.t3.a", + "└─HashJoin_16 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_32(Build) 3.00 root data:Selection_31", + " │ └─Selection_31 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_30 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_19(Probe) 3.00 root right outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_20(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_24(Probe) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_29(Probe) 3.00 root data:TableFullScan_28", + " └─TableFullScan_28 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -803,21 +803,21 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a RIGHT JOIN t4 ON t3.a = t4.a ORDER BY t4.a", "Plan": [ - "Sort 3.00 root test.t4.a", - "└─HashJoin 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_13 3.00 root test.t4.a", + "└─HashJoin_16 3.00 root right outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_32(Build) 3.00 root data:TableFullScan_31", + " │ └─TableFullScan_31 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_18(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_30(Build) 3.00 root data:Selection_29", + " │ └─Selection_29 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_28 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_20(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -828,18 +828,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 ORDER BY t1.a", "Plan": [ - "Sort 2.00 root test.t1.a", - "└─HashJoin 2.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 2.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 2.00 root data:Selection", - " │ │ └─Selection 2.00 cop[tikv] gt(test.t1.b, 10)", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_11 2.00 root test.t1.a", + "└─HashJoin_15 2.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_17(Build) 2.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_20(Build) 2.00 root data:Selection_19", + " │ │ └─Selection_19 2.00 cop[tikv] gt(test.t1.b, 10)", + " │ │ └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false", + " │ └─TableReader_23(Probe) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_26(Probe) 3.00 root data:Selection_25", + " └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "2 20 2 200 ", @@ -849,18 +849,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a WHERE t2.a IS NULL ORDER BY t1.a", "Plan": [ - "Sort 2.40 root test.t1.a", - "└─HashJoin 2.40 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─Selection(Build) 2.40 root isnull(test.t2.a)", - " │ └─HashJoin 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_12 2.40 root test.t1.a", + "└─HashJoin_16 2.40 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─Selection_17(Build) 2.40 root isnull(test.t2.a)", + " │ └─HashJoin_18 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_21(Probe) 3.00 root data:TableFullScan_20", + " │ └─TableFullScan_20 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_27(Probe) 3.00 root data:Selection_26", + " └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "3 30 3 3000" @@ -869,51 +869,51 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a WHERE t2.b > 100 ORDER BY t1.a", "Plan": [ - "Sort 2.00 root test.t1.a", - "└─Projection 2.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", - " └─HashJoin 2.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) 2.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " │ ├─TableReader(Build) 2.00 root data:Selection", - " │ │ └─Selection 2.00 cop[tikv] gt(test.t2.b, 100), not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_13 2.00 root test.t1.a", + "└─Projection_16 2.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b, test.t3.a, test.t3.b", + " └─HashJoin_18 2.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin_20(Build) 2.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " │ ├─TableReader_23(Build) 2.00 root data:Selection_22", + " │ │ └─Selection_22 2.00 cop[tikv] gt(test.t2.b, 100), not(isnull(test.t2.a))", + " │ │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_26(Probe) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_29(Probe) 3.00 root data:Selection_28", + " └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 x JOIN t1 y ON x.a = y.b ORDER BY x.a, y.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t1.b)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.b))", - " │ └─TableFullScan 3.00 cop[tikv] table:y keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:x keep order:false" + "Sort_8 3.00 root test.t1.a, test.t1.a", + "└─HashJoin_11 3.00 root inner join, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader_18(Build) 3.00 root data:Selection_17", + " │ └─Selection_17 3.00 cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan_16 3.00 cop[tikv] table:y keep order:false", + " └─TableReader_15(Probe) 3.00 root data:Selection_14", + " └─Selection_14 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_13 3.00 cop[tikv] table:x keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 x LEFT JOIN t1 y ON x.a = y.b JOIN t2 ON x.a = t2.a ORDER BY x.a, t2.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t2.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t1.b)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.b))", - " │ └─TableFullScan 3.00 cop[tikv] table:y keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:x keep order:false" + "Sort_12 3.00 root test.t1.a, test.t2.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " └─HashJoin_17(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t1.b)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:y keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:x keep order:false" ], "Result": [ "1 10 1 100", @@ -923,18 +923,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t1.a = t3.a ORDER BY t1.a, t3.a", "Plan": [ - "Sort 3.00 root test.t1.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_12 3.00 root test.t1.a, test.t3.a", + "└─HashJoin_16 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin_17(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " │ ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_21(Probe) 3.00 root data:Selection_20", + " │ └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_27(Probe) 3.00 root data:Selection_26", + " └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -944,18 +944,18 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a AND t1.b > t2.b JOIN t3 ON t2.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort 3.00 root test.t2.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)], other cond:gt(test.t1.b, test.t2.b)", - " │ ├─TableReader(Build) 3.00 root data:Selection", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_11 3.00 root test.t2.a, test.t3.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─HashJoin_16(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)], other cond:gt(test.t1.b, test.t2.b)", + " │ ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_20(Probe) 3.00 root data:Selection_19", + " │ └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_26(Probe) 3.00 root data:Selection_25", + " └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ " 1 100 1 1000" @@ -964,17 +964,17 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t1.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort 3.00 root test.t2.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_11 3.00 root test.t2.a", + "└─HashJoin_15 3.00 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin_16(Build) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_22(Build) 3.00 root data:TableFullScan_21", + " │ │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_20(Probe) 3.00 root data:Selection_19", + " │ └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:Selection_24", + " └─Selection_24 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_23 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -985,18 +985,18 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a ORDER BY t2.a, t3.a", "Plan": [ - "Sort 3.00 root test.t2.a, test.t3.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 3.00 root test.t2.a, test.t3.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1005,18 +1005,18 @@ { "SQL": "SELECT * FROM t2 JOIN t3 ON t2.a = t3.a LEFT JOIN t1 ON t1.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort 3.00 root test.t2.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t3.a, test.t1.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false" + "Sort_11 3.00 root test.t2.a", + "└─HashJoin_14 3.00 root left outer join, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false", + " └─HashJoin_16(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t3 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t2 keep order:false" ], "Result": [ "1 100 1 1000 1 10" @@ -1025,20 +1025,20 @@ { "SQL": "SELECT t1.a, COUNT(*) FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.a = t3.a GROUP BY t1.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─Projection 3.00 root test.t1.a, Column#10", - " └─HashAgg 3.00 root group by:test.t1.a, funcs:count(1)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", - " └─HashJoin 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 3.00 root test.t1.a", + "└─Projection_14 3.00 root test.t1.a, Column#10", + " └─HashAgg_15 3.00 root group by:test.t1.a, funcs:count(1)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " └─HashJoin_16 3.00 root left outer join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_26 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_18(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_25(Build) 3.00 root data:Selection_24", + " │ └─Selection_24 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_22(Probe) 3.00 root data:Selection_21", + " └─Selection_21 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_20 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 1", @@ -1048,18 +1048,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a LIMIT 2", "Plan": [ - "TopN 2.00 root test.t1.a, offset:0, count:2", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "TopN_17 2.00 root test.t1.a, offset:0, count:2", + "└─HashJoin_22 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_34(Build) 3.00 root data:Selection_33", + " │ └─Selection_33 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_32 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_24(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_31(Build) 3.00 root data:Selection_30", + " │ └─Selection_30 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_29 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_28(Probe) 3.00 root data:Selection_27", + " └─Selection_27 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_26 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1068,18 +1068,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", "Plan": [ - "Sort 2.40 root test.t1.a", - "└─HashJoin 2.40 root semi join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_13 2.40 root test.t1.a", + "└─HashJoin_16 2.40 root semi join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100" @@ -1088,16 +1088,16 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT EXISTS (SELECT 1 FROM t3 WHERE t3.a = t1.a) ORDER BY t1.a", "Plan": [ - "Sort 2.40 root test.t1.a", - "└─HashJoin 2.40 root anti semi join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:TableFullScan", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:TableFullScan", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_12 2.40 root test.t1.a", + "└─HashJoin_15 2.40 root anti semi join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_24(Build) 3.00 root data:TableFullScan_23", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_16(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_22(Build) 3.00 root data:Selection_21", + " │ └─Selection_21 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_20 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_19(Probe) 3.00 root data:TableFullScan_18", + " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "2 20 2 200" @@ -1106,19 +1106,19 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a WHERE t1.a IN (SELECT a FROM t3) ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashAgg(Build) 3.00 root group by:test.t3.a, funcs:firstrow(test.t3.a)->test.t3.a", - " │ └─TableReader 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_15 3.00 root test.t1.a", + "└─HashJoin_18 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashAgg_30(Build) 3.00 root group by:test.t3.a, funcs:firstrow(test.t3.a)->test.t3.a", + " │ └─TableReader_37 3.00 root data:Selection_36", + " │ └─Selection_36 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_35 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_20(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100" @@ -1127,36 +1127,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a WHERE t1.b > 10 OR t2.b > 150 ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:or(gt(test.t1.b, 10), gt(test.t2.b, 150))", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_13 3.00 root test.t1.a", + "└─HashJoin_16 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_26 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_18(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:or(gt(test.t1.b, 10), gt(test.t2.b, 150))", + " ├─TableReader_25(Build) 3.00 root data:Selection_24", + " │ └─Selection_24 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_22(Probe) 3.00 root data:Selection_21", + " └─Selection_21 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_20 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a AND (t2.b > 100 OR t2.b < 50) JOIN t3 ON t1.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) 2.00 root data:Selection", - " │ │ └─Selection 2.00 cop[tikv] not(isnull(test.t2.a)), or(gt(test.t2.b, 100), lt(test.t2.b, 50))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t3.a))", - " └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false" + "Sort_11 3.00 root test.t1.a", + "└─HashJoin_15 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─HashJoin_16(Build) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_23(Build) 2.00 root data:Selection_22", + " │ │ └─Selection_22 2.00 cop[tikv] not(isnull(test.t2.a)), or(gt(test.t2.b, 100), lt(test.t2.b, 50))", + " │ │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_20(Probe) 3.00 root data:Selection_19", + " │ └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_26(Probe) 3.00 root data:Selection_25", + " └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", + " └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false" ], "Result": [ "1 10 1 1000", @@ -1166,36 +1166,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.b = t2.b LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.b, test.t2.b)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.b))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.b))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 3.00 root test.t1.a", + "└─HashJoin_14 3.00 root left outer join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_16(Probe) 3.00 root inner join, equal:[eq(test.t1.b, test.t2.b)]", + " ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.b))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.b))", + " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a LEFT JOIN t3 ON t2.b = t3.b ORDER BY t1.a", "Plan": [ - "Sort 3.00 root test.t1.a", - "└─HashJoin 3.00 root left outer join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - " │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) 3.00 root data:Selection", - " │ └─Selection 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) 3.00 root data:Selection", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 3.00 cop[tikv] table:t1 keep order:false" + "Sort_11 3.00 root test.t1.a", + "└─HashJoin_14 3.00 root left outer join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.b))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_16(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 ", @@ -1203,5 +1203,409 @@ ] } ] + }, + { + "Name": "TestJoinReorderPushSelection", + "Cases": [ + { + "SQL": "explain format = 'plan_tree' select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "Plan": [ + "Projection root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", + "└─Selection root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", + " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t3.id, right key:test.t4.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t3.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t3 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t2 keep order:true", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain format = 'plan_tree' select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "Plan": [ + "Projection root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", + "└─MergeJoin root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t2 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t3.id, right key:test.t1.id, other cond:or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t1 keep order:true", + " └─MergeJoin(Probe) root left outer join, left side:TableReader, left key:test.t3.id, right key:test.t4.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:true", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t3 keep order:true" + ] + }, + { + "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", + "Plan": [ + "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", + "└─Selection root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", + " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t3 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t2 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t4.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:true", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain format = 'plan_tree' select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", + "Plan": [ + "MergeJoin root semi join, left side:TableReader, left key:test.t1.id, right key:test.t2.id", + "├─MergeJoin(Build) root inner join, left key:test.t2.id, right key:test.t5.id", + "│ ├─TableReader(Build) root data:TableFullScan", + "│ │ └─TableFullScan cop[tikv] table:t5 keep order:true", + "│ └─Selection(Probe) root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", + "│ └─IndexJoin root left outer join, inner:TableReader, left side:MergeJoin, outer key:test.t3.id, inner key:test.t4.id, equal cond:eq(test.t3.id, test.t4.id)", + "│ ├─MergeJoin(Build) root inner join, left key:test.t2.id, right key:test.t3.id", + "│ │ ├─TableReader(Build) root data:TableFullScan", + "│ │ │ └─TableFullScan cop[tikv] table:t3 keep order:true", + "│ │ └─TableReader(Probe) root data:TableFullScan", + "│ │ └─TableFullScan cop[tikv] table:t2 keep order:true", + "│ └─TableReader(Probe) root data:TableRangeScan", + "│ └─TableRangeScan cop[tikv] table:t4 range: decided by [test.t3.id], keep order:false", + "└─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", + "Plan": [ + "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", + "└─HashJoin root inner join, equal:[eq(test.t4.id, test.t1.id)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─Selection(Probe) root or(like(test.t2.name, \"test2\", 92), or(like(test.t3.name, \"test3\", 92), lt(rand(), 0.5)))", + " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t3 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t2 keep order:true", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", + "Plan": [ + "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", + "└─HashJoin root inner join, equal:[eq(test.t4.id, test.t1.id)]", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─Selection(Probe) root or(like(test.t2.name, \"test2\", 92), or(like(test.t3.name, \"test3\", 92), eq(sleep(0), 0)))", + " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t3 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t2 keep order:true", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id", + "Plan": [ + "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.name, test.t5.id, test.t5.name", + "└─Selection root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", + " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t3 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t2 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t4.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t4 keep order:true", + " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t5.id", + " ├─TableReader(Build) root data:TableFullScan", + " │ └─TableFullScan cop[tikv] table:t5 keep order:true", + " └─TableReader(Probe) root data:TableFullScan", + " └─TableFullScan cop[tikv] table:t1 keep order:true" + ] + } + ] + }, + { + "Name": "TestDPJoinReorder", + "Cases": [ + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100", + "2 20 2 200" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan cop[tikv] table:t5 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t2 JOIN t1 ON t2.a = t1.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t2.a = t4.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan cop[tikv] table:t2 keep order:false" + ], + "Result": [ + "1 100 1 10 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan cop[tikv] table:t1 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t3.b))", + " └─TableFullScan cop[tikv] table:t3 keep order:false" + ], + "Result": null + }, + { + "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t3.b > 0 ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root CARTESIAN inner join", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] gt(test.t3.b, 0)", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000", + "1 10 1 100 3 3000", + "1 10 1 100 5 5000", + "2 20 2 200 1 1000", + "2 20 2 200 3 3000", + "2 20 2 200 5 5000" + ] + }, + { + "SQL": "SELECT /*+ set_var(tidb_opt_cartesian_join_order_threshold=0) */ * FROM (t1 JOIN t2 ON t1.a = t2.a), (t3 JOIN t4 ON t3.a = t4.a) ORDER BY t1.a, t3.a", + "Plan": [ + "Sort root test.t1.a, test.t3.a", + "└─HashJoin root CARTESIAN inner join", + " ├─HashJoin(Build) root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " │ ├─TableReader(Build) root data:Selection", + " │ │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " │ └─TableReader(Probe) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + "2 20 2 200 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a", + "Plan": [ + "Sort root test.t2.a", + "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", + "Plan": [ + "Sort root test.t1.a", + "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan cop[tikv] table:t4 keep order:false", + " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan cop[tikv] table:t3 keep order:false", + " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader(Build) root data:Selection", + " │ └─Selection cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan cop[tikv] table:t2 keep order:false", + " └─TableReader(Probe) root data:Selection", + " └─Selection cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + "3 30 3 3000 " + ] + } + ] } ] From 5b2b20e514fb6f2cdb6cdf16c80ce3d40bdd6329 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 11:51:15 +0800 Subject: [PATCH 15/25] fix Signed-off-by: guo-shaoge --- .../core/casetest/rule/rule_cdc_join_reorder_test.go | 2 -- pkg/planner/core/rule_join_reorder.go | 11 ++++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go index 978d0b6e00998..03fb35d6eba59 100644 --- a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go +++ b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go @@ -21,7 +21,6 @@ import ( "github.com/pingcap/tidb/pkg/testkit" "github.com/pingcap/tidb/pkg/testkit/testdata" - "github.com/pingcap/tidb/pkg/testkit/testfailpoint" "github.com/stretchr/testify/require" ) @@ -67,7 +66,6 @@ func TestCDCJoinReorder(t *testing.T) { // Phase 2: Enable CD-C algorithm, then verify both the plan and the // result correctness for every case. tk.MustExec("set @@tidb_opt_enable_advanced_join_reorder = 1") - testfailpoint.Enable(t, "github.com/pingcap/tidb/pkg/planner/core/enableCDCJoinReorder", `return(true)`) for i, sql := range input { testdata.OnRecord(func() { diff --git a/pkg/planner/core/rule_join_reorder.go b/pkg/planner/core/rule_join_reorder.go index 6b09285bf35bd..40fdcdca0e41f 100644 --- a/pkg/planner/core/rule_join_reorder.go +++ b/pkg/planner/core/rule_join_reorder.go @@ -20,7 +20,6 @@ import ( "fmt" "slices" - "github.com/pingcap/failpoint" "github.com/pingcap/tidb/pkg/expression" "github.com/pingcap/tidb/pkg/parser/ast" "github.com/pingcap/tidb/pkg/planner/core/base" @@ -281,12 +280,10 @@ type joinTypeWithExtMsg struct { // Optimize implements the base.LogicalOptRule.<0th> interface. func (s *JoinReOrderSolver) Optimize(_ context.Context, p base.LogicalPlan, opt *optimizetrace.LogicalOptimizeOp) (base.LogicalPlan, bool, error) { - failpoint.Inject("enableCDCJoinReorder", func(val failpoint.Value) { - if val.(bool) { - p2, err := joinorder.Optimize(p) - failpoint.Return(p2, false, err) - } - }) + if p.SCtx().GetSessionVars().TiDBOptEnableAdvancedJoinReorder { + p, err := joinorder.Optimize(p) + return p, false, err + } planChanged := false tracer := &joinReorderTrace{cost: map[string]float64{}, opt: opt} tracer.traceJoinReorder(p) From e01d61912554e2cc3478286c9531d2f6305a2e52 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 12:10:17 +0800 Subject: [PATCH 16/25] update Signed-off-by: guo-shaoge --- .../rule/testdata/cdc_join_reorder_suite_in.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json index 68ff7b71fb7ca..e0f4d47c96d6f 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json @@ -247,13 +247,13 @@ { "name": "TestJoinReorderPushSelection", "cases": [ - "explain format = 'plan_tree' select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", - "explain format = 'plan_tree' select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", - "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", - "explain format = 'plan_tree' select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", - "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", - "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", - "explain format = 'plan_tree' select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id" + "explain select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "explain select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", + "explain select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", + "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", + "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", + "explain select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id" ] }, { From 3f2a5c6883910e57e15bdfd0c7527e0aaada3e09 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 12:29:07 +0800 Subject: [PATCH 17/25] update Signed-off-by: guo-shaoge --- .../testdata/cdc_join_reorder_suite_out.json | 255 +++++++++--------- 1 file changed, 128 insertions(+), 127 deletions(-) diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json index 4a2a6dcb98b4f..6056ca44195f8 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json @@ -1208,133 +1208,134 @@ "Name": "TestJoinReorderPushSelection", "Cases": [ { - "SQL": "explain format = 'plan_tree' select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", - "Plan": [ - "Projection root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", - "└─Selection root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", - " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t3.id, right key:test.t4.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t3.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t3 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t2 keep order:true", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:true" - ] - }, - { - "SQL": "explain format = 'plan_tree' select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", - "Plan": [ - "Projection root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", - "└─MergeJoin root inner join, left key:test.t1.id, right key:test.t2.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t2 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t3.id, right key:test.t1.id, other cond:or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t1 keep order:true", - " └─MergeJoin(Probe) root left outer join, left side:TableReader, left key:test.t3.id, right key:test.t4.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:true", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t3 keep order:true" - ] - }, - { - "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", - "Plan": [ - "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", - "└─Selection root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", - " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t3 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t2 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t4.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:true", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:true" - ] - }, - { - "SQL": "explain format = 'plan_tree' select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", - "Plan": [ - "MergeJoin root semi join, left side:TableReader, left key:test.t1.id, right key:test.t2.id", - "├─MergeJoin(Build) root inner join, left key:test.t2.id, right key:test.t5.id", - "│ ├─TableReader(Build) root data:TableFullScan", - "│ │ └─TableFullScan cop[tikv] table:t5 keep order:true", - "│ └─Selection(Probe) root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", - "│ └─IndexJoin root left outer join, inner:TableReader, left side:MergeJoin, outer key:test.t3.id, inner key:test.t4.id, equal cond:eq(test.t3.id, test.t4.id)", - "│ ├─MergeJoin(Build) root inner join, left key:test.t2.id, right key:test.t3.id", - "│ │ ├─TableReader(Build) root data:TableFullScan", - "│ │ │ └─TableFullScan cop[tikv] table:t3 keep order:true", - "│ │ └─TableReader(Probe) root data:TableFullScan", - "│ │ └─TableFullScan cop[tikv] table:t2 keep order:true", - "│ └─TableReader(Probe) root data:TableRangeScan", - "│ └─TableRangeScan cop[tikv] table:t4 range: decided by [test.t3.id], keep order:false", - "└─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:true" - ] - }, - { - "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", - "Plan": [ - "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", - "└─HashJoin root inner join, equal:[eq(test.t4.id, test.t1.id)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─Selection(Probe) root or(like(test.t2.name, \"test2\", 92), or(like(test.t3.name, \"test3\", 92), lt(rand(), 0.5)))", - " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t3 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t2 keep order:true", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:true" - ] - }, - { - "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", - "Plan": [ - "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", - "└─HashJoin root inner join, equal:[eq(test.t4.id, test.t1.id)]", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─Selection(Probe) root or(like(test.t2.name, \"test2\", 92), or(like(test.t3.name, \"test3\", 92), eq(sleep(0), 0)))", - " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t3 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t2 keep order:true", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:true" - ] - }, - { - "SQL": "explain format = 'plan_tree' select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id", - "Plan": [ - "Projection root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.name, test.t5.id, test.t5.name", - "└─Selection root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", - " └─MergeJoin root left outer join, left side:MergeJoin, left key:test.t2.id, right key:test.t3.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t3 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t2.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t2 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t4.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t4 keep order:true", - " └─MergeJoin(Probe) root inner join, left key:test.t1.id, right key:test.t5.id", - " ├─TableReader(Build) root data:TableFullScan", - " │ └─TableFullScan cop[tikv] table:t5 keep order:true", - " └─TableReader(Probe) root data:TableFullScan", - " └─TableFullScan cop[tikv] table:t1 keep order:true" + "SQL": "explain select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "Plan": [ + "Projection_19 2.40 root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", + "└─Selection_20 2.40 root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", + " └─MergeJoin_21 3.00 root left outer join, left key:test.t3.id, right key:test.t4.id", + " ├─TableReader_51(Build) 3.00 root data:TableFullScan_50", + " │ └─TableFullScan_50 3.00 cop[tikv] table:t4 keep order:true", + " └─MergeJoin_33(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t3.id", + " ├─TableReader_49(Build) 3.00 root data:TableFullScan_48", + " │ └─TableFullScan_48 3.00 cop[tikv] table:t3 keep order:true", + " └─MergeJoin_34(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader_47(Build) 3.00 root data:TableFullScan_46", + " │ └─TableFullScan_46 3.00 cop[tikv] table:t2 keep order:true", + " └─TableReader_45(Probe) 3.00 root data:TableFullScan_44", + " └─TableFullScan_44 3.00 cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "Plan": [ + "Projection_19 2.40 root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", + "└─MergeJoin_20 2.40 root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader_51(Build) 3.00 root data:TableFullScan_50", + " │ └─TableFullScan_50 3.00 cop[tikv] table:t2 keep order:true", + " └─MergeJoin_32(Probe) 2.40 root inner join, left key:test.t3.id, right key:test.t1.id", + " ├─TableReader_49(Build) 3.00 root data:TableFullScan_48", + " │ └─TableFullScan_48 3.00 cop[tikv] table:t1 keep order:true", + " └─Selection_33(Probe) 2.40 root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", + " └─MergeJoin_34 3.00 root left outer join, left key:test.t3.id, right key:test.t4.id", + " ├─TableReader_47(Build) 3.00 root data:TableFullScan_46", + " │ └─TableFullScan_46 3.00 cop[tikv] table:t4 keep order:true", + " └─TableReader_45(Probe) 3.00 root data:TableFullScan_44", + " └─TableFullScan_44 3.00 cop[tikv] table:t3 keep order:true" + ] + }, + { + "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", + "Plan": [ + "Projection_19 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", + "└─Selection_20 2.40 root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", + " └─MergeJoin_21 3.00 root left outer join, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader_51(Build) 3.00 root data:TableFullScan_50", + " │ └─TableFullScan_50 3.00 cop[tikv] table:t3 keep order:true", + " └─MergeJoin_33(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader_49(Build) 3.00 root data:TableFullScan_48", + " │ └─TableFullScan_48 3.00 cop[tikv] table:t2 keep order:true", + " └─MergeJoin_34(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t4.id", + " ├─TableReader_47(Build) 3.00 root data:TableFullScan_46", + " │ └─TableFullScan_46 3.00 cop[tikv] table:t4 keep order:true", + " └─TableReader_45(Probe) 3.00 root data:TableFullScan_44", + " └─TableFullScan_44 3.00 cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", + "Plan": [ + "MergeJoin_24 2.40 root semi join, left key:test.t1.id, right key:test.t2.id", + "├─MergeJoin_28(Build) 2.40 root inner join, left key:test.t2.id, right key:test.t5.id", + "│ ├─TableReader_63(Build) 3.00 root data:TableFullScan_62", + "│ │ └─TableFullScan_62 3.00 cop[tikv] table:t5 keep order:true", + "│ └─Selection_38(Probe) 2.40 root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", + "│ └─IndexJoin_44 3.00 root left outer join, inner:TableReader_41, outer key:test.t3.id, inner key:test.t4.id, equal cond:eq(test.t3.id, test.t4.id)", + "│ ├─MergeJoin_48(Build) 3.00 root inner join, left key:test.t2.id, right key:test.t3.id", + "│ │ ├─TableReader_61(Build) 3.00 root data:TableFullScan_60", + "│ │ │ └─TableFullScan_60 3.00 cop[tikv] table:t3 keep order:true", + "│ │ └─TableReader_59(Probe) 3.00 root data:TableFullScan_58", + "│ │ └─TableFullScan_58 3.00 cop[tikv] table:t2 keep order:true", + "│ └─TableReader_41(Probe) 3.00 root data:TableRangeScan_40", + "│ └─TableRangeScan_40 3.00 cop[tikv] table:t4 range: decided by [test.t3.id], keep order:false", + "└─TableReader_27(Probe) 3.00 root data:TableFullScan_26", + " └─TableFullScan_26 3.00 cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", + "Plan": [ + "Projection_18 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", + "└─HashJoin_30 2.40 root inner join, equal:[eq(test.t4.id, test.t1.id)]", + " ├─TableReader_110(Build) 3.00 root data:TableFullScan_109", + " │ └─TableFullScan_109 3.00 cop[tikv] table:t4 keep order:false", + " └─Selection_57(Probe) 2.40 root or(like(test.t2.name, \"test2\", 92), or(like(test.t3.name, \"test3\", 92), lt(rand(), 0.5)))", + " └─MergeJoin_58 3.00 root left outer join, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader_81(Build) 3.00 root data:TableFullScan_80", + " │ └─TableFullScan_80 3.00 cop[tikv] table:t3 keep order:true", + " └─MergeJoin_70(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader_56(Build) 3.00 root data:TableFullScan_55", + " │ └─TableFullScan_55 3.00 cop[tikv] table:t2 keep order:true", + " └─TableReader_54(Probe) 3.00 root data:TableFullScan_53", + " └─TableFullScan_53 3.00 cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", + "Plan": [ + "Projection_18 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", + "└─HashJoin_30 2.40 root inner join, equal:[eq(test.t4.id, test.t1.id)]", + " ├─TableReader_110(Build) 3.00 root data:TableFullScan_109", + " │ └─TableFullScan_109 3.00 cop[tikv] table:t4 keep order:false", + " └─Selection_57(Probe) 2.40 root or(like(test.t2.name, \"test2\", 92), or(like(test.t3.name, \"test3\", 92), eq(sleep(0), 0)))", + " └─MergeJoin_58 3.00 root left outer join, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader_81(Build) 3.00 root data:TableFullScan_80", + " │ └─TableFullScan_80 3.00 cop[tikv] table:t3 keep order:true", + " └─MergeJoin_70(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader_56(Build) 3.00 root data:TableFullScan_55", + " │ └─TableFullScan_55 3.00 cop[tikv] table:t2 keep order:true", + " └─TableReader_54(Probe) 3.00 root data:TableFullScan_53", + " └─TableFullScan_53 3.00 cop[tikv] table:t1 keep order:true" + ] + }, + { + "SQL": "explain select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id", + "Plan": [ + "Projection_24 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.name, test.t5.id, test.t5.name", + "└─Selection_25 2.40 root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", + " └─MergeJoin_26 3.00 root left outer join, left key:test.t2.id, right key:test.t3.id", + " ├─TableReader_68(Build) 3.00 root data:TableFullScan_67", + " │ └─TableFullScan_67 3.00 cop[tikv] table:t3 keep order:true", + " └─MergeJoin_38(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader_66(Build) 3.00 root data:TableFullScan_65", + " │ └─TableFullScan_65 3.00 cop[tikv] table:t2 keep order:true", + " └─MergeJoin_39(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t4.id", + " ├─TableReader_64(Build) 3.00 root data:TableFullScan_63", + " │ └─TableFullScan_63 3.00 cop[tikv] table:t4 keep order:true", + " └─MergeJoin_49(Probe) 3.00 root inner join, left key:test.t1.id, right key:test.t5.id", + " ├─TableReader_62(Build) 3.00 root data:TableFullScan_61", + " │ └─TableFullScan_61 3.00 cop[tikv] table:t5 keep order:true", + " └─TableReader_60(Probe) 3.00 root data:TableFullScan_59", + " └─TableFullScan_59 3.00 cop[tikv] table:t1 keep order:true" ] } ] From e93116522c17e89c19b1d584a977c2b8290d7e56 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 13:09:02 +0800 Subject: [PATCH 18/25] update Signed-off-by: guo-shaoge --- .../rule/rule_cdc_join_reorder_test.go | 4 +- .../testdata/cdc_join_reorder_suite_in.json | 14 +- .../testdata/cdc_join_reorder_suite_out.json | 342 +++++++++--------- 3 files changed, 180 insertions(+), 180 deletions(-) diff --git a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go index 978d0b6e00998..50830e092061c 100644 --- a/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go +++ b/pkg/planner/core/casetest/rule/rule_cdc_join_reorder_test.go @@ -197,10 +197,10 @@ func TestDPJoinReorder(t *testing.T) { for i, sql := range input { testdata.OnRecord(func() { output[i].SQL = sql - output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN " + sql).Rows()) + output[i].Plan = testdata.ConvertRowsToStrings(tk.MustQuery("EXPLAIN " + sql).Rows()) output[i].Result = testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) }) - tk.MustQuery("EXPLAIN " + sql).Check(testkit.Rows(output[i].Plan...)) + tk.MustQuery("EXPLAIN " + sql).Check(testkit.Rows(output[i].Plan...)) dpResult := testdata.ConvertRowsToStrings(tk.MustQuery(sql).Rows()) require.Equalf(t, greedyResults[i], dpResult, diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json index e0f4d47c96d6f..a1da3218e295b 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_in.json @@ -247,13 +247,13 @@ { "name": "TestJoinReorderPushSelection", "cases": [ - "explain select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", - "explain select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", - "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", - "explain select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", - "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", - "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", - "explain select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id" + "explain select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "explain select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", + "explain select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", + "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", + "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", + "explain select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id" ] }, { diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json index 6056ca44195f8..4c1afb338c309 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json @@ -1208,7 +1208,7 @@ "Name": "TestJoinReorderPushSelection", "Cases": [ { - "SQL": "explain select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "SQL": "explain select /*+ leading(t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", "Plan": [ "Projection_19 2.40 root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", "└─Selection_20 2.40 root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", @@ -1226,7 +1226,7 @@ ] }, { - "SQL": "explain select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", + "SQL": "explain select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", "Plan": [ "Projection_19 2.40 root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", "└─MergeJoin_20 2.40 root inner join, left key:test.t1.id, right key:test.t2.id", @@ -1244,7 +1244,7 @@ ] }, { - "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", + "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub inner join t4 on sub.id=t4.id", "Plan": [ "Projection_19 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", "└─Selection_20 2.40 root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", @@ -1262,7 +1262,7 @@ ] }, { - "SQL": "explain select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", + "SQL": "explain select * from t1 where exists (select 1 from t2 inner join t3 on t2.id=t3.id left join t4 on t4.id=t3.id join t5 on t2.id=t5.id where (t3.name like 'test3' or t4.name like 'test4') and t2.id = t1.id)", "Plan": [ "MergeJoin_24 2.40 root semi join, left key:test.t1.id, right key:test.t2.id", "├─MergeJoin_28(Build) 2.40 root inner join, left key:test.t2.id, right key:test.t5.id", @@ -1282,7 +1282,7 @@ ] }, { - "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", + "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or rand() < 0.5) sub inner join t4 on sub.id=t4.id", "Plan": [ "Projection_18 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", "└─HashJoin_30 2.40 root inner join, equal:[eq(test.t4.id, test.t1.id)]", @@ -1300,7 +1300,7 @@ ] }, { - "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", + "SQL": "explain select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3' or sleep(0) = 0) sub inner join t4 on sub.id=t4.id", "Plan": [ "Projection_18 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.id, test.t4.name", "└─HashJoin_30 2.40 root inner join, equal:[eq(test.t4.id, test.t1.id)]", @@ -1318,7 +1318,7 @@ ] }, { - "SQL": "explain select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id", + "SQL": "explain select /*+ leading(t1@sel_3, t5, t4@sel_2, t2@sel_3, t3@sel_3) */ * from (select sub1.id, sub1.n1, sub1.n2, sub1.n3, t4.name as n4 from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub1 inner join t4 on sub1.id=t4.id) sub2 inner join t5 on sub2.id=t5.id", "Plan": [ "Projection_24 2.40 root test.t1.id, test.t1.name, test.t2.name, test.t3.name, test.t4.name, test.t5.id, test.t5.name", "└─Selection_25 2.40 root or(like(test.t2.name, \"test2\", 92), like(test.t3.name, \"test3\", 92))", @@ -1346,14 +1346,14 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_8 3.00 root test.t1.a", + "└─HashJoin_11 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_18(Build) 3.00 root data:Selection_17", + " │ └─Selection_17 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_16 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_15(Probe) 3.00 root data:Selection_14", + " └─Selection_14 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_13 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100", @@ -1363,18 +1363,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_14 3.00 root test.t1.a", + "└─HashJoin_17 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_29(Build) 3.00 root data:Selection_28", + " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_19(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_23(Probe) 3.00 root data:Selection_22", + " └─Selection_22 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_21 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1383,22 +1383,22 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_23 3.00 root test.t1.a", + "└─HashJoin_26 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_43(Build) 3.00 root data:Selection_42", + " │ └─Selection_42 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_41 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_28(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_40(Build) 3.00 root data:Selection_39", + " │ └─Selection_39 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_38 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_30(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_37(Build) 3.00 root data:Selection_36", + " │ └─Selection_36 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_35 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_34(Probe) 3.00 root data:Selection_33", + " └─Selection_33 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_32 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000" @@ -1407,48 +1407,48 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan cop[tikv] table:t5 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_36 3.00 root test.t1.a", + "└─HashJoin_39 3.00 root inner join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader_61(Build) 3.00 root data:Selection_60", + " │ └─Selection_60 3.00 cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan_59 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin_41(Probe) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_58(Build) 3.00 root data:Selection_57", + " │ └─Selection_57 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_56 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_43(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_55(Build) 3.00 root data:Selection_54", + " │ └─Selection_54 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_53 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_45(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_52(Build) 3.00 root data:Selection_51", + " │ └─Selection_51 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_50 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_49(Probe) 3.00 root data:Selection_48", + " └─Selection_48 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_47 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t2 JOIN t1 ON t2.a = t1.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t2.a = t4.a ORDER BY t2.a", "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan cop[tikv] table:t2 keep order:false" + "Sort_25 3.00 root test.t2.a", + "└─HashJoin_28 3.00 root inner join, equal:[eq(test.t2.a, test.t4.a)]", + " ├─TableReader_45(Build) 3.00 root data:Selection_44", + " │ └─Selection_44 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_43 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_30(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_42(Build) 3.00 root data:Selection_41", + " │ └─Selection_41 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_40 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_32(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " ├─TableReader_39(Build) 3.00 root data:Selection_38", + " │ └─Selection_38 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_37 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_36(Probe) 3.00 root data:Selection_35", + " └─Selection_35 3.00 cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan_34 3.00 cop[tikv] table:t2 keep order:false" ], "Result": [ "1 100 1 10 1 1000 1 10000" @@ -1457,18 +1457,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_14 3.00 root test.t1.a", + "└─HashJoin_17 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_29(Build) 3.00 root data:Selection_28", + " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_19(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_23(Probe) 3.00 root data:Selection_22", + " └─Selection_22 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan_21 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1477,36 +1477,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan cop[tikv] table:t1 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t3.b))", - " └─TableFullScan cop[tikv] table:t3 keep order:false" + "Sort_14 3.00 root test.t1.a", + "└─HashJoin_18 3.00 root inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─HashJoin_19(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan_24 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_23(Probe) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_29(Probe) 3.00 root data:Selection_28", + " └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.b))", + " └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t3.b > 0 ORDER BY t1.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root CARTESIAN inner join", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] gt(test.t3.b, 0)", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_12 9.00 root test.t1.a, test.t3.a", + "└─HashJoin_15 9.00 root CARTESIAN inner join", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] gt(test.t3.b, 0)", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_24(Build) 3.00 root data:Selection_23", + " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_21(Probe) 3.00 root data:Selection_20", + " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -1520,22 +1520,22 @@ { "SQL": "SELECT /*+ set_var(tidb_opt_cartesian_join_order_threshold=0) */ * FROM (t1 JOIN t2 ON t1.a = t2.a), (t3 JOIN t4 ON t3.a = t4.a) ORDER BY t1.a, t3.a", "Plan": [ - "Sort root test.t1.a, test.t3.a", - "└─HashJoin root CARTESIAN inner join", - " ├─HashJoin(Build) root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " │ ├─TableReader(Build) root data:Selection", - " │ │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " │ └─TableReader(Probe) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_15 9.00 root test.t1.a, test.t3.a", + "└─HashJoin_18 9.00 root CARTESIAN inner join", + " ├─HashJoin_28(Build) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " │ ├─TableReader_35(Build) 3.00 root data:Selection_34", + " │ │ └─Selection_34 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ │ └─TableFullScan_33 3.00 cop[tikv] table:t4 keep order:false", + " │ └─TableReader_32(Probe) 3.00 root data:Selection_31", + " │ └─Selection_31 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_30 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_20(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_27(Build) 3.00 root data:Selection_26", + " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_25 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_24(Probe) 3.00 root data:Selection_23", + " └─Selection_23 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", @@ -1545,18 +1545,18 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_13 3.00 root test.t1.a", + "└─HashJoin_16 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_26 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_18(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_25(Build) 3.00 root data:Selection_24", + " │ └─Selection_24 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_22(Probe) 3.00 root data:Selection_21", + " └─Selection_21 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_20 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1565,18 +1565,18 @@ { "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort root test.t2.a", - "└─HashJoin root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root right outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_11 3.00 root test.t2.a", + "└─HashJoin_14 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_26(Build) 3.00 root data:Selection_25", + " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_16(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_23(Build) 3.00 root data:Selection_22", + " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_20(Probe) 3.00 root data:Selection_19", + " └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1585,22 +1585,22 @@ { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort root test.t1.a", - "└─HashJoin root left outer join, left side:HashJoin, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan cop[tikv] table:t4 keep order:false", - " └─HashJoin(Probe) root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan cop[tikv] table:t3 keep order:false", - " └─HashJoin(Probe) root left outer join, left side:TableReader, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader(Build) root data:Selection", - " │ └─Selection cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan cop[tikv] table:t2 keep order:false", - " └─TableReader(Probe) root data:Selection", - " └─Selection cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan cop[tikv] table:t1 keep order:false" + "Sort_15 3.00 root test.t1.a", + "└─HashJoin_18 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_35(Build) 3.00 root data:Selection_34", + " │ └─Selection_34 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_33 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_20(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_32(Build) 3.00 root data:Selection_31", + " │ └─Selection_31 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_30 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_22(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_29(Build) 3.00 root data:Selection_28", + " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_27 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_26(Probe) 3.00 root data:Selection_25", + " └─Selection_25 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", From 4c94c2c16d1b3c8a1bc3436690551d472f846ccf Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 14:55:38 +0800 Subject: [PATCH 19/25] case Signed-off-by: guo-shaoge --- .../testdata/binary_plan_suite_out.json | 18 +- .../cbotest/testdata/analyze_suite_out.json | 2 +- .../testdata/enforce_mpp_suite_out.json | 56 +-- .../hint/testdata/integration_suite_out.json | 4 +- .../rule/testdata/join_reorder_suite_out.json | 472 +++++++++--------- .../rule/testdata/outer2inner_out.json | 10 +- .../tpch/testdata/tpch_suite_out.json | 124 ++--- 7 files changed, 333 insertions(+), 353 deletions(-) diff --git a/pkg/planner/core/casetest/binaryplan/testdata/binary_plan_suite_out.json b/pkg/planner/core/casetest/binaryplan/testdata/binary_plan_suite_out.json index c0922ef36b0d6..ead01b41a4403 100644 --- a/pkg/planner/core/casetest/binaryplan/testdata/binary_plan_suite_out.json +++ b/pkg/planner/core/casetest/binaryplan/testdata/binary_plan_suite_out.json @@ -68,19 +68,19 @@ "SQL": "explain analyze format = 'binary' select sum(t.a) from t join t2", "BinaryPlan": { "main": { - "name": "HashAgg_8", + "name": "HashAgg_9", "children": [ { - "name": "Projection_20", + "name": "Projection_21", "children": [ { - "name": "HashJoin_10", + "name": "HashJoin_11", "children": [ { - "name": "IndexReader_15", + "name": "IndexReader_16", "children": [ { - "name": "IndexFullScan_14", + "name": "IndexFullScan_15", "cost": 1628000, "est_rows": 10000, "act_rows": 2, @@ -97,13 +97,13 @@ "act_rows": 2, "task_type": 1, "store_type": 1, - "operator_info": "index:IndexFullScan_14" + "operator_info": "index:IndexFullScan_15" }, { - "name": "TableReader_17", + "name": "TableReader_18", "children": [ { - "name": "TableFullScan_16", + "name": "TableFullScan_17", "cost": 4546159.475587022, "est_rows": 10000, "act_rows": 4, @@ -120,7 +120,7 @@ "act_rows": 4, "task_type": 1, "store_type": 1, - "operator_info": "data:TableFullScan_16" + "operator_info": "data:TableFullScan_17" } ], "cost": 1128387.6317058015, diff --git a/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json b/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json index ed3ad30e2e01f..59dcf73574841 100644 --- a/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json +++ b/pkg/planner/core/casetest/cbotest/testdata/analyze_suite_out.json @@ -261,7 +261,7 @@ "│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", "└─IndexReader(Probe) 12475.01 root index:Selection", " └─Selection 12475.01 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.c))", - " └─IndexRangeScan 12500.00 cop[tikv] table:t2, index:idx(a, b, c) range: decided by [eq(test.t2.a, test.t1.a) lt(test.t2.b, plus(test.t1.b, 1)) gt(test.t2.b, minus(test.t1.b, 1))], keep order:false, stats:pseudo" + " └─IndexRangeScan 12500.00 cop[tikv] table:t2, index:idx(a, b, c) range: decided by [eq(test.t2.a, test.t1.a) gt(test.t2.b, minus(test.t1.b, 1)) lt(test.t2.b, plus(test.t1.b, 1))], keep order:false, stats:pseudo" ] }, { diff --git a/pkg/planner/core/casetest/enforcempp/testdata/enforce_mpp_suite_out.json b/pkg/planner/core/casetest/enforcempp/testdata/enforce_mpp_suite_out.json index 8a81daccb8186..97d48c187eb9f 100644 --- a/pkg/planner/core/casetest/enforcempp/testdata/enforce_mpp_suite_out.json +++ b/pkg/planner/core/casetest/enforcempp/testdata/enforce_mpp_suite_out.json @@ -541,13 +541,13 @@ { "SQL": "EXPLAIN SELECT * from t join s; -- 5. cartesian join, cartesian banned.", "Plan": [ - "HashJoin_8 100000000.00 root CARTESIAN inner join", - "├─TableReader_19(Build) 10000.00 root MppVersion: 2, data:ExchangeSender_18", - "│ └─ExchangeSender_18 10000.00 mpp[tiflash] ExchangeType: PassThrough", - "│ └─TableFullScan_17 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo", - "└─TableReader_14(Probe) 10000.00 root MppVersion: 2, data:ExchangeSender_13", - " └─ExchangeSender_13 10000.00 mpp[tiflash] ExchangeType: PassThrough", - " └─TableFullScan_12 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "HashJoin_9 100000000.00 root CARTESIAN inner join", + "├─TableReader_20(Build) 10000.00 root MppVersion: 2, data:ExchangeSender_19", + "│ └─ExchangeSender_19 10000.00 mpp[tiflash] ExchangeType: PassThrough", + "│ └─TableFullScan_18 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo", + "└─TableReader_15(Probe) 10000.00 root MppVersion: 2, data:ExchangeSender_14", + " └─ExchangeSender_14 10000.00 mpp[tiflash] ExchangeType: PassThrough", + " └─TableFullScan_13 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" ], "Warn": [ "MPP mode may be blocked because `Cartesian Product` is only supported by broadcast join, check value and documents of variable `tidb_opt_broadcast_cartesian_join`.", @@ -562,13 +562,13 @@ { "SQL": "EXPLAIN SELECT * from t join s; -- 6. cartesian join, broadcast banned.", "Plan": [ - "HashJoin_8 100000000.00 root CARTESIAN inner join", - "├─TableReader_19(Build) 10000.00 root MppVersion: 2, data:ExchangeSender_18", - "│ └─ExchangeSender_18 10000.00 mpp[tiflash] ExchangeType: PassThrough", - "│ └─TableFullScan_17 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo", - "└─TableReader_14(Probe) 10000.00 root MppVersion: 2, data:ExchangeSender_13", - " └─ExchangeSender_13 10000.00 mpp[tiflash] ExchangeType: PassThrough", - " └─TableFullScan_12 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "HashJoin_9 100000000.00 root CARTESIAN inner join", + "├─TableReader_20(Build) 10000.00 root MppVersion: 2, data:ExchangeSender_19", + "│ └─ExchangeSender_19 10000.00 mpp[tiflash] ExchangeType: PassThrough", + "│ └─TableFullScan_18 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo", + "└─TableReader_15(Probe) 10000.00 root MppVersion: 2, data:ExchangeSender_14", + " └─ExchangeSender_14 10000.00 mpp[tiflash] ExchangeType: PassThrough", + " └─TableFullScan_13 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" ], "Warn": [ "MPP mode may be blocked because `Cartesian Product` is only supported by broadcast join, check value and documents of variables `tidb_broadcast_join_threshold_size` and `tidb_broadcast_join_threshold_count`.", @@ -583,13 +583,13 @@ { "SQL": "EXPLAIN SELECT * from t join s; -- can use mpp", "Plan": [ - "TableReader_29 100000000.00 root MppVersion: 2, data:ExchangeSender_28", - "└─ExchangeSender_28 100000000.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashJoin_27 100000000.00 mpp[tiflash] CARTESIAN inner join", - " ├─ExchangeReceiver_13(Build) 10000.00 mpp[tiflash] ", - " │ └─ExchangeSender_12 10000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─TableFullScan_11 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo", - " └─TableFullScan_14(Probe) 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo" + "TableReader_30 100000000.00 root MppVersion: 2, data:ExchangeSender_29", + "└─ExchangeSender_29 100000000.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin_28 100000000.00 mpp[tiflash] CARTESIAN inner join", + " ├─ExchangeReceiver_14(Build) 10000.00 mpp[tiflash] ", + " │ └─ExchangeSender_13 10000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─TableFullScan_12 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo", + " └─TableFullScan_15(Probe) 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo" ], "Warn": null }, @@ -601,13 +601,13 @@ { "SQL": "EXPLAIN SELECT * from t join s; -- can use mpp", "Plan": [ - "TableReader_29 100000000.00 root MppVersion: 2, data:ExchangeSender_28", - "└─ExchangeSender_28 100000000.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashJoin_27 100000000.00 mpp[tiflash] CARTESIAN inner join", - " ├─ExchangeReceiver_13(Build) 10000.00 mpp[tiflash] ", - " │ └─ExchangeSender_12 10000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─TableFullScan_11 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo", - " └─TableFullScan_14(Probe) 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo" + "TableReader_30 100000000.00 root MppVersion: 2, data:ExchangeSender_29", + "└─ExchangeSender_29 100000000.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin_28 100000000.00 mpp[tiflash] CARTESIAN inner join", + " ├─ExchangeReceiver_14(Build) 10000.00 mpp[tiflash] ", + " │ └─ExchangeSender_13 10000.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─TableFullScan_12 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo", + " └─TableFullScan_15(Probe) 10000.00 mpp[tiflash] table:s keep order:false, stats:pseudo" ], "Warn": null }, diff --git a/pkg/planner/core/casetest/hint/testdata/integration_suite_out.json b/pkg/planner/core/casetest/hint/testdata/integration_suite_out.json index 1e3f29e2bd460..4afe5d81f662e 100644 --- a/pkg/planner/core/casetest/hint/testdata/integration_suite_out.json +++ b/pkg/planner/core/casetest/hint/testdata/integration_suite_out.json @@ -1927,9 +1927,7 @@ " └─TableReader(Probe) 10000.00 root data:TableFullScan", " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], - "Warn": [ - "Warning 1815 leading hint is inapplicable, check if the leading hint table has join conditions with other tables" - ] + "Warn": null } ] } diff --git a/pkg/planner/core/casetest/rule/testdata/join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/join_reorder_suite_out.json index 8d708b18dc310..aeda1f3eb2b60 100644 --- a/pkg/planner/core/casetest/rule/testdata/join_reorder_suite_out.json +++ b/pkg/planner/core/casetest/rule/testdata/join_reorder_suite_out.json @@ -239,21 +239,18 @@ { "SQL": "select /*+ leading(t2, t1, t3) */ * from t2 left join (t1 left join t3 on t1.a=t3.a) on t2.b=t1.b;", "Plan": [ - "HashJoin 15609.38 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", - "├─TableReader(Build) 10000.00 root partition:all data:TableFullScan", - "│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - "└─HashJoin(Probe) 12487.50 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + "HashJoin 15609.38 root left outer join, equal:[eq(test.t1.a, test.t3.a)]", + "├─TableReader(Build) 9990.00 root partition:all data:Selection", + "│ └─Selection 9990.00 cop[tikv] not(isnull(test.t3.a))", + "│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", + "└─HashJoin(Probe) 12487.50 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", " ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", - " └─TableReader(Probe) 9990.00 root partition:all data:Selection", - " └─Selection 9990.00 cop[tikv] not(isnull(test.t1.b))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", + " └─TableReader(Probe) 10000.00 root partition:all data:TableFullScan", + " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" ], - "Warning": [ - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid", - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" - ] + "Warning": null }, { "SQL": "select /*+ leading(t2, t3) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b;", @@ -274,18 +271,17 @@ " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], "Warning": [ - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid", "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" ] }, { "SQL": "select /*+ leading(t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b;", "Plan": [ - "HashJoin 19492.21 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", - "├─TableReader(Build) 10000.00 root partition:all data:TableFullScan", - "│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - "└─Projection(Probe) 15593.77 root test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b", - " └─HashJoin 15593.77 root inner join, equal:[eq(test.t3.a, test.t1.a)]", + "Projection 19492.21 root test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b", + "└─HashJoin 19492.21 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", + " ├─TableReader(Build) 10000.00 root partition:all data:TableFullScan", + " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(test.t3.a, test.t1.a)]", " ├─TableReader(Build) 9980.01 root partition:all data:Selection", " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", @@ -303,60 +299,58 @@ "SQL": "select /*+ leading(t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b;", "Plan": [ "Projection 30426.12 root test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b, test.t5.a, test.t5.b, test.t6.a, test.t6.b", - "└─HashJoin 30426.12 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─Projection(Build) 15593.77 root test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b", - " │ └─HashJoin 15593.77 root inner join, equal:[eq(test.t3.a, test.t1.a)]", - " │ ├─TableReader(Build) 9980.01 root partition:all data:Selection", - " │ │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " │ └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t3.b, test.t4.b)]", - " │ ├─TableReader(Build) 9980.01 root partition:all data:Selection", - " │ │ └─Selection 9980.01 cop[tikv] not(isnull(test.t3.a)), not(isnull(test.t3.b))", - " │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", - " │ └─TableReader(Probe) 9990.00 root partition:all data:Selection", - " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo", - " └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(test.t5.b, test.t6.b)]", - " ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t6.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t5.a, test.t2.a)]", - " ├─TableReader(Build) 9980.01 root partition:all data:Selection", - " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t5.a)), not(isnull(test.t5.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo", - " └─TableReader(Probe) 9990.00 root partition:all data:Selection", - " └─Selection 9990.00 cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" + "└─HashJoin 30426.12 root inner join, equal:[eq(test.t5.b, test.t6.b)]", + " ├─TableReader(Build) 9990.00 root partition:all data:Selection", + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t6.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 24340.89 root inner join, equal:[eq(test.t2.a, test.t5.a)]", + " ├─TableReader(Build) 9980.01 root partition:all data:Selection", + " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t5.a)), not(isnull(test.t5.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 19492.21 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", + " ├─TableReader(Build) 9990.00 root partition:all data:Selection", + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(test.t3.a, test.t1.a)]", + " ├─TableReader(Build) 9980.01 root partition:all data:Selection", + " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t3.b, test.t4.b)]", + " ├─TableReader(Build) 9980.01 root partition:all data:Selection", + " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t3.a)), not(isnull(test.t3.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", + " └─TableReader(Probe) 9990.00 root partition:all data:Selection", + " └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b))", + " └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo" ], "Warning": null }, { "SQL": "select /*+ leading(t3, t4) leading(t5, t6) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b;", "Plan": [ - "Projection 30426.12 root test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b, test.t5.a, test.t5.b, test.t6.a, test.t6.b", - "└─HashJoin 30426.12 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(test.t3.b, test.t4.b)]", - " │ ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ │ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b))", - " │ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo", - " │ └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " │ ├─TableReader(Build) 9980.01 root partition:all data:Selection", - " │ │ └─Selection 9980.01 cop[tikv] not(isnull(test.t3.a)), not(isnull(test.t3.b))", - " │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", - " │ └─TableReader(Probe) 9980.01 root partition:all data:Selection", - " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(test.t5.b, test.t6.b)]", + "HashJoin 30426.12 root inner join, equal:[eq(test.t5.b, test.t6.b)]", + "├─TableReader(Build) 9990.00 root partition:all data:Selection", + "│ └─Selection 9990.00 cop[tikv] not(isnull(test.t6.b))", + "│ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo", + "└─HashJoin(Probe) 24340.89 root inner join, equal:[eq(test.t2.a, test.t5.a)]", + " ├─TableReader(Build) 9980.01 root partition:all data:Selection", + " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t5.a)), not(isnull(test.t5.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 19492.21 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", " ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t6.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t5.a, test.t2.a)]", - " ├─TableReader(Build) 9980.01 root partition:all data:Selection", - " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t5.a)), not(isnull(test.t5.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo", - " └─TableReader(Probe) 9990.00 root partition:all data:Selection", - " └─Selection 9990.00 cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(test.t3.b, test.t4.b)]", + " ├─TableReader(Build) 9990.00 root partition:all data:Selection", + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 9980.01 root partition:all data:Selection", + " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t3.a)), not(isnull(test.t3.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", + " └─TableReader(Probe) 9980.01 root partition:all data:Selection", + " └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], "Warning": [ "Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid" @@ -365,33 +359,31 @@ { "SQL": "select /*+ leading(t5, t6, t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b;", "Plan": [ - "Projection 30426.12 root test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b, test.t5.a, test.t5.b, test.t6.a, test.t6.b", - "└─HashJoin 30426.12 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(test.t3.b, test.t4.b)]", - " │ ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ │ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b))", - " │ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo", - " │ └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " │ ├─TableReader(Build) 9980.01 root partition:all data:Selection", - " │ │ └─Selection 9980.01 cop[tikv] not(isnull(test.t3.a)), not(isnull(test.t3.b))", - " │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", - " │ └─TableReader(Probe) 9980.01 root partition:all data:Selection", - " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(test.t5.b, test.t6.b)]", + "HashJoin 30426.12 root inner join, equal:[eq(test.t5.b, test.t6.b)]", + "├─TableReader(Build) 9990.00 root partition:all data:Selection", + "│ └─Selection 9990.00 cop[tikv] not(isnull(test.t6.b))", + "│ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo", + "└─HashJoin(Probe) 24340.89 root inner join, equal:[eq(test.t2.a, test.t5.a)]", + " ├─TableReader(Build) 9980.01 root partition:all data:Selection", + " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t5.a)), not(isnull(test.t5.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 19492.21 root left outer join, equal:[eq(test.t2.b, test.t1.b)]", " ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t6.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t5.a, test.t2.a)]", - " ├─TableReader(Build) 9980.01 root partition:all data:Selection", - " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t5.a)), not(isnull(test.t5.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo", - " └─TableReader(Probe) 9990.00 root partition:all data:Selection", - " └─Selection 9990.00 cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(test.t3.b, test.t4.b)]", + " ├─TableReader(Build) 9990.00 root partition:all data:Selection", + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader(Build) 9980.01 root partition:all data:Selection", + " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t3.a)), not(isnull(test.t3.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", + " └─TableReader(Probe) 9980.01 root partition:all data:Selection", + " └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], "Warning": [ - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid", "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" ] }, @@ -449,25 +441,25 @@ { "SQL": "select /*+ leading(t1, t3) */ * from t4 join t on t4.a=t.a right join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b=t3.b;", "Plan": [ - "HashJoin 24389.65 root right outer join, equal:[eq(test.t.a, test.t1.a)]", - "├─HashJoin(Build) 12487.50 root inner join, equal:[eq(test.t4.a, test.t.a)]", - "│ ├─TableReader(Build) 9990.00 root partition:all data:Selection", - "│ │ └─Selection 9990.00 cop[tikv] not(isnull(test.t.a))", - "│ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo", - "│ └─TableReader(Probe) 9990.00 root partition:all data:Selection", - "│ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.a))", - "│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo", - "└─HashJoin(Probe) 15609.38 root inner join, equal:[eq(test.t2.b, test.t3.b)]", + "HashJoin 24389.65 root inner join, equal:[eq(test.t2.b, test.t3.b)]", + "├─TableReader(Build) 9990.00 root partition:all data:Selection", + "│ └─Selection 9990.00 cop[tikv] not(isnull(test.t3.b))", + "│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", + "└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(test.t1.b, test.t2.b)]", " ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t3.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(test.t1.b, test.t2.b)]", + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t2.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 15609.38 root right outer join, equal:[eq(test.t.a, test.t1.a)]", " ├─TableReader(Build) 9990.00 root partition:all data:Selection", - " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t2.b))", - " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─TableReader(Probe) 9990.00 root partition:all data:Selection", - " └─Selection 9990.00 cop[tikv] not(isnull(test.t1.b))", - " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(test.t4.a, test.t.a)]", + " ├─TableReader(Build) 9990.00 root partition:all data:Selection", + " │ └─Selection 9990.00 cop[tikv] not(isnull(test.t.a))", + " │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo", + " └─TableReader(Probe) 9990.00 root partition:all data:Selection", + " └─Selection 9990.00 cop[tikv] not(isnull(test.t4.a))", + " └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo" ], "Warning": [ "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" @@ -1100,24 +1092,19 @@ "Plan": [ "TableReader 15609.38 root MppVersion: 2, data:ExchangeSender", "└─ExchangeSender 15609.38 mpp[tiflash] ExchangeType: PassThrough", - " └─HashJoin 15609.38 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", - " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 12487.50 mpp[tiflash] ", - " └─ExchangeSender 12487.50 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", - " └─HashJoin 12487.50 mpp[tiflash] left outer join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t3.a))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo", - " └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t1.b))", - " └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo" + " └─HashJoin 15609.38 mpp[tiflash] left outer join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t3.a))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12487.50 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", + " └─TableFullScan(Probe) 10000.00 mpp[tiflash] table:t2 keep order:false, stats:pseudo" ], - "Warning": [ - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid", - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" - ] + "Warning": null }, { "SQL": "select /*+ leading(t2, t3) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b;", @@ -1144,7 +1131,6 @@ " └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo" ], "Warning": [ - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid", "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" ] }, @@ -1153,13 +1139,13 @@ "Plan": [ "TableReader 19492.21 root MppVersion: 2, data:ExchangeSender", "└─ExchangeSender 19492.21 mpp[tiflash] ExchangeType: PassThrough", - " └─HashJoin 19492.21 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", - " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", - " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", - " └─Projection 15593.77 mpp[tiflash] test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b", + " └─Projection 19492.21 mpp[tiflash] test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b", + " └─HashJoin 19492.21 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", + " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", + " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", + " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t3.a, test.t1.a)]", " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", @@ -1181,36 +1167,35 @@ "TableReader 30426.12 root MppVersion: 2, data:ExchangeSender", "└─ExchangeSender 30426.12 mpp[tiflash] ExchangeType: PassThrough", " └─Projection 30426.12 mpp[tiflash] test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b, test.t5.a, test.t5.b, test.t6.a, test.t6.b", - " └─HashJoin 30426.12 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─ExchangeReceiver(Build) 15593.77 mpp[tiflash] ", - " │ └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", - " │ └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t5.b, test.t6.b)]", - " │ ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t6.b))", - " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:t6 pushed down filter:empty, keep order:false, stats:pseudo", - " │ └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t5.a, test.t2.a)]", - " │ ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", - " │ │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t5.a)), not(isnull(test.t5.b))", - " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:t5 pushed down filter:empty, keep order:false, stats:pseudo", - " │ └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t2.a))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", - " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", - " └─Projection 15593.77 mpp[tiflash] test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b", - " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t3.a, test.t1.a)]", - " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", - " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t3.b, test.t4.b)]", + " └─HashJoin 30426.12 mpp[tiflash] inner join, equal:[eq(test.t5.b, test.t6.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t6.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t6 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 24340.89 mpp[tiflash] inner join, equal:[eq(test.t2.a, test.t5.a)]", + " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", + " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t5.a)), not(isnull(test.t5.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t5 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 19492.21 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t2.a))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", + " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", + " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t3.a, test.t1.a)]", " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t3.a)), not(isnull(test.t3.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo", - " └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t4.b))", - " └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo" + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t3.b, test.t4.b)]", + " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", + " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t3.a)), not(isnull(test.t3.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo", + " └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t4.b))", + " └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo" ], "Warning": null }, @@ -1219,36 +1204,35 @@ "Plan": [ "TableReader 30426.12 root MppVersion: 2, data:ExchangeSender", "└─ExchangeSender 30426.12 mpp[tiflash] ExchangeType: PassThrough", - " └─Projection 30426.12 mpp[tiflash] test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b, test.t5.a, test.t5.b, test.t6.a, test.t6.b", - " └─HashJoin 30426.12 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─ExchangeReceiver(Build) 15593.77 mpp[tiflash] ", - " │ └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", - " │ └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t5.b, test.t6.b)]", - " │ ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t6.b))", - " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:t6 pushed down filter:empty, keep order:false, stats:pseudo", - " │ └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t5.a, test.t2.a)]", - " │ ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", - " │ │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t5.a)), not(isnull(test.t5.b))", - " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:t5 pushed down filter:empty, keep order:false, stats:pseudo", - " │ └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t2.a))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", - " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", - " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t3.b, test.t4.b)]", - " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t4.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", - " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", - " └─Selection(Probe) 9980.01 mpp[tiflash] not(isnull(test.t3.a)), not(isnull(test.t3.b))", - " └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo" + " └─HashJoin 30426.12 mpp[tiflash] inner join, equal:[eq(test.t5.b, test.t6.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t6.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t6 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 24340.89 mpp[tiflash] inner join, equal:[eq(test.t2.a, test.t5.a)]", + " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", + " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t5.a)), not(isnull(test.t5.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t5 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 19492.21 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t2.a))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", + " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", + " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t3.b, test.t4.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t4.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", + " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", + " └─Selection(Probe) 9980.01 mpp[tiflash] not(isnull(test.t3.a)), not(isnull(test.t3.b))", + " └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo" ], "Warning": [ "Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid" @@ -1259,39 +1243,37 @@ "Plan": [ "TableReader 30426.12 root MppVersion: 2, data:ExchangeSender", "└─ExchangeSender 30426.12 mpp[tiflash] ExchangeType: PassThrough", - " └─Projection 30426.12 mpp[tiflash] test.t2.a, test.t2.b, test.t1.a, test.t1.b, test.t3.a, test.t3.b, test.t4.a, test.t4.b, test.t5.a, test.t5.b, test.t6.a, test.t6.b", - " └─HashJoin 30426.12 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", - " ├─ExchangeReceiver(Build) 15593.77 mpp[tiflash] ", - " │ └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", - " │ └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t5.b, test.t6.b)]", - " │ ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t6.b))", - " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:t6 pushed down filter:empty, keep order:false, stats:pseudo", - " │ └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t5.a, test.t2.a)]", - " │ ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", - " │ │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t5.a)), not(isnull(test.t5.b))", - " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:t5 pushed down filter:empty, keep order:false, stats:pseudo", - " │ └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t2.a))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", - " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", - " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t3.b, test.t4.b)]", - " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t4.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", - " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", - " └─Selection(Probe) 9980.01 mpp[tiflash] not(isnull(test.t3.a)), not(isnull(test.t3.b))", - " └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo" + " └─HashJoin 30426.12 mpp[tiflash] inner join, equal:[eq(test.t5.b, test.t6.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t6.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t6 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 24340.89 mpp[tiflash] inner join, equal:[eq(test.t2.a, test.t5.a)]", + " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", + " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t5.a)), not(isnull(test.t5.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t5 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 19492.21 mpp[tiflash] left outer join, equal:[eq(test.t2.b, test.t1.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t2.b, collate: binary]", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t2.a))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) 15593.77 mpp[tiflash] ", + " └─ExchangeSender 15593.77 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.b, collate: binary]", + " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t3.b, test.t4.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t4.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12475.01 mpp[tiflash] inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", + " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", + " └─Selection(Probe) 9980.01 mpp[tiflash] not(isnull(test.t3.a)), not(isnull(test.t3.b))", + " └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo" ], "Warning": [ - "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid", "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" ] }, @@ -1365,30 +1347,30 @@ "Plan": [ "TableReader 24389.65 root MppVersion: 2, data:ExchangeSender", "└─ExchangeSender 24389.65 mpp[tiflash] ExchangeType: PassThrough", - " └─HashJoin 24389.65 mpp[tiflash] right outer join, equal:[eq(test.t.a, test.t1.a)]", - " ├─ExchangeReceiver(Build) 12487.50 mpp[tiflash] ", - " │ └─ExchangeSender 12487.50 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary]", - " │ └─HashJoin 12487.50 mpp[tiflash] inner join, equal:[eq(test.t4.a, test.t.a)]", - " │ ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t4.a))", - " │ │ └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo", - " │ └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t.a))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t pushed down filter:empty, keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 15609.38 mpp[tiflash] ", - " └─ExchangeSender 15609.38 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.a, collate: binary]", - " └─HashJoin 15609.38 mpp[tiflash] inner join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t3.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo", - " └─HashJoin(Probe) 12487.50 mpp[tiflash] inner join, equal:[eq(test.t1.b, test.t2.b)]", - " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", - " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t1.b))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", - " └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t2.b))", - " └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo" + " └─HashJoin 24389.65 mpp[tiflash] inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t3.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 19511.72 mpp[tiflash] inner join, equal:[eq(test.t1.b, test.t2.b)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t2.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", + " └─HashJoin(Probe) 15609.38 mpp[tiflash] right outer join, equal:[eq(test.t.a, test.t1.a)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t1.a, collate: binary]", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t1.b))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) 12487.50 mpp[tiflash] ", + " └─ExchangeSender 12487.50 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.a, collate: binary]", + " └─HashJoin 12487.50 mpp[tiflash] inner join, equal:[eq(test.t4.a, test.t.a)]", + " ├─ExchangeReceiver(Build) 9990.00 mpp[tiflash] ", + " │ └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ └─Selection 9990.00 mpp[tiflash] not(isnull(test.t4.a))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t4 pushed down filter:empty, keep order:false, stats:pseudo", + " └─Selection(Probe) 9990.00 mpp[tiflash] not(isnull(test.t.a))", + " └─TableFullScan 10000.00 mpp[tiflash] table:t pushed down filter:empty, keep order:false, stats:pseudo" ], "Warning": [ "Warning 1815 leading hint is inapplicable, check if the leading hint table is valid" diff --git a/pkg/planner/core/casetest/rule/testdata/outer2inner_out.json b/pkg/planner/core/casetest/rule/testdata/outer2inner_out.json index 07f7ef28b2747..fd67c40cf0ab2 100644 --- a/pkg/planner/core/casetest/rule/testdata/outer2inner_out.json +++ b/pkg/planner/core/casetest/rule/testdata/outer2inner_out.json @@ -174,11 +174,11 @@ { "SQL": "select * from t1 ta left outer join (t1 tb left outer join t1 tc on tb.b1 = tc.b1) on ta.a1=tc.a1; -- nested join. On clause is null filtering on tc.", "Plan": [ - "HashJoin 15593.77 root left outer join, equal:[eq(test.t1.a1, test.t1.a1)]", - "├─TableReader(Build) 10000.00 root data:TableFullScan", - "│ └─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo", - "└─Projection(Probe) 12475.01 root test.t1.a1, test.t1.b1, test.t1.c1, test.t1.a1, test.t1.b1, test.t1.c1", - " └─HashJoin 12475.01 root inner join, equal:[eq(test.t1.b1, test.t1.b1)]", + "Projection 15593.77 root test.t1.a1, test.t1.b1, test.t1.c1, test.t1.a1, test.t1.b1, test.t1.c1, test.t1.a1, test.t1.b1, test.t1.c1", + "└─HashJoin 15593.77 root left outer join, equal:[eq(test.t1.a1, test.t1.a1)]", + " ├─TableReader(Build) 10000.00 root data:TableFullScan", + " │ └─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo", + " └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(test.t1.b1, test.t1.b1)]", " ├─TableReader(Build) 9980.01 root data:Selection", " │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a1)), not(isnull(test.t1.b1))", " │ └─TableFullScan 10000.00 cop[tikv] table:tc keep order:false, stats:pseudo", diff --git a/pkg/planner/core/casetest/tpch/testdata/tpch_suite_out.json b/pkg/planner/core/casetest/tpch/testdata/tpch_suite_out.json index a7f02465078ac..f133d2ae798c7 100644 --- a/pkg/planner/core/casetest/tpch/testdata/tpch_suite_out.json +++ b/pkg/planner/core/casetest/tpch/testdata/tpch_suite_out.json @@ -26,68 +26,68 @@ { "SQL": "SELECT s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment FROM part, supplier, partsupp, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND p_size = 30 AND p_type LIKE '%STEEL' AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND r_name = 'ASIA' AND ps_supplycost = (SELECT MIN(ps_supplycost) FROM partsupp, supplier, nation, region WHERE p_partkey = ps_partkey AND s_suppkey = ps_suppkey AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND r_name = 'ASIA') ORDER BY s_acctbal DESC, n_name, s_name, p_partkey LIMIT 100;", "Result": [ - "Projection_39 100.00 941824584.46 (((((((((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00)) + (net(100*rowsize(240)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((exprCPU(100*0*tidb_cpu_factor(49.9))) + (orderCPU(100*log(100)*tidb_cpu_factor(49.9)))) + (topMem(100*240*tidb_mem_factor(0.2))))*1.00) + ((cpu(100*filters(0.08)*tidb_cpu_factor(49.9)))/5.00) root test.supplier.s_acctbal, test.supplier.s_name, test.nation.n_name, test.part.p_partkey, test.part.p_mfgr, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_comment", - "└─TopN_43 100.00 941824504.62 ((((((((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00)) + (net(100*rowsize(240)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((exprCPU(100*0*tidb_cpu_factor(49.9))) + (orderCPU(100*log(100)*tidb_cpu_factor(49.9)))) + (topMem(100*240*tidb_mem_factor(0.2))))*1.00 root test.supplier.s_acctbal:desc, test.nation.n_name, test.supplier.s_name, test.part.p_partkey, offset:0, count:100", - " └─TableReader_281 100.00 941786551.78 ((((((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00)) + (net(100*rowsize(240)*tidb_flash_net_factor(2.2))))/15.00)*1.00 root MppVersion: 2, data:ExchangeSender_280", - " └─ExchangeSender_280 100.00 14126745476.66 (((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00) mpp[tiflash] ExchangeType: PassThrough", - " └─TopN_279 100.00 14126745476.66 ((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00 mpp[tiflash] test.supplier.s_acctbal:desc, test.nation.n_name, test.supplier.s_name, test.part.p_partkey, offset:0, count:100", - " └─Projection_278 158044.35 14124224219.26 ((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.part.p_partkey, test.part.p_mfgr, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.nation.n_name", - " └─Projection_275 158044.35 14124218150.35 (((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.part.p_partkey, test.part.p_mfgr, test.partsupp.ps_partkey, Column#50", - " └─HashJoin_274 158044.35 14124210564.23 ((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.part.p_partkey, test.partsupp.ps_partkey) eq(test.partsupp.ps_supplycost, Column#50)]", - " ├─ExchangeReceiver_78(Build) 158044.35 7137462318.48 ((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", - " │ └─ExchangeSender_77 158044.35 7091945546.35 (((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.part.p_partkey, collate: binary], [name: test.partsupp.ps_supplycost, collate: binary]", - " │ └─Projection_76 158044.35 7091945546.35 ((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.partsupp.ps_supplycost, test.part.p_partkey, test.part.p_mfgr, test.partsupp.ps_suppkey", - " │ └─HashJoin_52 158044.35 7091937960.22 (((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.partsupp.ps_partkey, test.part.p_partkey)]", - " │ ├─ExchangeReceiver_75(Build) 158044.35 810213853.61 (((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", - " │ │ └─ExchangeSender_74 158044.35 774056467.75 ((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Selection_73 158044.35 774056467.75 (cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] like(test.part.p_type, \"%STEEL\", 92)", - " │ │ └─TableFullScan_72 197555.43 726056467.75 ((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:part pushed down filter:eq(test.part.p_size, 30), keep order:false", - " │ └─Projection_71(Probe) 8021852.14 6268435397.86 ((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.partsupp.ps_partkey, test.partsupp.ps_supplycost, test.partsupp.ps_suppkey", - " │ └─HashJoin_53 8021852.14 6268088853.85 (((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.supplier.s_suppkey, test.partsupp.ps_suppkey)]", - " │ ├─ExchangeReceiver_67(Build) 99997.20 69462555.35 (((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", - " │ │ └─ExchangeSender_66 99997.20 47963157.35 ((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.supplier.s_suppkey, collate: binary]", - " │ │ └─Projection_65 99997.20 47963157.35 (((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_suppkey, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment", - " │ │ └─HashJoin_54 99997.20 47959797.44 ((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.nation.n_nationkey, test.supplier.s_nationkey)]", - " │ │ ├─ExchangeReceiver_63(Build) 5.00 1202425.23 ((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", - " │ │ │ └─ExchangeSender_62 5.00 1201930.23 (((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ │ └─Projection_61 5.00 1201930.23 ((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_nationkey, test.nation.n_name", - " │ │ │ └─HashJoin_55 5.00 1201930.19 (((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.region.r_regionkey, test.nation.n_regionkey)]", - " │ │ │ ├─ExchangeReceiver_59(Build) 1.00 562979.73 (((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", - " │ │ │ │ └─ExchangeSender_58 1.00 562893.21 ((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ │ │ └─Selection_57 1.00 562893.21 (cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] eq(test.region.r_name, \"ASIA\")", - " │ │ │ │ └─TableFullScan_56 5.00 562881.21 ((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:region pushed down filter:empty, keep order:false", - " │ │ │ └─TableFullScan_60(Probe) 25.00 638908.37 ((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:nation keep order:false", - " │ │ └─TableFullScan_64(Probe) 500000.00 45957361.46 ((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:supplier keep order:false", - " │ └─ExchangeReceiver_70(Probe) 40000000.00 6134107979.69 ((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", - " │ └─ExchangeSender_69 40000000.00 2934107979.69 (((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_suppkey, collate: binary]", - " │ └─TableFullScan_68 40000000.00 2934107979.69 ((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:partsupp keep order:false", - " └─ExchangeReceiver_113(Probe) 6417481.71 6970208370.33 (((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", - " └─ExchangeSender_112 6417481.71 6662169248.27 ((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_partkey, collate: binary], [name: Column#50, collate: binary]", - " └─Selection_80 6417481.71 6662169248.27 (cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] not(isnull(Column#50))", - " └─Projection_106 8021852.14 6642916803.14 (((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] Column#50, test.partsupp.ps_partkey", - " └─HashAgg_81 8021852.14 6642839793.36 ((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00 mpp[tiflash] group by:test.partsupp.ps_partkey, funcs:min(test.partsupp.ps_supplycost)->Column#50, funcs:firstrow(test.partsupp.ps_partkey)->test.partsupp.ps_partkey", - " └─ExchangeReceiver_105 8021852.14 6615847793.29 (((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", - " └─ExchangeSender_104 8021852.14 6230798890.71 ((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_partkey, collate: binary]", - " └─Projection_84 8021852.14 6230798890.71 (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.partsupp.ps_partkey, test.partsupp.ps_supplycost", - " └─Projection_103 8021852.14 6230721880.93 ((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.partsupp.ps_partkey, test.partsupp.ps_supplycost, test.partsupp.ps_suppkey", - " └─HashJoin_85 8021852.14 6230606366.26 (((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.supplier.s_suppkey, test.partsupp.ps_suppkey)]", - " ├─ExchangeReceiver_99(Build) 99997.20 32325058.09 (((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", - " │ └─ExchangeSender_98 99997.20 31525080.49 ((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.supplier.s_suppkey, collate: binary]", - " │ └─Projection_97 99997.20 31525080.49 (((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.supplier.s_suppkey", - " │ └─HashJoin_86 99997.20 31524600.51 ((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.nation.n_nationkey, test.supplier.s_nationkey)]", - " │ ├─ExchangeReceiver_95(Build) 5.00 1144591.84 ((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", - " │ │ └─ExchangeSender_94 5.00 1144471.84 (((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ └─Projection_93 5.00 1144471.84 ((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_nationkey", - " │ │ └─HashJoin_87 5.00 1144471.81 (((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.region.r_regionkey, test.nation.n_regionkey)]", - " │ │ ├─ExchangeReceiver_91(Build) 1.00 562979.73 (((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", - " │ │ │ └─ExchangeSender_90 1.00 562893.21 ((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", - " │ │ │ └─Selection_89 1.00 562893.21 (cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] eq(test.region.r_name, \"ASIA\")", - " │ │ │ └─TableFullScan_88 5.00 562881.21 ((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:region pushed down filter:empty, keep order:false", - " │ │ └─TableFullScan_92(Probe) 25.00 581450.00 ((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:nation keep order:false", - " │ └─TableFullScan_96(Probe) 500000.00 29580000.00 ((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:supplier keep order:false", - " └─ExchangeReceiver_102(Probe) 40000000.00 6134107979.69 ((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", - " └─ExchangeSender_101 40000000.00 2934107979.69 (((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_suppkey, collate: binary]", - " └─TableFullScan_100 40000000.00 2934107979.69 ((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:partsupp keep order:false" + "Projection_40 100.00 941824584.46 (((((((((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00)) + (net(100*rowsize(240)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((exprCPU(100*0*tidb_cpu_factor(49.9))) + (orderCPU(100*log(100)*tidb_cpu_factor(49.9)))) + (topMem(100*240*tidb_mem_factor(0.2))))*1.00) + ((cpu(100*filters(0.08)*tidb_cpu_factor(49.9)))/5.00) root test.supplier.s_acctbal, test.supplier.s_name, test.nation.n_name, test.part.p_partkey, test.part.p_mfgr, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_comment", + "└─TopN_44 100.00 941824504.62 ((((((((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00)) + (net(100*rowsize(240)*tidb_flash_net_factor(2.2))))/15.00)*1.00) + ((exprCPU(100*0*tidb_cpu_factor(49.9))) + (orderCPU(100*log(100)*tidb_cpu_factor(49.9)))) + (topMem(100*240*tidb_mem_factor(0.2))))*1.00 root test.supplier.s_acctbal:desc, test.nation.n_name, test.supplier.s_name, test.part.p_partkey, offset:0, count:100", + " └─TableReader_282 100.00 941786551.78 ((((((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00)) + (net(100*rowsize(240)*tidb_flash_net_factor(2.2))))/15.00)*1.00 root MppVersion: 2, data:ExchangeSender_281", + " └─ExchangeSender_281 100.00 14126745476.66 (((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00) mpp[tiflash] ExchangeType: PassThrough", + " └─TopN_280 100.00 14126745476.66 ((((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00)) + ((exprCPU(158044.3476975649*0*tiflash_cpu_factor(2.4))) + (orderCPU(158044.3476975649*log(100)*tiflash_cpu_factor(2.4)))) + (topMem(100*240*tiflash_mem_factor(0.05))))*1.00 mpp[tiflash] test.supplier.s_acctbal:desc, test.nation.n_name, test.supplier.s_name, test.part.p_partkey, offset:0, count:100", + " └─Projection_279 158044.35 14124224219.26 ((((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(158044.3476975649*filters(0.08)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.part.p_partkey, test.part.p_mfgr, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.nation.n_name", + " └─Projection_276 158044.35 14124218150.35 (((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.part.p_partkey, test.part.p_mfgr, test.partsupp.ps_partkey, Column#50", + " └─HashJoin_275 158044.35 14124210564.23 ((((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1)))) + ((((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + ((((hashkey(158044.3476975649*2*tiflash_cpu_factor(2.4))) + (hashmem(158044.3476975649*288*tiflash_mem_factor(0.05))) + (hashbuild(158044.3476975649*tiflash_cpu_factor(2.4)))) + (cpu(158044.3476975649*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(6.4174817096649995e+06*2*tiflash_cpu_factor(2.4))) + (hashprobe(6.4174817096649995e+06*tiflash_cpu_factor(2.4)))) + (cpu(6.4174817096649995e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.part.p_partkey, test.partsupp.ps_partkey) eq(test.partsupp.ps_supplycost, Column#50)]", + " ├─ExchangeReceiver_79(Build) 158044.35 7137462318.48 ((((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00))) + (net(158044.3476975649*rowsize(288)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", + " │ └─ExchangeSender_78 158044.35 7091945546.35 (((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.part.p_partkey, collate: binary], [name: test.partsupp.ps_supplycost, collate: binary]", + " │ └─Projection_77 158044.35 7091945546.35 ((((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(158044.3476975649*filters(0.09999999999999999)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.partsupp.ps_supplycost, test.part.p_partkey, test.part.p_mfgr, test.partsupp.ps_suppkey", + " │ └─HashJoin_53 158044.35 7091937960.22 (((((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00)) + (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00)) + ((((hashkey(158044.34769756492*1*tiflash_cpu_factor(2.4))) + (hashmem(158044.34769756492*76.26*tiflash_mem_factor(0.05))) + (hashbuild(158044.34769756492*tiflash_cpu_factor(2.4)))) + (cpu(158044.34769756492*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + (cpu(8.021852137081249e+06*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.partsupp.ps_partkey, test.part.p_partkey)]", + " │ ├─ExchangeReceiver_76(Build) 158044.35 810213853.61 (((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00))) + ((net(158044.34769756492*rowsize(76.26)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", + " │ │ └─ExchangeSender_75 158044.35 774056467.75 ((cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ │ └─Selection_74 158044.35 774056467.75 (cpu(1e+07*filters(2)*tiflash_cpu_factor(2.4))) + (((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] like(test.part.p_type, \"%STEEL\", 92)", + " │ │ └─TableFullScan_73 197555.43 726056467.75 ((scan(1e+07*logrowsize(76.26)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(76.26)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:part pushed down filter:eq(test.part.p_size, 30), keep order:false", + " │ └─Projection_72(Probe) 8021852.14 6268435397.86 ((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.09)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment, test.partsupp.ps_partkey, test.partsupp.ps_supplycost, test.partsupp.ps_suppkey", + " │ └─HashJoin_54 8021852.14 6268088853.85 (((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*215*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.supplier.s_suppkey, test.partsupp.ps_suppkey)]", + " │ ├─ExchangeReceiver_68(Build) 99997.20 69462555.35 (((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(215)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", + " │ │ └─ExchangeSender_67 99997.20 47963157.35 ((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.supplier.s_suppkey, collate: binary]", + " │ │ └─Projection_66 99997.20 47963157.35 (((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.07)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_name, test.supplier.s_suppkey, test.supplier.s_name, test.supplier.s_address, test.supplier.s_phone, test.supplier.s_acctbal, test.supplier.s_comment", + " │ │ └─HashJoin_55 99997.20 47959797.44 ((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*33*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.nation.n_nationkey, test.supplier.s_nationkey)]", + " │ │ ├─ExchangeReceiver_64(Build) 5.00 1202425.23 ((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(33)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", + " │ │ │ └─ExchangeSender_63 5.00 1201930.23 (((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ │ │ └─Projection_62 5.00 1201930.23 ((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_nationkey, test.nation.n_name", + " │ │ │ └─HashJoin_56 5.00 1201930.19 (((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.region.r_regionkey, test.nation.n_regionkey)]", + " │ │ │ ├─ExchangeReceiver_60(Build) 1.00 562979.73 (((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", + " │ │ │ │ └─ExchangeSender_59 1.00 562893.21 ((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ │ │ │ └─Selection_58 1.00 562893.21 (cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] eq(test.region.r_name, \"ASIA\")", + " │ │ │ │ └─TableFullScan_57 5.00 562881.21 ((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:region pushed down filter:empty, keep order:false", + " │ │ │ └─TableFullScan_61(Probe) 25.00 638908.37 ((scan(25*logrowsize(45.07)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(45.07)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:nation keep order:false", + " │ │ └─TableFullScan_65(Probe) 500000.00 45957361.46 ((scan(500000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(218.01999999999998)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:supplier keep order:false", + " │ └─ExchangeReceiver_71(Probe) 40000000.00 6134107979.69 ((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", + " │ └─ExchangeSender_70 40000000.00 2934107979.69 (((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_suppkey, collate: binary]", + " │ └─TableFullScan_69 40000000.00 2934107979.69 ((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:partsupp keep order:false", + " └─ExchangeReceiver_114(Probe) 6417481.71 6970208370.33 (((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)))) + (net(6.4174817096649995e+06*rowsize(48)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", + " └─ExchangeSender_113 6417481.71 6662169248.27 ((cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_partkey, collate: binary], [name: Column#50, collate: binary]", + " └─Selection_81 6417481.71 6662169248.27 (cpu(8.021852137081249e+06*filters(1)*tiflash_cpu_factor(2.4))) + ((((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] not(isnull(Column#50))", + " └─Projection_107 8021852.14 6642916803.14 (((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] Column#50, test.partsupp.ps_partkey", + " └─HashAgg_82 8021852.14 6642839793.36 ((cpu(10*3*tiflash_cpu_factor(2.4))) + ((((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1)))) + (((agg(8.021852137081249e+06*aggs(2)*tiflash_cpu_factor(2.4))) + (group(8.021852137081249e+06*cols(0.01)*tiflash_cpu_factor(2.4))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashmem(8.021852137081249e+06*48*tiflash_mem_factor(0.05))) + (hashbuild(8.021852137081249e+06*tiflash_cpu_factor(2.4)))) + ((hashkey(8.021852137081249e+06*1*tiflash_cpu_factor(2.4))) + (hashprobe(8.021852137081249e+06*tiflash_cpu_factor(2.4)))))/5.00))*1.00 mpp[tiflash] group by:test.partsupp.ps_partkey, funcs:min(test.partsupp.ps_supplycost)->Column#50, funcs:firstrow(test.partsupp.ps_partkey)->test.partsupp.ps_partkey", + " └─ExchangeReceiver_106 8021852.14 6615847793.29 (((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00))) + (net(8.021852137081249e+06*rowsize(48)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", + " └─ExchangeSender_105 8021852.14 6230798890.71 ((((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_partkey, collate: binary]", + " └─Projection_85 8021852.14 6230798890.71 (((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00)) + ((cpu(8.021852137081249e+06*filters(0.02)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.partsupp.ps_partkey, test.partsupp.ps_supplycost", + " └─Projection_104 8021852.14 6230721880.93 ((((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(8.021852137081249e+06*filters(0.03)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.partsupp.ps_partkey, test.partsupp.ps_supplycost, test.partsupp.ps_suppkey", + " └─HashJoin_86 8021852.14 6230606366.26 (((((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1)))) + (((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1)))) + ((((hashkey(99997.20000000001*1*tiflash_cpu_factor(2.4))) + (hashmem(99997.20000000001*8*tiflash_mem_factor(0.05))) + (hashbuild(99997.20000000001*tiflash_cpu_factor(2.4)))) + (cpu(99997.20000000001*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(4e+07*1*tiflash_cpu_factor(2.4))) + (hashprobe(4e+07*tiflash_cpu_factor(2.4)))) + (cpu(4e+07*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.supplier.s_suppkey, test.partsupp.ps_suppkey)]", + " ├─ExchangeReceiver_100(Build) 99997.20 32325058.09 (((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + (net(99997.20000000001*rowsize(8)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", + " │ └─ExchangeSender_99 99997.20 31525080.49 ((((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.supplier.s_suppkey, collate: binary]", + " │ └─Projection_98 99997.20 31525080.49 (((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(99997.20000000001*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.supplier.s_suppkey", + " │ └─HashJoin_87 99997.20 31524600.51 ((((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(5*1*tiflash_cpu_factor(2.4))) + (hashmem(5*8*tiflash_mem_factor(0.05))) + (hashbuild(5*tiflash_cpu_factor(2.4)))) + (cpu(5*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(500000*1*tiflash_cpu_factor(2.4))) + (hashprobe(500000*tiflash_cpu_factor(2.4)))) + (cpu(500000*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.nation.n_nationkey, test.supplier.s_nationkey)]", + " │ ├─ExchangeReceiver_96(Build) 5.00 1144591.84 ((((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00))) + ((net(5*rowsize(8)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", + " │ │ └─ExchangeSender_95 5.00 1144471.84 (((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ │ └─Projection_94 5.00 1144471.84 ((((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00) + ((cpu(5*filters(0.01)*tiflash_cpu_factor(2.4)))/5.00) mpp[tiflash] test.nation.n_nationkey", + " │ │ └─HashJoin_88 5.00 1144471.81 (((((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00)) + (((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00) + ((((hashkey(1*1*tiflash_cpu_factor(2.4))) + (hashmem(1*28.84*tiflash_mem_factor(0.05))) + (hashbuild(1*tiflash_cpu_factor(2.4)))) + (cpu(1*filters(0)*tiflash_cpu_factor(2.4))) + ((hashkey(25*1*tiflash_cpu_factor(2.4))) + (hashprobe(25*tiflash_cpu_factor(2.4)))) + (cpu(25*filters(0)*tiflash_cpu_factor(2.4))))/3.00))*1.00 mpp[tiflash] inner join, equal:[eq(test.region.r_regionkey, test.nation.n_regionkey)]", + " │ │ ├─ExchangeReceiver_92(Build) 1.00 562979.73 (((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00))) + ((net(1*rowsize(28.84)*tiflash_mpp_net_factor(1)))*3.00) mpp[tiflash] ", + " │ │ │ └─ExchangeSender_91 1.00 562893.21 ((cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00)) mpp[tiflash] ExchangeType: Broadcast, Compression: FAST", + " │ │ │ └─Selection_90 1.00 562893.21 (cpu(5*filters(1)*tiflash_cpu_factor(2.4))) + (((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] eq(test.region.r_name, \"ASIA\")", + " │ │ │ └─TableFullScan_89 5.00 562881.21 ((scan(5*logrowsize(28.84)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(28.84)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:region pushed down filter:empty, keep order:false", + " │ │ └─TableFullScan_93(Probe) 25.00 581450.00 ((scan(25*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:nation keep order:false", + " │ └─TableFullScan_97(Probe) 500000.00 29580000.00 ((scan(500000*logrowsize(32)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(32)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:supplier keep order:false", + " └─ExchangeReceiver_103(Probe) 40000000.00 6134107979.69 ((((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00)) + (net(4e+07*rowsize(80)*tiflash_mpp_net_factor(1))) mpp[tiflash] ", + " └─ExchangeSender_102 40000000.00 2934107979.69 (((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00) mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.partsupp.ps_suppkey, collate: binary]", + " └─TableFullScan_101 40000000.00 2934107979.69 ((scan(4e+07*logrowsize(80)*tiflash_scan_factor(11.6))) + (scan(10000*logrowsize(80)*tiflash_scan_factor(11.6))))*1.00 mpp[tiflash] table:partsupp keep order:false" ] } ] From af69c63be476b2b56ceea616db0d51e968d65115 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 15:17:22 +0800 Subject: [PATCH 20/25] executor case Signed-off-by: guo-shaoge --- pkg/executor/explainfor_test.go | 20 ++++++++++---------- pkg/executor/prepared_test.go | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/executor/explainfor_test.go b/pkg/executor/explainfor_test.go index 6ce4af7f08dd0..116320b5b89ee 100644 --- a/pkg/executor/explainfor_test.go +++ b/pkg/executor/explainfor_test.go @@ -296,11 +296,11 @@ func TestPointGetUserVarPlanCache(t *testing.T) { ps := []*util.ProcessInfo{tkProcess} tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps}) tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Check(testkit.Rows( // can use idx_a - `Projection_9 10.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b`, - `└─HashJoin_11 10.00 root CARTESIAN inner join`, - ` ├─Point_Get_12(Build) 1.00 root table:t2, index:idx_a(a) `, // use idx_a - ` └─TableReader_14(Probe) 10.00 root data:TableRangeScan_13`, - ` └─TableRangeScan_13 10.00 cop[tikv] table:t1 range:[1,1], keep order:false, stats:pseudo`)) + `Projection_10 10.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b`, + `└─HashJoin_12 10.00 root CARTESIAN inner join`, + ` ├─Point_Get_13(Build) 1.00 root table:t2, index:idx_a(a) `, + ` └─TableReader_15(Probe) 10.00 root data:TableRangeScan_14`, + ` └─TableRangeScan_14 10.00 cop[tikv] table:t1 range:[1,1], keep order:false, stats:pseudo`)) tk.MustExec("set @a=2") tk.MustQuery("execute stmt using @a").Check(testkit.Rows( @@ -310,11 +310,11 @@ func TestPointGetUserVarPlanCache(t *testing.T) { ps = []*util.ProcessInfo{tkProcess} tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps}) tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Check(testkit.Rows( // can use idx_a - `Projection_9 10.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b`, - `└─HashJoin_11 10.00 root CARTESIAN inner join`, - ` ├─Point_Get_12(Build) 1.00 root table:t2, index:idx_a(a) `, - ` └─TableReader_14(Probe) 10.00 root data:TableRangeScan_13`, - ` └─TableRangeScan_13 10.00 cop[tikv] table:t1 range:[2,2], keep order:false, stats:pseudo`)) + `Projection_10 10.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b`, + `└─HashJoin_12 10.00 root CARTESIAN inner join`, + ` ├─Point_Get_13(Build) 1.00 root table:t2, index:idx_a(a) `, + ` └─TableReader_15(Probe) 10.00 root data:TableRangeScan_14`, + ` └─TableRangeScan_14 10.00 cop[tikv] table:t1 range:[2,2], keep order:false, stats:pseudo`)) tk.MustQuery("execute stmt using @a").Check(testkit.Rows( "2 4 2 2", )) diff --git a/pkg/executor/prepared_test.go b/pkg/executor/prepared_test.go index 936b1a369fa39..763726500b7d3 100644 --- a/pkg/executor/prepared_test.go +++ b/pkg/executor/prepared_test.go @@ -91,10 +91,10 @@ func TestIssue29850(t *testing.T) { ps := []*util.ProcessInfo{tkProcess} tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps}) tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Check(testkit.Rows( // can use PointGet - `Projection_7 0.00 root test.customer.c_discount, test.customer.c_last, test.customer.c_credit, test.warehouse.w_tax`, - `└─HashJoin_8 0.00 root CARTESIAN inner join`, - ` ├─Point_Get_11(Build) 1.00 root table:warehouse handle:1262`, - ` └─Point_Get_10(Probe) 1.00 root table:customer, clustered index:PRIMARY(c_w_id, c_d_id, c_id) `)) + `Projection_8 0.00 root test.customer.c_discount, test.customer.c_last, test.customer.c_credit, test.warehouse.w_tax`, + `└─HashJoin_9 0.00 root CARTESIAN inner join`, + ` ├─Point_Get_12(Build) 1.00 root table:warehouse handle:1262`, + ` └─Point_Get_11(Probe) 1.00 root table:customer, clustered index:PRIMARY(c_w_id, c_d_id, c_id) `)) tk.MustQuery(`execute stmt using @w_id, @c_d_id, @c_id`).Check(testkit.Rows()) tk.MustQuery(`select @@last_plan_from_cache`).Check(testkit.Rows("1")) // can use the cached plan From ebe9e552b9f5e373f6b88a6cfb3b04442b18f3f5 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 15:23:04 +0800 Subject: [PATCH 21/25] case Signed-off-by: guo-shaoge --- .../testdata/cdc_join_reorder_suite_out.json | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json index 4c1afb338c309..a78a8ca3ca63f 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json @@ -1228,19 +1228,18 @@ { "SQL": "explain select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'", "Plan": [ - "Projection_19 2.40 root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", - "└─MergeJoin_20 2.40 root inner join, left key:test.t1.id, right key:test.t2.id", - " ├─TableReader_51(Build) 3.00 root data:TableFullScan_50", - " │ └─TableFullScan_50 3.00 cop[tikv] table:t2 keep order:true", - " └─MergeJoin_32(Probe) 2.40 root inner join, left key:test.t3.id, right key:test.t1.id", - " ├─TableReader_49(Build) 3.00 root data:TableFullScan_48", - " │ └─TableFullScan_48 3.00 cop[tikv] table:t1 keep order:true", - " └─Selection_33(Probe) 2.40 root or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", - " └─MergeJoin_34 3.00 root left outer join, left key:test.t3.id, right key:test.t4.id", - " ├─TableReader_47(Build) 3.00 root data:TableFullScan_46", - " │ └─TableFullScan_46 3.00 cop[tikv] table:t4 keep order:true", - " └─TableReader_45(Probe) 3.00 root data:TableFullScan_44", - " └─TableFullScan_44 3.00 cop[tikv] table:t3 keep order:true" + "Projection_18 3.00 root test.t1.id, test.t1.name, test.t3.id, test.t3.name, test.t4.id, test.t4.name, test.t2.id, test.t2.name", + "└─MergeJoin_19 3.00 root inner join, left key:test.t1.id, right key:test.t2.id", + " ├─TableReader_49(Build) 3.00 root data:TableFullScan_48", + " │ └─TableFullScan_48 3.00 cop[tikv] table:t2 keep order:true", + " └─MergeJoin_31(Probe) 3.00 root inner join, left key:test.t3.id, right key:test.t1.id, other cond:or(like(test.t3.name, \"test3\", 92), like(test.t4.name, \"test4\", 92))", + " ├─TableReader_47(Build) 3.00 root data:TableFullScan_46", + " │ └─TableFullScan_46 3.00 cop[tikv] table:t1 keep order:true", + " └─MergeJoin_32(Probe) 3.00 root left outer join, left key:test.t3.id, right key:test.t4.id", + " ├─TableReader_45(Build) 3.00 root data:TableFullScan_44", + " │ └─TableFullScan_44 3.00 cop[tikv] table:t4 keep order:true", + " └─TableReader_43(Probe) 3.00 root data:TableFullScan_42", + " └─TableFullScan_42 3.00 cop[tikv] table:t3 keep order:true" ] }, { From 638554b696b6935f04619df124b2953b23e214d3 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 15:56:22 +0800 Subject: [PATCH 22/25] integration test Signed-off-by: guo-shaoge --- .../integrationtest/r/executor/explain.result | 14 +- tests/integrationtest/r/explain_cte.result | 38 +- .../r/planner/core/casetest/hint/hint.result | 50 +- .../planner/core/casetest/index/index.result | 2 +- .../casetest/rule/rule_join_reorder.result | 1839 ++++++++--------- .../integrationtest/r/planner/core/cbo.result | 14 +- .../core/issuetest/planner_issue.result | 26 +- .../r/planner/core/join_reorder2.result | 17 +- .../join_reorder_through_projection.result | 724 ++++--- .../r/planner/core/plan_cache.result | 10 +- .../r/planner/core/rule_join_reorder.result | 40 +- tests/integrationtest/r/select.result | 123 +- 12 files changed, 1418 insertions(+), 1479 deletions(-) diff --git a/tests/integrationtest/r/executor/explain.result b/tests/integrationtest/r/executor/explain.result index 5cf7eec67eadc..8be4d6de6e724 100644 --- a/tests/integrationtest/r/executor/explain.result +++ b/tests/integrationtest/r/executor/explain.result @@ -368,13 +368,13 @@ create table t (a int, b int, index (a)); insert into t values (1, 1); explain analyze select * from t t1, t t2 where t1.b = t2.a and t1.b = 2333; id estRows actRows task access object execution info operator info memory disk -HashJoin_8 100.00 0 root CARTESIAN inner join -├─IndexLookUp_15(Build) 10.00 0 root -│ ├─IndexRangeScan_13(Build) 10.00 0 cop[tikv] table:t2, index:a(a) range:[2333,2333], keep order:false, stats:pseudo -│ └─TableRowIDScan_14(Probe) 10.00 0 cop[tikv] table:t2 keep order:false, stats:pseudo -└─TableReader_12(Probe) 10.00 0 root data:Selection_11 - └─Selection_11 10.00 0 cop[tikv] eq(executor__explain.t.b, 2333) - └─TableFullScan_10 10000.00 1 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin_9 100.00 0 root CARTESIAN inner join +├─IndexLookUp_16(Build) 10.00 0 root +│ ├─IndexRangeScan_14(Build) 10.00 0 cop[tikv] table:t2, index:a(a) range:[2333,2333], keep order:false, stats:pseudo +│ └─TableRowIDScan_15(Probe) 10.00 0 cop[tikv] table:t2 keep order:false, stats:pseudo +└─TableReader_13(Probe) 10.00 0 root data:Selection_12 + └─Selection_12 10.00 0 cop[tikv] eq(executor__explain.t.b, 2333) + └─TableFullScan_11 10000.00 1 cop[tikv] table:t1 keep order:false, stats:pseudo drop table if exists t; CREATE TABLE `t` (`a` mediumint(9) NOT NULL,`b` year(4) NOT NULL,`c` varbinary(62) NOT NULL,`d` text COLLATE utf8mb4_unicode_ci NOT NULL,`e` tinyint(4) NOT NULL DEFAULT '115',`f` smallint(6) DEFAULT '2675',`g` date DEFAULT '1981-09-17',`h` mediumint(8) unsigned NOT NULL,`i` varchar(384) CHARACTER SET gbk COLLATE gbk_bin DEFAULT NULL,UNIQUE KEY `idx_23` (`h`,`f`),PRIMARY KEY (`h`,`a`) /*T![clustered_index] CLUSTERED */,UNIQUE KEY `idx_25` (`h`,`i`(5),`e`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin PARTITION BY HASH (`h`) PARTITIONS 1; INSERT INTO `t` VALUES (2065948,1999,_binary '8jxN','rf',-54,-5656,'1987-07-03',259254,'7me坨'),(-8248164,2024,_binary 'zA5A','s)DAkX3',-93,-12983,'2027-12-18',299573,'LUf咲'),(-6131509,2023,_binary 'xdex#Y2','1th%h',-51,19149,'2013-10-28',428279,'矷莒X'),(7545837,1998,_binary 'PCVO','&(lJw6',30,4093,'1987-07-03',736235,'腏@TOIJ'),(-7449472,2029,_binary 'B7&jrl','EjbFfX!',80,-7590,'2011-11-03',765580,'堮ZQF_'),(-7176200,1988,_binary 'tiPglv7mX_#','CnCtNb',-25,NULL,'1987-07-03',842956,'Gq羣嗳殓'),(-115168,2036,_binary 'BqmX$-4It','!8#dvH',82,18787,'1991-09-20',921706,'椉2庘v'),(6665100,1987,_binary '4IJgk0fr4','(D',-73,28628,'1987-07-03',1149668,'摔玝S渉'),(-4065661,2021,_binary '8G%','xDO39xw#',-107,17356,'1970-12-20',1316239,'+0c35掬-阗'),(7622462,1990,_binary '&o+)s)D0','kjoS9Dzld',84,688,'1987-07-03',1403663,'$H鍿_M~'),(5269354,2018,_binary 'wq9hC8','s8XPrN+',-2,-31272,'2008-05-26',1534517,'y椁n躁Q'),(2065948,1982,_binary '8jxNjbksV','g$+i4dg',11,19800,'1987-07-03',1591457,'z^+H~薼A'),(4076971,2024,_binary '&!RrsH','7Mpvk',-63,-632,'2032-10-28',1611011,'鬰+EXmx'),(3522062,1981,_binary ')nq#!UiHKk8','j~wFe77ai',50,6951,'1987-07-03',1716854,'J'),(7859777,2012,_binary 'PBA5xgJ&G&','UM7o!u',18,-5978,'1987-07-03',1967012,'e)浢L獹'),(2065948,2028,_binary '8jxNjbk','JmsEki9t4',51,12002,'2017-12-23',1981288,'mp氏襚'); diff --git a/tests/integrationtest/r/explain_cte.result b/tests/integrationtest/r/explain_cte.result index 2590f9e78bd75..5c9fcf3546c0d 100644 --- a/tests/integrationtest/r/explain_cte.result +++ b/tests/integrationtest/r/explain_cte.result @@ -14,11 +14,11 @@ TableReader_9 10000.00 root data:TableFullScan_8 └─TableFullScan_8 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo explain with cte(a,b,c,d) as (select * from t1, t2) select * from cte; id estRows task access object operator info -HashJoin_13 100000000.00 root CARTESIAN inner join -├─TableReader_20(Build) 10000.00 root data:TableFullScan_19 -│ └─TableFullScan_19 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo -└─TableReader_16(Probe) 10000.00 root data:TableFullScan_15 - └─TableFullScan_15 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin_14 100000000.00 root CARTESIAN inner join +├─TableReader_21(Build) 10000.00 root data:TableFullScan_20 +│ └─TableFullScan_20 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +└─TableReader_17(Probe) 10000.00 root data:TableFullScan_16 + └─TableFullScan_16 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo explain with recursive cte(a) as (select 1 union select a+1 from cte where a < 10) select * from cte; id estRows task access object operator info CTEFullScan_17 2.00 root CTE:cte data:CTE_0 @@ -48,9 +48,9 @@ CTE_2 2.00 root Recursive CTE └─CTETable_27 1.00 root Scan on CTE_2 explain with recursive cte(a) as (select 1 union select a+1 from cte where a < 10) select * from cte t1, cte t2; id estRows task access object operator info -HashJoin_20 4.00 root CARTESIAN inner join -├─CTEFullScan_23(Build) 2.00 root CTE:cte AS t2 data:CTE_0 -└─CTEFullScan_22(Probe) 2.00 root CTE:cte AS t1 data:CTE_0 +HashJoin_21 4.00 root CARTESIAN inner join +├─CTEFullScan_24(Build) 2.00 root CTE:cte AS t2 data:CTE_0 +└─CTEFullScan_23(Probe) 2.00 root CTE:cte AS t1 data:CTE_0 CTE_0 2.00 root Recursive CTE ├─Projection_13(Seed Part) 1.00 root 1->Column#2 │ └─TableDual_14 1.00 root rows:1 @@ -59,9 +59,9 @@ CTE_0 2.00 root Recursive CTE └─CTETable_17 1.00 root Scan on CTE_0 explain with cte(a) as (with recursive cte1(a) as (select 1 union select a + 1 from cte1 where a < 10) select * from cte1) select * from cte t1, cte t2; id estRows task access object operator info -HashJoin_25 4.00 root CARTESIAN inner join -├─CTEFullScan_28(Build) 2.00 root CTE:cte AS t2 data:CTE_0 -└─CTEFullScan_27(Probe) 2.00 root CTE:cte AS t1 data:CTE_0 +HashJoin_26 4.00 root CARTESIAN inner join +├─CTEFullScan_29(Build) 2.00 root CTE:cte AS t2 data:CTE_0 +└─CTEFullScan_28(Probe) 2.00 root CTE:cte AS t1 data:CTE_0 CTE_0 2.00 root Non-Recursive CTE └─CTEFullScan_22(Seed Part) 2.00 root CTE:cte1 data:CTE_1 CTE_1 2.00 root Recursive CTE @@ -72,9 +72,9 @@ CTE_1 2.00 root Recursive CTE └─CTETable_20 1.00 root Scan on CTE_1 explain with recursive cte1(a) as (select 1 union select a+1 from cte1 where a < 10), cte2(a) as (select c2 from t1 union select a+1 from cte2 where a < 10) select * from cte1, cte2; id estRows task access object operator info -HashJoin_37 16002.00 root CARTESIAN inner join -├─CTEFullScan_40(Build) 2.00 root CTE:cte1 data:CTE_0 -└─CTEFullScan_41(Probe) 8001.00 root CTE:cte2 data:CTE_1 +HashJoin_38 16002.00 root CARTESIAN inner join +├─CTEFullScan_41(Build) 2.00 root CTE:cte1 data:CTE_0 +└─CTEFullScan_42(Probe) 8001.00 root CTE:cte2 data:CTE_1 CTE_0 2.00 root Recursive CTE ├─Projection_21(Seed Part) 1.00 root 1->Column#2 │ └─TableDual_22 1.00 root rows:1 @@ -89,11 +89,11 @@ CTE_1 8001.00 root Recursive CTE └─CTETable_33 10000.00 root Scan on CTE_1 explain with q(a,b) as (select * from t1) select /*+ merge(q) no_merge(q1) */ * from q, q q1 where q.a=1 and q1.a=2; id estRows task access object operator info -HashJoin_15 2.56 root CARTESIAN inner join -├─Selection_19(Build) 1.60 root eq(explain_cte.t1.c1, 2) -│ └─CTEFullScan_20 2.00 root CTE:q AS q1 data:CTE_0 -└─Selection_17(Probe) 1.60 root eq(explain_cte.t1.c1, 1) - └─CTEFullScan_18 2.00 root CTE:q data:CTE_0 +HashJoin_16 2.56 root CARTESIAN inner join +├─Selection_20(Build) 1.60 root eq(explain_cte.t1.c1, 2) +│ └─CTEFullScan_21 2.00 root CTE:q AS q1 data:CTE_0 +└─Selection_18(Probe) 1.60 root eq(explain_cte.t1.c1, 1) + └─CTEFullScan_19 2.00 root CTE:q data:CTE_0 CTE_0 2.00 root Non-Recursive CTE └─Batch_Point_Get_12(Seed Part) 2.00 root table:t1 handle:[1 2], keep order:false, desc:false explain with recursive cte(a,b) as (select 1, concat('a', 1) union select a+1, concat(b, 1) from cte where a < 5) select * from cte; diff --git a/tests/integrationtest/r/planner/core/casetest/hint/hint.result b/tests/integrationtest/r/planner/core/casetest/hint/hint.result index d970e188f99d8..618fe774b7860 100644 --- a/tests/integrationtest/r/planner/core/casetest/hint/hint.result +++ b/tests/integrationtest/r/planner/core/casetest/hint/hint.result @@ -1524,15 +1524,15 @@ select /*+ qb_name(qb, v4) use_index(t4@qb, idx_a) */ a from v4 where a < 10 ), d2 as (select /*+ qb_name(qb2, v4) use_index(t4@qb2, idx_b) */ a from v4 where b < 10) select * from (select * from d1) as t0 join (select * from d2) as t1; id estRows task access object operator info -HashJoin_42 6944.44 root CARTESIAN inner join -├─IndexLookUp_51(Build) 83.33 root -│ ├─IndexRangeScan_48(Build) 250.00 cop[tikv] table:t4, index:idx_b(b) range:(3,10), keep order:false, stats:pseudo -│ └─Selection_50(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2) -│ └─TableRowIDScan_49 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─IndexLookUp_47(Probe) 83.33 root - ├─IndexRangeScan_44(Build) 250.00 cop[tikv] table:t4, index:idx_a(a) range:(2,8), keep order:false, stats:pseudo - └─Selection_46(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.b, 3) - └─TableRowIDScan_45 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo +HashJoin_43 6944.44 root CARTESIAN inner join +├─IndexLookUp_52(Build) 83.33 root +│ ├─IndexRangeScan_49(Build) 250.00 cop[tikv] table:t4, index:idx_b(b) range:(3,10), keep order:false, stats:pseudo +│ └─Selection_51(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2) +│ └─TableRowIDScan_50 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo +└─IndexLookUp_48(Probe) 83.33 root + ├─IndexRangeScan_45(Build) 250.00 cop[tikv] table:t4, index:idx_a(a) range:(2,8), keep order:false, stats:pseudo + └─Selection_47(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.b, 3) + └─TableRowIDScan_46 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo explain with d1 as ( select a from ( select a from ( @@ -1542,14 +1542,14 @@ select a from v4 where a < 10 ), d2 as (select a from v4 where b < 10) select /*+ qb_name(qb, v4@sel_4) use_index(t4@qb, idx_a) qb_name(qb2, v4@sel_5) use_index(t4@qb, idx_b) */ * from (select * from d1) as t0 join (select * from d2) as t1; id estRows task access object operator info -HashJoin_42 6944.44 root CARTESIAN inner join -├─TableReader_54(Build) 83.33 root data:Selection_53 -│ └─Selection_53 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2), gt(planner__core__casetest__hint__hint.t4.b, 3), lt(planner__core__casetest__hint__hint.t4.b, 10) -│ └─TableFullScan_52 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─IndexLookUp_47(Probe) 83.33 root - ├─IndexRangeScan_44(Build) 250.00 cop[tikv] table:t4, index:idx_a(a) range:(2,8), keep order:false, stats:pseudo - └─Selection_46(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.b, 3) - └─TableRowIDScan_45 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo +HashJoin_43 6944.44 root CARTESIAN inner join +├─TableReader_55(Build) 83.33 root data:Selection_54 +│ └─Selection_54 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2), gt(planner__core__casetest__hint__hint.t4.b, 3), lt(planner__core__casetest__hint__hint.t4.b, 10) +│ └─TableFullScan_53 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo +└─IndexLookUp_48(Probe) 83.33 root + ├─IndexRangeScan_45(Build) 250.00 cop[tikv] table:t4, index:idx_a(a) range:(2,8), keep order:false, stats:pseudo + └─Selection_47(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.b, 3) + └─TableRowIDScan_46 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo explain with d1 as ( select a from ( select a from ( @@ -1559,14 +1559,14 @@ select /*+ qb_name(qb, v5) use_index(t4@qb, idx_a) */ a from v4 where a < 10 ), d2 as (select /*+ qb_name(qb2, v4) use_index(t4@qb2, idx_b) */ a from v4 where b < 10) select * from (select * from d1) as t0 join (select * from d2) as t1; id estRows task access object operator info -HashJoin_42 6944.44 root CARTESIAN inner join -├─IndexLookUp_58(Build) 83.33 root -│ ├─IndexRangeScan_55(Build) 250.00 cop[tikv] table:t4, index:idx_b(b) range:(3,10), keep order:false, stats:pseudo -│ └─Selection_57(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2) -│ └─TableRowIDScan_56 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─TableReader_46(Probe) 83.33 root data:Selection_45 - └─Selection_45 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2), gt(planner__core__casetest__hint__hint.t4.b, 3), lt(planner__core__casetest__hint__hint.t4.a, 10), lt(planner__core__casetest__hint__hint.t4.a, 8), lt(planner__core__casetest__hint__hint.t4.a, 9) - └─TableFullScan_44 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo +HashJoin_43 6944.44 root CARTESIAN inner join +├─IndexLookUp_59(Build) 83.33 root +│ ├─IndexRangeScan_56(Build) 250.00 cop[tikv] table:t4, index:idx_b(b) range:(3,10), keep order:false, stats:pseudo +│ └─Selection_58(Probe) 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2) +│ └─TableRowIDScan_57 250.00 cop[tikv] table:t4 keep order:false, stats:pseudo +└─TableReader_47(Probe) 83.33 root data:Selection_46 + └─Selection_46 83.33 cop[tikv] gt(planner__core__casetest__hint__hint.t4.a, 2), gt(planner__core__casetest__hint__hint.t4.b, 3), lt(planner__core__casetest__hint__hint.t4.a, 10), lt(planner__core__casetest__hint__hint.t4.a, 8), lt(planner__core__casetest__hint__hint.t4.a, 9) + └─TableFullScan_45 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo Level Code Message Warning 1815 The qb_name hint qb is unused, please check whether the table list in the qb_name hint qb is correct drop table if exists t; diff --git a/tests/integrationtest/r/planner/core/casetest/index/index.result b/tests/integrationtest/r/planner/core/casetest/index/index.result index 7d670af7e3c32..5c8cc1ba03d8c 100644 --- a/tests/integrationtest/r/planner/core/casetest/index/index.result +++ b/tests/integrationtest/r/planner/core/casetest/index/index.result @@ -559,7 +559,7 @@ IndexJoin 12475.01 root inner join, inner:IndexLookUp, outer key:planner__core_ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo └─IndexLookUp(Probe) 12475.01 root ├─Selection(Build) 12475.01 cop[tikv] not(isnull(planner__core__casetest__index__index.t1.a)), not(isnull(planner__core__casetest__index__index.t1.b)) - │ └─IndexRangeScan 12500.00 cop[tikv] table:t1, index:idx_a_b_c_d(a, b, c, d) range: decided by [eq(planner__core__casetest__index__index.t1.a, planner__core__casetest__index__index.t2.e) lt(planner__core__casetest__index__index.t1.b, plus(planner__core__casetest__index__index.t2.f, 10)) gt(planner__core__casetest__index__index.t1.b, planner__core__casetest__index__index.t2.f)], keep order:false, stats:pseudo + │ └─IndexRangeScan 12500.00 cop[tikv] table:t1, index:idx_a_b_c_d(a, b, c, d) range: decided by [eq(planner__core__casetest__index__index.t1.a, planner__core__casetest__index__index.t2.e) gt(planner__core__casetest__index__index.t1.b, planner__core__casetest__index__index.t2.f) lt(planner__core__casetest__index__index.t1.b, plus(planner__core__casetest__index__index.t2.f, 10))], keep order:false, stats:pseudo └─TableRowIDScan(Probe) 12475.01 cop[tikv] table:t1 keep order:false, stats:pseudo show warnings; Level Code Message diff --git a/tests/integrationtest/r/planner/core/casetest/rule/rule_join_reorder.result b/tests/integrationtest/r/planner/core/casetest/rule/rule_join_reorder.result index db8b8662267f8..bcce6a12d1983 100644 --- a/tests/integrationtest/r/planner/core/casetest/rule/rule_join_reorder.result +++ b/tests/integrationtest/r/planner/core/casetest/rule/rule_join_reorder.result @@ -897,8 +897,6 @@ HashJoin 155937656.25 root CARTESIAN inner join └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table has join conditions with other tables explain format = 'brief' select /*+ leading(t2, t1, t3) */ * from t, t1, t2, t3 where t.a = t1.a and t1.b=t2.b; id estRows task access object operator info Projection 155937656.25 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b @@ -1108,8 +1106,6 @@ HashJoin 124875.00 root CARTESIAN inner join └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table has join conditions with other tables explain format = 'brief' select /*+ leading(t1) */ * from t2 join (t1 join t3 on t1.a=t3.a) on t2.a=1; id estRows task access object operator info Projection 124875.00 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b @@ -1179,8 +1175,6 @@ Projection 124875.00 root planner__core__casetest__rule__rule_join_reorder.t2.a └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)) └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table has join conditions with other tables explain format = 'brief' select /*+ leading(t2, t1, t3) */ * from t2 join (t1 join t3 on t1.a=t3.a) on t2.a=1; id estRows task access object operator info HashJoin 124875.00 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] @@ -1644,34 +1638,32 @@ Projection 304261169.13 root planner__core__casetest__rule__rule_join_reorder.t └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3) */ * from ((select t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 304261169.13 root CARTESIAN inner join -├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] -│ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] -│ │ ├─TableReader(Build) 9990.00 root data:Selection -│ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) -│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo -│ │ └─TableReader(Probe) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo -│ └─IndexReader(Probe) 9990.00 root index:IndexFullScan -│ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +HashJoin 304261169.13 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +├─TableReader(Build) 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +└─HashJoin(Probe) 243408935.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 194727148.24 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 155781718.59 root CARTESIAN inner join + ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + │ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] + │ │ ├─TableReader(Build) 9990.00 root data:Selection + │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) + │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo + │ │ └─TableReader(Probe) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + │ └─IndexReader(Probe) 9990.00 root index:IndexFullScan + │ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t4) */ * from ((select t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info Projection 304261169.13 root planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t8.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b @@ -1732,34 +1724,33 @@ Projection 304261169.13 root planner__core__casetest__rule__rule_join_reorder.t └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2, t3) */ * from ((select t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 304261169.13 root CARTESIAN inner join -├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] -│ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] -│ │ ├─TableReader(Build) 9990.00 root data:Selection -│ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) -│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo -│ │ └─TableReader(Probe) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo -│ └─IndexReader(Probe) 9990.00 root index:IndexFullScan -│ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +Projection 2431655263674.32 root planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t8.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b +└─HashJoin 2431655263674.32 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a) eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 1945324210939.45 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 1556259368751.56 root CARTESIAN inner join ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) - └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─HashJoin(Probe) 155781718.59 root CARTESIAN inner join + ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + │ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] + │ │ ├─TableReader(Build) 9990.00 root data:Selection + │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) + │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo + │ │ └─TableReader(Probe) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + │ └─IndexReader(Probe) 9990.00 root index:IndexFullScan + │ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) + └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t4, t1) */ * from ((select t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info Projection 304261169.13 root planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t8.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b @@ -1791,34 +1782,33 @@ Projection 304261169.13 root planner__core__casetest__rule__rule_join_reorder.t └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3, t1) */ * from ((select t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 304261169.13 root CARTESIAN inner join -├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] -│ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] -│ │ ├─TableReader(Build) 9990.00 root data:Selection -│ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) -│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo -│ │ └─TableReader(Probe) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo -│ └─IndexReader(Probe) 9990.00 root index:IndexFullScan -│ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +Projection 2431655263674.32 root planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t8.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b +└─HashJoin 2431655263674.32 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] ├─TableReader(Build) 9990.00 root data:Selection │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + └─HashJoin(Probe) 1945324210939.45 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a) eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 1556259368751.56 root CARTESIAN inner join ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) - └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 155781718.59 root CARTESIAN inner join + ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + │ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] + │ │ ├─TableReader(Build) 9990.00 root data:Selection + │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) + │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo + │ │ └─TableReader(Probe) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + │ └─IndexReader(Probe) 9990.00 root index:IndexFullScan + │ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) + └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo explain format = 'brief' select * from ((select /*+ leading(t5) */ t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info HashJoin 304261169.13 root CARTESIAN inner join @@ -1933,124 +1923,118 @@ HashJoin 304261169.13 root inner join, equal:[eq(planner__core__casetest__rule_ └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3) */ * from ((select /*+ leading(t5) */ t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 304261169.13 root CARTESIAN inner join -├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] -│ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] -│ │ ├─TableReader(Build) 9990.00 root data:Selection -│ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) -│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo -│ │ └─TableReader(Probe) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo -│ └─IndexReader(Probe) 9990.00 root index:IndexFullScan -│ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +HashJoin 304261169.13 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +├─TableReader(Build) 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +└─HashJoin(Probe) 243408935.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 194727148.24 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 155781718.59 root CARTESIAN inner join + ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] + │ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t6.a)] + │ │ ├─IndexReader(Build) 9990.00 root index:IndexFullScan + │ │ │ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo + │ │ └─TableReader(Probe) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo -Level Code Message -Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid explain format = 'brief' select /*+ leading(t3, t1) */ * from ((select /*+ leading(t7) */ t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 304261169.13 root CARTESIAN inner join -├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] -│ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] -│ │ ├─TableReader(Build) 9990.00 root data:Selection -│ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) -│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo -│ │ └─TableReader(Probe) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo -│ └─IndexReader(Probe) 9990.00 root index:IndexFullScan -│ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +Projection 2431655263674.32 root planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t8.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b +└─HashJoin 2431655263674.32 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] ├─TableReader(Build) 9990.00 root data:Selection │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + └─HashJoin(Probe) 1945324210939.45 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a) eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 1556259368751.56 root CARTESIAN inner join ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) - └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo -Level Code Message -Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 155781718.59 root CARTESIAN inner join + ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + │ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t7.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] + │ │ ├─TableReader(Build) 9990.00 root data:Selection + │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) + │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo + │ │ └─TableReader(Probe) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + │ └─IndexReader(Probe) 9990.00 root index:IndexFullScan + │ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) + └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3, t1, t2) */ * from ((select /*+ leading(t6, t7) */ t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 304261169.13 root CARTESIAN inner join -├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] -│ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] -│ │ ├─TableReader(Build) 9990.00 root data:Selection -│ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) -│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo -│ │ └─TableReader(Probe) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo -│ └─IndexReader(Probe) 9990.00 root index:IndexFullScan -│ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +Projection 2431655263674.32 root planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t8.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b +└─HashJoin 2431655263674.32 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a) eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 1945324210939.45 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─HashJoin(Probe) 1556259368751.56 root CARTESIAN inner join ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) - └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo -Level Code Message -Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 155781718.59 root CARTESIAN inner join + ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + │ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] + │ │ ├─TableReader(Build) 9990.00 root data:Selection + │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) + │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo + │ │ └─TableReader(Probe) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + │ └─IndexReader(Probe) 9990.00 root index:IndexFullScan + │ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) + └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3, t4) */ * from ((select /*+ leading(t5, t7, t8) */ t8.a, t8.b from t8, t7, t6, t5 where t5.a = t6.a and t6.b=t7.b) t3 join t4 on t3.a=t4.a) join (t1 join t2 on t1.a=t2.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 304261169.13 root CARTESIAN inner join -├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] -│ ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t7.b)] -│ │ ├─TableReader(Build) 9990.00 root data:Selection -│ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) -│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo -│ │ └─TableReader(Probe) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo -│ └─IndexReader(Probe) 9990.00 root index:IndexFullScan -│ └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +HashJoin 2431655263674.32 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +├─TableReader(Build) 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +└─HashJoin(Probe) 1945324210939.45 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 1556259368751.56 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t8.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) - └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo -Level Code Message -Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 1245007495001.25 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t7.b, planner__core__casetest__rule__rule_join_reorder.t6.b) eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t6.a)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + └─HashJoin(Probe) 997002999000.00 root CARTESIAN inner join + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t8.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t8 keep order:false, stats:pseudo + └─HashJoin(Probe) 99800100.00 root CARTESIAN inner join + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t7.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t7 keep order:false, stats:pseudo + └─IndexReader(Probe) 9990.00 root index:IndexFullScan + └─IndexFullScan 9990.00 cop[tikv] table:t5, index:a(a) keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(tx, t1, t3) */ * from t1, (select * from t2) tx, t3 where t1.a=tx.a and tx.a=t3.a; id estRows task access object operator info Projection 15609.38 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b @@ -2095,22 +2079,21 @@ Projection 15609.38 root planner__core__casetest__rule__rule_join_reorder.t1.a, └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(tx, t1, t3) */ * from t1, (select t2.* from t2, t4 where t2.a=t4.a) tx, t3 where t1.a=tx.a and tx.a=t3.a; id estRows task access object operator info -HashJoin 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] -├─TableReader(Build) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -└─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] - ├─IndexReader(Build) 9990.00 root index:IndexFullScan - │ └─IndexFullScan 9990.00 cop[tikv] table:t4, index:a(a) keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19511.72 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─HashJoin(Build) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + │ ├─IndexReader(Build) 9990.00 root index:IndexFullScan + │ │ └─IndexFullScan 9990.00 cop[tikv] table:t4, index:a(a) keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid select /*+ leading(t1) leading(t2) */ * from t1 join t2 on t1.a=t2.a join t3 on t2.b=t3.b; a b a b a b Level Code Message @@ -2179,8 +2162,6 @@ Warning 1815 There are no matching table names for (t1) in optimizer hint /*+ LE Warning 1815 leading hint is inapplicable, check if the leading hint table is valid select /*+ leading(t4) */ * from (select t2.b from t1 join t2 on t1.a=t2.a) t4 join t3 on t4.b=t3.b; b a b -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid select /*+ leading(t3, t2@sel_2) */ * from (select t2.b from t1 join t2 on t1.a=t2.a) t4 join t3 on t4.b=t3.b; b a b Level Code Message @@ -3003,23 +2984,22 @@ HashJoin 50000.00 root left outer join, equal:[eq(planner__core__casetest__rule └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t2, t3) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b; id estRows task access object operator info -HashJoin 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] -├─PartitionUnion(Build) 50000.00 root -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo -│ └─TableReader 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo -└─Projection(Probe) 46781.30 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b - └─HashJoin 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] +Projection 58476.62 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b +└─HashJoin 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─PartitionUnion(Build) 50000.00 root + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo + │ └─TableReader 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] ├─PartitionUnion(Build) 39960.00 root │ ├─TableReader 9990.00 root data:Selection │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) @@ -3059,23 +3039,22 @@ HashJoin 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b; id estRows task access object operator info -HashJoin 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] -├─PartitionUnion(Build) 50000.00 root -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo -│ ├─TableReader 10000.00 root data:TableFullScan -│ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo -│ └─TableReader 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo -└─Projection(Probe) 46781.30 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b - └─HashJoin 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] +Projection 58476.62 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b +└─HashJoin 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─PartitionUnion(Build) 50000.00 root + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo + │ └─TableReader 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] ├─PartitionUnion(Build) 39960.00 root │ ├─TableReader 9990.00 root data:Selection │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) @@ -3118,485 +3097,478 @@ Warning 1815 leading hint is inapplicable, check if the leading hint table is va explain format = 'brief' select /*+ leading(t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b; id estRows task access object operator info Projection 54821.83 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t6.b -└─HashJoin 54821.83 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─Projection(Build) 46781.30 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b - │ └─HashJoin 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] - │ ├─PartitionUnion(Build) 39960.00 root - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo - │ │ └─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo - │ └─HashJoin(Probe) 37425.04 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] - │ ├─PartitionUnion(Build) 29940.03 root - │ │ ├─TableReader 9980.01 root data:Selection - │ │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9980.01 root data:Selection - │ │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo - │ │ └─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo - │ └─PartitionUnion(Probe) 39920.04 root - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo - │ └─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 46828.12 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] - ├─PartitionUnion(Build) 49950.00 root - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo - └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t5.b)] - ├─PartitionUnion(Build) 29970.00 root +└─HashJoin 54821.83 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p2 keep order:false, stats:pseudo + └─HashJoin(Probe) 73022.68 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + ├─PartitionUnion(Build) 49900.05 root + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p3 keep order:false, stats:pseudo + │ └─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─PartitionUnion(Build) 49950.00 root │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p0 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p1 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p2 keep order:false, stats:pseudo - └─PartitionUnion(Probe) 49900.05 root - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p0 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p1 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p2 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p3 keep order:false, stats:pseudo - └─TableReader 9980.01 root data:Selection - └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p4 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─PartitionUnion(Build) 39960.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo + └─HashJoin(Probe) 37425.04 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─PartitionUnion(Build) 29940.03 root + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo + └─PartitionUnion(Probe) 39920.04 root + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo + └─TableReader 9980.01 root data:Selection + └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t3, t4) leading(t5, t6) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b; id estRows task access object operator info Projection 54821.83 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t6.b -└─HashJoin 54821.83 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─Projection(Build) 46781.30 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b - │ └─HashJoin 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] - │ ├─PartitionUnion(Build) 39960.00 root - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo - │ │ └─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo - │ └─HashJoin(Probe) 37425.04 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] - │ ├─PartitionUnion(Build) 29940.03 root - │ │ ├─TableReader 9980.01 root data:Selection - │ │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9980.01 root data:Selection - │ │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo - │ │ └─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo - │ └─PartitionUnion(Probe) 39920.04 root - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo - │ └─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 46828.12 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] - ├─PartitionUnion(Build) 49950.00 root - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo - └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t5.b)] - ├─PartitionUnion(Build) 29970.00 root +└─HashJoin 54821.83 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p2 keep order:false, stats:pseudo + └─HashJoin(Probe) 73022.68 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + ├─PartitionUnion(Build) 49900.05 root + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p3 keep order:false, stats:pseudo + │ └─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─PartitionUnion(Build) 49950.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p0 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p1 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p2 keep order:false, stats:pseudo - └─PartitionUnion(Probe) 49900.05 root - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p0 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p1 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p2 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p3 keep order:false, stats:pseudo - └─TableReader 9980.01 root data:Selection - └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p4 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─PartitionUnion(Build) 39960.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo + └─HashJoin(Probe) 37425.04 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─PartitionUnion(Build) 29940.03 root + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo + └─PartitionUnion(Probe) 39920.04 root + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo + └─TableReader 9980.01 root data:Selection + └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo Level Code Message Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid explain format = 'brief' select /*+ leading(t5, t6, t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b; id estRows task access object operator info -Projection 54821.83 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t6.b -└─HashJoin 54821.83 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─Projection(Build) 46781.30 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b - │ └─HashJoin 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] - │ ├─PartitionUnion(Build) 39960.00 root - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo - │ │ └─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo - │ └─HashJoin(Probe) 37425.04 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] - │ ├─PartitionUnion(Build) 29940.03 root - │ │ ├─TableReader 9980.01 root data:Selection - │ │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9980.01 root data:Selection - │ │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo - │ │ └─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo - │ └─PartitionUnion(Probe) 39920.04 root - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo - │ └─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 46828.12 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +Projection 54821.83 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t6.b +└─HashJoin 54821.83 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p2 keep order:false, stats:pseudo + └─HashJoin(Probe) 73022.68 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + ├─PartitionUnion(Build) 49900.05 root + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p3 keep order:false, stats:pseudo + │ └─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 58476.62 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─PartitionUnion(Build) 49950.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 46781.30 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─PartitionUnion(Build) 39960.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo + └─HashJoin(Probe) 37425.04 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─PartitionUnion(Build) 29940.03 root + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo + └─PartitionUnion(Probe) 39920.04 root + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo + ├─TableReader 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo + └─TableReader 9980.01 root data:Selection + └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo +Level Code Message +Warning 1815 leading hint is inapplicable, check if the leading hint table is valid +explain format = 'brief' select /*+ leading(t1, t2) */ * from t4 join t on t4.a=t.a right join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b=t3.b; +id estRows task access object operator info +Projection 43901.37 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 43901.37 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo + └─HashJoin(Probe) 58535.16 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] ├─PartitionUnion(Build) 49950.00 root │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo - └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t6.b, planner__core__casetest__rule__rule_join_reorder.t5.b)] - ├─PartitionUnion(Build) 29970.00 root - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p0 keep order:false, stats:pseudo + └─HashJoin(Probe) 46828.12 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─PartitionUnion(Build) 39960.00 root │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p1 keep order:false, stats:pseudo - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t6, partition:p2 keep order:false, stats:pseudo - └─PartitionUnion(Probe) 49900.05 root - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p0 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p1 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p2 keep order:false, stats:pseudo - ├─TableReader 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p3 keep order:false, stats:pseudo - └─TableReader 9980.01 root data:Selection - └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - └─TableFullScan 10000.00 cop[tikv] table:t5, partition:p4 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -explain format = 'brief' select /*+ leading(t1, t2) */ * from t4 join t on t4.a=t.a right join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b=t3.b; -id estRows task access object operator info -Projection 46828.12 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b -└─HashJoin 46828.12 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] - ├─Projection(Build) 37462.50 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b - │ └─HashJoin 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] - │ ├─PartitionUnion(Build) 29970.00 root - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo - │ │ └─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo - │ └─PartitionUnion(Probe) 39960.00 root - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 39960.00 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─PartitionUnion(Build) 39960.00 root - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] - ├─PartitionUnion(Build) 29970.00 root + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo - └─PartitionUnion(Probe) 49950.00 root - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo - └─TableReader 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo + └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo + └─PartitionUnion(Probe) 39960.00 root + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo + └─TableReader 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t2, t3) */ * from t4 join t on t4.a=t.a right join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b=t3.b; id estRows task access object operator info -Projection 46828.12 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b -└─HashJoin 46828.12 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] - ├─Projection(Build) 37462.50 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b - │ └─HashJoin 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] - │ ├─PartitionUnion(Build) 29970.00 root - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo - │ │ └─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo - │ └─PartitionUnion(Probe) 39960.00 root - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 39960.00 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─PartitionUnion(Build) 39960.00 root +Projection 43901.37 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 43901.37 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo + └─HashJoin(Probe) 58535.16 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─PartitionUnion(Build) 49950.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] - ├─PartitionUnion(Build) 29970.00 root + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 46828.12 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─PartitionUnion(Build) 39960.00 root │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo - └─PartitionUnion(Probe) 49950.00 root - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo - └─TableReader 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo + └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo + └─PartitionUnion(Probe) 39960.00 root + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo + └─TableReader 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t1, t3) */ * from t4 join t on t4.a=t.a right join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b=t3.b; id estRows task access object operator info -Projection 46828.12 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b -└─HashJoin 46828.12 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] - ├─Projection(Build) 37462.50 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b - │ └─HashJoin 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] - │ ├─PartitionUnion(Build) 29970.00 root - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo - │ │ ├─TableReader 9990.00 root data:Selection - │ │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo - │ │ └─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo - │ └─PartitionUnion(Probe) 39960.00 root - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo - │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 39960.00 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─PartitionUnion(Build) 39960.00 root +Projection 43901.37 root planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 43901.37 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo + └─HashJoin(Probe) 58535.16 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─PartitionUnion(Build) 49950.00 root │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo - └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] - ├─PartitionUnion(Build) 29970.00 root + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + └─HashJoin(Probe) 46828.12 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─PartitionUnion(Build) 39960.00 root │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p0 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p0 keep order:false, stats:pseudo │ ├─TableReader 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p1 keep order:false, stats:pseudo + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p1 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p2 keep order:false, stats:pseudo │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3, partition:p2 keep order:false, stats:pseudo - └─PartitionUnion(Probe) 49950.00 root - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p0 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p1 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p2 keep order:false, stats:pseudo - ├─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p3 keep order:false, stats:pseudo - └─TableReader 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2, partition:p4 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1, partition:p3 keep order:false, stats:pseudo + └─HashJoin(Probe) 37462.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t4.a)] + ├─PartitionUnion(Build) 29970.00 root + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p0 keep order:false, stats:pseudo + │ ├─TableReader 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p1 keep order:false, stats:pseudo + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t, partition:p2 keep order:false, stats:pseudo + └─PartitionUnion(Probe) 39960.00 root + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p0 keep order:false, stats:pseudo + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p1 keep order:false, stats:pseudo + ├─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p2 keep order:false, stats:pseudo + └─TableReader 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + └─TableFullScan 10000.00 cop[tikv] table:t4, partition:p3 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t3) */ * from t2 right join (t1 left join t3 on t1.a=t3.a) on t2.b=t1.b; @@ -4343,11 +4315,11 @@ Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t2) */ * from t1 join t2 on t1.a=t2.a right join t3 on t2.b=t3.b; id estRows task access object operator info -HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -└─Projection(Probe) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b - └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] +Projection 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9980.01 root data:Selection │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo @@ -4356,11 +4328,11 @@ HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rul └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3) */ * from t1 join t2 on t1.a=t2.a right join t3 on t2.b=t3.b; id estRows task access object operator info -HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -└─Projection(Probe) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b - └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] +Projection 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9980.01 root data:Selection │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo @@ -4369,11 +4341,11 @@ HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rul └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2, t3) */ * from t1 join t2 on t1.a=t2.a right join t3 on t2.b=t3.b; id estRows task access object operator info -HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -└─Projection(Probe) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b - └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] +Projection 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9980.01 root data:Selection │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo @@ -4382,14 +4354,13 @@ HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rul └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t3, t2) */ * from t1 join t2 on t1.a=t2.a right join t3 on t2.b=t3.b; id estRows task access object operator info -HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -└─Projection(Probe) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b - └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] +Projection 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9980.01 root data:Selection │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo @@ -4398,14 +4369,13 @@ HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rul └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t3, t1) */ * from t1 join t2 on t1.a=t2.a right join t3 on t2.b=t3.b; id estRows task access object operator info -HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -└─Projection(Probe) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b - └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] +Projection 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9980.01 root data:Selection │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo @@ -4414,7 +4384,6 @@ HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rul └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t2) */ * from t1 join t2 on t1.a=t2.a cross join t3; id estRows task access object operator info Projection 124875000.00 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b @@ -4441,8 +4410,6 @@ Projection 124875000.00 root planner__core__casetest__rule__rule_join_reorder.t └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table has join conditions with other tables explain format = 'brief' select /*+ leading(t2, t3) */ * from t1 join t2 on t1.a=t2.a cross join t3; id estRows task access object operator info Projection 124875000.00 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b @@ -4493,8 +4460,6 @@ HashJoin 124875000.00 root CARTESIAN inner join │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo └─TableReader(Probe) 10000.00 root data:TableFullScan └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table has join conditions with other tables explain format = 'brief' select /*+ leading(t2, t1) */ * from t1 right join t2 on t1.a=t2.a cross join t3; id estRows task access object operator info HashJoin 124875000.00 root CARTESIAN inner join @@ -4506,8 +4471,6 @@ HashJoin 124875000.00 root CARTESIAN inner join │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo └─TableReader(Probe) 10000.00 root data:TableFullScan └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table has join conditions with other tables explain format = 'brief' select /*+ leading(t3, t1) */ * from t1 right join t2 on t1.a=t2.a right join t3 on t2.b=t3.b; id estRows task access object operator info HashJoin 15609.38 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] @@ -4522,7 +4485,6 @@ HashJoin 15609.38 root right outer join, equal:[eq(planner__core__casetest__rul └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t1) */ * from t1 left join t2 on t1.a=t2.a straight_join t3; id estRows task access object operator info HashJoin 124875000.00 root CARTESIAN inner join @@ -5970,23 +5932,11 @@ Projection 24365.26 root planner__core__casetest__rule__rule_join_reorder.t4.a, └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] ├─TableReader(Build) 9990.00 root data:Selection │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo -explain format = 'brief' select /*+ leading(t3) */ * from t2 left join (t1 left join t3 on t1.a=t3.a) on t2.b=t1.b; -id estRows task access object operator info -HashJoin 15609.38 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo -└─HashJoin(Probe) 12487.50 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -explain format = 'brief' select /*+ leading(t2, t1, t3) */ * from t2 left join (t1 left join t3 on t1.a=t3.a) on t2.b=t1.b; + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo +explain format = 'brief' select /*+ leading(t3) */ * from t2 left join (t1 left join t3 on t1.a=t3.a) on t2.b=t1.b; id estRows task access object operator info HashJoin 15609.38 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] ├─TableReader(Build) 10000.00 root data:TableFullScan @@ -5998,9 +5948,18 @@ HashJoin 15609.38 root left outer join, equal:[eq(planner__core__casetest__rule └─TableReader(Probe) 9990.00 root data:Selection └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -Level Code Message -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid +explain format = 'brief' select /*+ leading(t2, t1, t3) */ * from t2 left join (t1 left join t3 on t1.a=t3.a) on t2.b=t1.b; +id estRows task access object operator info +HashJoin 15609.38 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] +├─TableReader(Build) 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)) +│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo +└─HashJoin(Probe) 12487.50 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2, t3) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b; id estRows task access object operator info HashJoin 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] @@ -6019,14 +5978,13 @@ HashJoin 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b; id estRows task access object operator info -HashJoin 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo -└─Projection(Probe) 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b - └─HashJoin 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b +└─HashJoin 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9980.01 root data:Selection │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo @@ -6040,87 +5998,83 @@ HashJoin 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule explain format = 'brief' select /*+ leading(t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b; id estRows task access object operator info Projection 30426.12 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t6.b -└─HashJoin 30426.12 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─Projection(Build) 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b - │ └─HashJoin 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] - │ ├─TableReader(Build) 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - │ └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] - │ ├─TableReader(Build) 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - │ └─TableReader(Probe) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo - └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] - ├─TableReader(Build) 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +└─HashJoin 30426.12 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo + └─HashJoin(Probe) 24340.89 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo + └─HashJoin(Probe) 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3, t4) leading(t5, t6) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b; id estRows task access object operator info -Projection 30426.12 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t6.b -└─HashJoin 30426.12 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] - │ ├─TableReader(Build) 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - │ └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] - │ ├─TableReader(Build) 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - │ └─TableReader(Probe) 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] +HashJoin 30426.12 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] +├─TableReader(Build) 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) +│ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo +└─HashJoin(Probe) 24340.89 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo + └─HashJoin(Probe) 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo - └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] - ├─TableReader(Build) 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9980.01 root data:Selection + └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo Level Code Message Warning 1815 We can only use one leading hint at most, when multiple leading hints are used, all leading hints will be invalid explain format = 'brief' select /*+ leading(t5, t6, t3, t4) */ * from t2 left join (t1 join t3 on t1.a=t3.a join t4 on t3.b = t4.b) on t2.b=t1.b join t5 on t2.a = t5.a join t6 on t5.b=t6.b; id estRows task access object operator info -Projection 30426.12 root planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b, planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.a, planner__core__casetest__rule__rule_join_reorder.t6.b -└─HashJoin 30426.12 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] - ├─HashJoin(Build) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] - │ ├─TableReader(Build) 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - │ └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] - │ ├─TableReader(Build) 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - │ └─TableReader(Probe) 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] +HashJoin 30426.12 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.b, planner__core__casetest__rule__rule_join_reorder.t6.b)] +├─TableReader(Build) 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) +│ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo +└─HashJoin(Probe) 24340.89 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t5.a)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo + └─HashJoin(Probe) 19492.21 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t1.b)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t6.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t6 keep order:false, stats:pseudo - └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t5.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] - ├─TableReader(Build) 9980.01 root data:Selection - │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t5.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─HashJoin(Probe) 15593.77 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] + ├─TableReader(Build) 9980.01 root data:Selection + │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9980.01 root data:Selection + └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid -Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t1, t2) */ * from t4 join t on t4.a=t.a right join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b=t3.b; id estRows task access object operator info HashJoin 24389.65 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] @@ -6166,25 +6120,25 @@ Projection 24389.65 root planner__core__casetest__rule__rule_join_reorder.t4.a, └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t1, t3) */ * from t4 join t on t4.a=t.a right join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b=t3.b; id estRows task access object operator info -HashJoin 24389.65 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] -├─HashJoin(Build) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t.a)] -│ ├─TableReader(Build) 9990.00 root data:Selection -│ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─HashJoin(Probe) 15609.38 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] +HashJoin 24389.65 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] +├─TableReader(Build) 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) +│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo +└─HashJoin(Probe) 19511.72 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + └─HashJoin(Probe) 15609.38 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t4.a)) + └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo Level Code Message Warning 1815 leading hint is inapplicable, check if the leading hint table is valid explain format = 'brief' select /*+ leading(t3) */ * from t2 right join (t1 left join t3 on t1.a=t3.a) on t2.b=t1.b; @@ -6331,58 +6285,58 @@ Projection 243165526.37 root planner__core__casetest__rule__rule_join_reorder.t └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2) hash_join(t2) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info -HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] -├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b -│ └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] -│ ├─TableReader(Build) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -└─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + │ ├─TableReader(Build) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2) hash_join(t1) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info -HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] -├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b -│ └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] -│ ├─TableReader(Build) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -└─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + │ ├─TableReader(Build) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2) hash_join(t3) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info -HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] -├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b -│ └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] -│ ├─TableReader(Build) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -└─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + │ ├─TableReader(Build) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t) hash_join(t2) */ * from t left join t1 on t.a = t1.a left join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info HashJoin 19492.21 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] @@ -6436,58 +6390,57 @@ HashJoin 19492.21 root inner join, equal:[eq(planner__core__casetest__rule__rul └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2) INL_JOIN(t1) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info -HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] -├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b -│ └─IndexJoin 12475.01 root inner join, inner:IndexLookUp, outer key:planner__core__casetest__rule__rule_join_reorder.t.a, inner key:planner__core__casetest__rule__rule_join_reorder.t1.a, equal cond:eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a) -│ ├─TableReader(Build) 9990.00 root data:Selection -│ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -│ └─IndexLookUp(Probe) 12475.01 root -│ ├─Selection(Build) 12487.50 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) -│ │ └─IndexRangeScan 12500.00 cop[tikv] table:t1, index:a(a) range: decided by [eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)], keep order:false, stats:pseudo -│ └─Selection(Probe) 12475.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) -│ └─TableRowIDScan 12487.50 cop[tikv] table:t1 keep order:false, stats:pseudo -└─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─IndexJoin(Build) 12475.01 root inner join, inner:IndexLookUp, outer key:planner__core__casetest__rule__rule_join_reorder.t.a, inner key:planner__core__casetest__rule__rule_join_reorder.t1.a, equal cond:eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a) + │ ├─TableReader(Build) 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + │ └─IndexLookUp(Probe) 12475.01 root + │ ├─Selection(Build) 12487.50 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ │ └─IndexRangeScan 12500.00 cop[tikv] table:t1, index:a(a) range: decided by [eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)], keep order:false, stats:pseudo + │ └─Selection(Probe) 12475.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableRowIDScan 12487.50 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2) INL_JOIN(t3) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info -HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] -├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b -│ └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] -│ ├─TableReader(Build) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -└─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] - ├─TableReader(Build) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + │ ├─TableReader(Build) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo Level Code Message Warning 1815 Optimizer Hint /*+ INL_JOIN(t3) */ or /*+ TIDB_INLJ(t3) */ is inapplicable explain format = 'brief' select /*+ leading(t3) INL_JOIN(t1) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b └─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] - ├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b - │ └─IndexJoin 12475.01 root inner join, inner:IndexLookUp, outer key:planner__core__casetest__rule__rule_join_reorder.t.a, inner key:planner__core__casetest__rule__rule_join_reorder.t1.a, equal cond:eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a) - │ ├─TableReader(Build) 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo - │ └─IndexLookUp(Probe) 12475.01 root - │ ├─Selection(Build) 12487.50 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) - │ │ └─IndexRangeScan 12500.00 cop[tikv] table:t1, index:a(a) range: decided by [eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)], keep order:false, stats:pseudo - │ └─Selection(Probe) 12475.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ └─TableRowIDScan 12487.50 cop[tikv] table:t1 keep order:false, stats:pseudo + ├─IndexJoin(Build) 12475.01 root inner join, inner:IndexLookUp, outer key:planner__core__casetest__rule__rule_join_reorder.t.a, inner key:planner__core__casetest__rule__rule_join_reorder.t1.a, equal cond:eq(planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t1.a) + │ ├─TableReader(Build) 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + │ └─IndexLookUp(Probe) 12475.01 root + │ ├─Selection(Build) 12487.50 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)) + │ │ └─IndexRangeScan 12500.00 cop[tikv] table:t1, index:a(a) range: decided by [eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)], keep order:false, stats:pseudo + │ └─Selection(Probe) 12475.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableRowIDScan 12487.50 cop[tikv] table:t1 keep order:false, stats:pseudo └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] ├─TableReader(Build) 9990.00 root data:Selection │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) @@ -6499,14 +6452,13 @@ explain format = 'brief' select /*+ leading(t3) INL_JOIN(t3) */ * from t left jo id estRows task access object operator info Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b └─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] - ├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b - │ └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] - │ ├─TableReader(Build) 9980.01 root data:Selection - │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - │ └─TableReader(Probe) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + │ ├─TableReader(Build) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo └─HashJoin(Probe) 12487.50 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t3.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] ├─TableReader(Build) 9990.00 root data:Selection │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) @@ -6518,24 +6470,24 @@ Level Code Message Warning 1815 Optimizer Hint /*+ INL_JOIN(t3) */ or /*+ TIDB_INLJ(t3) */ is inapplicable explain format = 'brief' select /*+ leading(t2) merge_join(t2) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info -HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] -├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b -│ └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] -│ ├─TableReader(Build) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -└─MergeJoin(Probe) 12487.50 root inner join, left key:planner__core__casetest__rule__rule_join_reorder.t2.b, right key:planner__core__casetest__rule__rule_join_reorder.t3.b - ├─Sort(Build) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t3.b - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─Sort(Probe) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t2.b - └─TableReader 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + │ ├─TableReader(Build) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─MergeJoin(Probe) 12487.50 root inner join, left key:planner__core__casetest__rule__rule_join_reorder.t2.b, right key:planner__core__casetest__rule__rule_join_reorder.t3.b + ├─Sort(Build) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t3.b + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─Sort(Probe) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t2.b + └─TableReader 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t1) merge_join(t2) */ * from t join t1 on t.a = t1.a left join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b @@ -6558,24 +6510,24 @@ Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t2) merge_join(t3) */ * from t left join t1 on t.a = t1.a right join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info -HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] -├─Projection(Build) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b -│ └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] -│ ├─TableReader(Build) 9980.01 root data:Selection -│ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) -│ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo -└─MergeJoin(Probe) 12487.50 root inner join, left key:planner__core__casetest__rule__rule_join_reorder.t2.b, right key:planner__core__casetest__rule__rule_join_reorder.t3.b - ├─Sort(Build) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t3.b - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─Sort(Probe) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t2.b - └─TableReader 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b +└─HashJoin 19492.21 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.b)] + ├─HashJoin(Build) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t.a)] + │ ├─TableReader(Build) 9980.01 root data:Selection + │ │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─MergeJoin(Probe) 12487.50 root inner join, left key:planner__core__casetest__rule__rule_join_reorder.t2.b, right key:planner__core__casetest__rule__rule_join_reorder.t3.b + ├─Sort(Build) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t3.b + │ └─TableReader 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t3.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + └─Sort(Probe) 9990.00 root planner__core__casetest__rule__rule_join_reorder.t2.b + └─TableReader 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) + └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3) merge_join(t3) */ * from t join t1 on t.a = t1.a join t2 on t1.b = t2.b join t3 on t2.b = t3.b ; id estRows task access object operator info Projection 19492.21 root planner__core__casetest__rule__rule_join_reorder.t.a, planner__core__casetest__rule__rule_join_reorder.t.b, planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t3.a, planner__core__casetest__rule__rule_join_reorder.t3.b @@ -7159,16 +7111,17 @@ id estRows task access object operator info HashJoin 12487.50 root Null-aware anti semi join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] ├─IndexReader(Build) 10000.00 root index:IndexFullScan │ └─IndexFullScan 10000.00 cop[tikv] table:t3, index:a(a) keep order:false, stats:pseudo -└─HashJoin(Probe) 15609.38 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo - └─HashJoin(Probe) 12487.50 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] +└─Projection(Probe) 15609.38 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b + └─HashJoin 15609.38 root left outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t2.a)] ├─TableReader(Build) 9990.00 root data:Selection │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─HashJoin(Probe) 12487.50 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t1.b)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo explain format = 'brief' select /*+ leading(t3@sel_2) */ * from t1 left join t2 on t1.a=t2.a where t1.a not in (select t3.a from t3); id estRows task access object operator info HashJoin 9990.00 root Null-aware anti semi join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t3.a)] @@ -7277,11 +7230,11 @@ Level Code Message Warning 1815 There are no matching table names for (t4) in optimizer hint /*+ LEADING(t2, t4) */. Maybe you can use the table alias name explain format = 'brief' select /*+ leading(t3) */ * from t1 join t2 on t1.a=t2.a right join (select * from t4) t3 on t2.b=t3.b; id estRows task access object operator info -HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─Projection(Probe) 12475.01 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b - └─HashJoin 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] +Projection 15593.77 root planner__core__casetest__rule__rule_join_reorder.t1.a, planner__core__casetest__rule__rule_join_reorder.t1.b, planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t4.a, planner__core__casetest__rule__rule_join_reorder.t4.b +└─HashJoin 15593.77 root right outer join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.b, planner__core__casetest__rule__rule_join_reorder.t4.b)] + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─HashJoin(Probe) 12475.01 root inner join, equal:[eq(planner__core__casetest__rule__rule_join_reorder.t2.a, planner__core__casetest__rule__rule_join_reorder.t1.a)] ├─TableReader(Build) 9980.01 root data:Selection │ └─Selection 9980.01 cop[tikv] not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.a)), not(isnull(planner__core__casetest__rule__rule_join_reorder.t2.b)) │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo diff --git a/tests/integrationtest/r/planner/core/cbo.result b/tests/integrationtest/r/planner/core/cbo.result index 9af9a3a48e50e..0fa235d2348d4 100644 --- a/tests/integrationtest/r/planner/core/cbo.result +++ b/tests/integrationtest/r/planner/core/cbo.result @@ -3,13 +3,13 @@ create table t(a int, b int); explain update t t1, (select distinct b from t) t2 set t1.b = t2.b; id estRows task access object operator info Update_7 N/A root N/A -└─HashJoin_10 80000000.00 root CARTESIAN inner join - ├─HashAgg_18(Build) 8000.00 root group by:planner__core__cbo.t.b, funcs:firstrow(planner__core__cbo.t.b)->planner__core__cbo.t.b - │ └─TableReader_19 8000.00 root data:HashAgg_14 - │ └─HashAgg_14 8000.00 cop[tikv] group by:planner__core__cbo.t.b, - │ └─TableFullScan_17 10000.00 cop[tikv] table:t keep order:false, stats:pseudo - └─TableReader_13(Probe) 10000.00 root data:TableFullScan_12 - └─TableFullScan_12 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo +└─HashJoin_11 80000000.00 root CARTESIAN inner join + ├─HashAgg_19(Build) 8000.00 root group by:planner__core__cbo.t.b, funcs:firstrow(planner__core__cbo.t.b)->planner__core__cbo.t.b + │ └─TableReader_20 8000.00 root data:HashAgg_15 + │ └─HashAgg_15 8000.00 cop[tikv] group by:planner__core__cbo.t.b, + │ └─TableFullScan_18 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + └─TableReader_14(Probe) 10000.00 root data:TableFullScan_13 + └─TableFullScan_13 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo drop table if exists tb1, tb2; create table tb1(a int, b int, primary key(a)); create table tb2 (a int, b int, c int, d datetime, primary key(c),key idx_u(a)); diff --git a/tests/integrationtest/r/planner/core/issuetest/planner_issue.result b/tests/integrationtest/r/planner/core/issuetest/planner_issue.result index 74c84074efeca..ad6b069e8d993 100644 --- a/tests/integrationtest/r/planner/core/issuetest/planner_issue.result +++ b/tests/integrationtest/r/planner/core/issuetest/planner_issue.result @@ -919,19 +919,19 @@ left join (select a, b, c, (row_number() over (partition by b order by e asc)) from t4) tmp4 on tmp4.b = t2.c and tmp4.c = t3.c join t5 on t5.a = t1.e; id estRows task access object operator info -HashJoin 19472.71 root inner join, equal:[eq(test.t5.a, test.t1.e)] -├─TableReader(Build) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(test.t5.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo -└─HashJoin(Probe) 15578.17 root left outer join, equal:[eq(test.t2.c, test.t4.b) eq(test.t3.c, test.t4.c)] - ├─Selection(Build) 7992.00 root not(isnull(test.t4.c)) - │ └─Shuffle 9990.00 root execution info: concurrency:100, data sources:[TableReader] - │ └─Window 9990.00 root row_number()->Column#26 over(partition by test.t4.b order by test.t4.e rows between current row and current row) - │ └─Sort 9990.00 root test.t4.b, test.t4.e - │ └─ShuffleReceiver 9990.00 root - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo +HashJoin 19472.71 root left outer join, equal:[eq(test.t2.c, test.t4.b) eq(test.t3.c, test.t4.c)] +├─Selection(Build) 7992.00 root not(isnull(test.t4.c)) +│ └─Shuffle 9990.00 root execution info: concurrency:100, data sources:[TableReader] +│ └─Window 9990.00 root row_number()->Column#26 over(partition by test.t4.b order by test.t4.e rows between current row and current row) +│ └─Sort 9990.00 root test.t4.b, test.t4.e +│ └─ShuffleReceiver 9990.00 root +│ └─TableReader 9990.00 root data:Selection +│ └─Selection 9990.00 cop[tikv] not(isnull(test.t4.b)) +│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo +└─HashJoin(Probe) 19472.71 root inner join, equal:[eq(test.t1.e, test.t5.a)] + ├─TableReader(Build) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(test.t5.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:false, stats:pseudo └─HashJoin(Probe) 15578.17 root inner join, equal:[eq(test.t1.b, test.t3.b)] ├─HashJoin(Build) 12462.54 root inner join, equal:[eq(test.t1.a, test.t2.b)] │ ├─TableReader(Build) 9990.00 root data:Selection diff --git a/tests/integrationtest/r/planner/core/join_reorder2.result b/tests/integrationtest/r/planner/core/join_reorder2.result index 3cde4f8ab94d0..14c5cbff90238 100644 --- a/tests/integrationtest/r/planner/core/join_reorder2.result +++ b/tests/integrationtest/r/planner/core/join_reorder2.result @@ -53,19 +53,18 @@ Projection 15625.00 root planner__core__join_reorder2.t1.id, planner__core__joi └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo explain format = 'brief' select /*+ leading(t3, t4, t1, t2) */ * from t1 inner join t3 on t1.id=t3.id left join t4 on t4.id=t3.id join t2 on t1.id=t2.id where t3.name like 'test3' or t4.name like 'test4'; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder2.t1.id, planner__core__join_reorder2.t1.name, planner__core__join_reorder2.t3.id, planner__core__join_reorder2.t3.name, planner__core__join_reorder2.t4.id, planner__core__join_reorder2.t4.name, planner__core__join_reorder2.t2.id, planner__core__join_reorder2.t2.name -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder2.t1.id, right key:planner__core__join_reorder2.t2.id +Projection 19531.25 root planner__core__join_reorder2.t1.id, planner__core__join_reorder2.t1.name, planner__core__join_reorder2.t3.id, planner__core__join_reorder2.t3.name, planner__core__join_reorder2.t4.id, planner__core__join_reorder2.t4.name, planner__core__join_reorder2.t2.id, planner__core__join_reorder2.t2.name +└─MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder2.t1.id, right key:planner__core__join_reorder2.t2.id ├─TableReader(Build) 10000.00 root data:TableFullScan │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder2.t3.id, right key:planner__core__join_reorder2.t1.id + └─MergeJoin(Probe) 15625.00 root inner join, left key:planner__core__join_reorder2.t3.id, right key:planner__core__join_reorder2.t1.id, other cond:or(like(planner__core__join_reorder2.t3.name, "test3", 92), like(planner__core__join_reorder2.t4.name, "test4", 92)) ├─TableReader(Build) 10000.00 root data:TableFullScan │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo - └─Selection(Probe) 10000.00 root or(like(planner__core__join_reorder2.t3.name, "test3", 92), like(planner__core__join_reorder2.t4.name, "test4", 92)) - └─MergeJoin 12500.00 root left outer join, left key:planner__core__join_reorder2.t3.id, right key:planner__core__join_reorder2.t4.id - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo + └─MergeJoin(Probe) 12500.00 root left outer join, left key:planner__core__join_reorder2.t3.id, right key:planner__core__join_reorder2.t4.id + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo + └─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo set @@tidb_opt_join_reorder_through_sel = 0; explain format = 'brief' select /*+ leading(t1@sel_2, t4, t2@sel_2, t3@sel_2) */ * from (select t1.id, t1.name as n1, t2.name as n2, t3.name as n3 from t1 inner join t2 on t1.id=t2.id left join t3 on t2.id=t3.id where t2.name like 'test2' or t3.name like 'test3') sub diff --git a/tests/integrationtest/r/planner/core/join_reorder_through_projection.result b/tests/integrationtest/r/planner/core/join_reorder_through_projection.result index 43469edef6c60..1c912c25a5fdd 100644 --- a/tests/integrationtest/r/planner/core/join_reorder_through_projection.result +++ b/tests/integrationtest/r/planner/core/join_reorder_through_projection.result @@ -39,15 +39,15 @@ explain format = 'brief' select t1.a, dt.doubled_b, dt.shifted_b from t1, from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.a2; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, plus(planner__core__join_reorder_through_projection.t3.b, 100)->Column#11 -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, plus(planner__core__join_reorder_through_projection.t3.b, 100)->Column#11 +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select t1.a, dt.doubled_b, dt.shifted_b from t1, (select t2.a as a2, t2.b * 2 as doubled_b, t3.b + 100 as shifted_b from t2 join t3 on t2.a = t3.a) dt @@ -90,15 +90,15 @@ from t2 join t3 on t2.a = t3.a ) select t1.a, cte.cte_a, cte.doubled_b from t1 join joined_cte cte on t1.a = cte.cte_a; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#19 -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#19 +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo with joined_cte as ( select t2.a as cte_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a @@ -139,15 +139,15 @@ explain format = 'brief' select t1.a, dt.* from t1, from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, plus(planner__core__join_reorder_through_projection.t3.b, 100)->Column#11 -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, plus(planner__core__join_reorder_through_projection.t3.b, 100)->Column#11 +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select t1.a, dt.* from t1, (select t2.a as key_a, t2.b * 2 as doubled_b, t3.b + 100 as shifted_b from t2 join t3 on t2.a = t3.a) dt @@ -428,17 +428,17 @@ cte1 as (select a, b * 2 as doubled_b from t2), cte2 as (select t3.a, t3.b + 100 as shifted_b, cte1.doubled_b from t3 join cte1 on t3.a = cte1.a) select t1.a, cte2.* from t1 join cte2 on t1.b = cte2.doubled_b; id estRows task access object operator info -Projection 12500.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t3.a, plus(planner__core__join_reorder_through_projection.t3.b, 100)->Column#30, Column#29 -└─HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t3.a)] - ├─HashJoin(Build) 10000.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#29)] - │ ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#29 - │ │ └─IndexReader 8000.00 root index:Selection - │ │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) - │ │ └─IndexFullScan 10000.00 cop[tikv] table:t2, index:b(b) keep order:false, stats:pseudo - │ └─IndexReader(Probe) 9990.00 root index:IndexFullScan - │ └─IndexFullScan 9990.00 cop[tikv] table:t1, index:b(b) keep order:false, stats:pseudo - └─IndexReader(Probe) 10000.00 root index:IndexFullScan - └─IndexFullScan 10000.00 cop[tikv] table:t3, index:b(b) keep order:false, stats:pseudo +HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#29)] +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t3.a, plus(planner__core__join_reorder_through_projection.t3.b, 100)->Column#30, Column#29 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t3.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#29 +│ │ └─TableReader 8000.00 root data:Selection +│ │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +└─IndexReader(Probe) 9990.00 root index:IndexFullScan + └─IndexFullScan 9990.00 cop[tikv] table:t1, index:b(b) keep order:false, stats:pseudo with cte1 as (select a, b * 2 as doubled_b from t2), cte2 as (select t3.a, t3.b + 100 as shifted_b, cte1.doubled_b from t3 join cte1 on t3.a = cte1.a) @@ -473,15 +473,15 @@ explain format = 'brief' select t1.a, v.* from t1, (select t2.a as va, t2.b * 2 as vb, t3.b as vb2 from t2, t3 where t2.a = t3.a) v where t1.a = v.va; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, planner__core__join_reorder_through_projection.t3.b -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, planner__core__join_reorder_through_projection.t3.b +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select t1.a, v.* from t1, (select t2.a as va, t2.b * 2 as vb, t3.b as vb2 from t2, t3 where t2.a = t3.a) v where t1.a = v.va @@ -517,15 +517,15 @@ explain format = 'brief' select t1.a, dt.* from t1, (select t2.a as key_a, upper(t2.c) as upper_c from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, upper(planner__core__join_reorder_through_projection.t2.c)->Column#10 -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, upper(planner__core__join_reorder_through_projection.t2.c)->Column#10 +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select t1.a, dt.* from t1, (select t2.a as key_a, upper(t2.c) as upper_c from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a @@ -561,11 +561,11 @@ explain format = 'brief' select dt.*, t5.a as t5_a from (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt left join t5 on dt.key_a = t5.a; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#7, planner__core__join_reorder_through_projection.t5.a -└─MergeJoin 15625.00 root left outer join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +MergeJoin 15625.00 root left outer join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a +├─TableReader(Build) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo +└─Projection(Probe) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#7 + └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a ├─TableReader(Build) 10000.00 root data:TableFullScan │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo └─TableReader(Probe) 10000.00 root data:TableFullScan @@ -651,11 +651,11 @@ explain format = 'brief' select dt.*, t5.a as t5_a from (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt left join t5 on dt.key_a = t5.a and dt.doubled_b > 100; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#7, planner__core__join_reorder_through_projection.t5.a -└─MergeJoin 15625.00 root left outer join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a, left cond:gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +MergeJoin 15625.00 root left outer join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a, left cond:gt(Column#7, 100) +├─TableReader(Build) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo +└─Projection(Probe) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#7 + └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a ├─TableReader(Build) 10000.00 root data:TableFullScan │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo └─TableReader(Probe) 10000.00 root data:TableFullScan @@ -755,16 +755,16 @@ order by dt.key_a; id estRows task access object operator info Sort 10.00 root planner__core__join_reorder_through_projection.oj_t2.a └─Projection 10.00 root planner__core__join_reorder_through_projection.oj_t2.a, ifnull(planner__core__join_reorder_through_projection.oj_t5.b, -1)->Column#8 - └─HashJoin 10.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.oj_t2.a, planner__core__join_reorder_through_projection.oj_t3.a)] - ├─TableReader(Build) 10.00 root data:TableFullScan - │ └─TableFullScan 10.00 cop[tikv] table:oj_t3 keep order:false - └─HashJoin(Probe) 10.00 root left outer join, equal:[eq(Column#10, planner__core__join_reorder_through_projection.oj_t5.b)] - ├─TableReader(Build) 2.00 root data:Selection - │ └─Selection 2.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.oj_t5.b)) - │ └─TableFullScan 2.00 cop[tikv] table:oj_t5 keep order:false - └─Projection(Probe) 10.00 root planner__core__join_reorder_through_projection.oj_t2.a, mul(planner__core__join_reorder_through_projection.oj_t2.b, 2)->Column#10 - └─TableReader 10.00 root data:TableFullScan - └─TableFullScan 10.00 cop[tikv] table:oj_t2 keep order:false + └─HashJoin 10.00 root left outer join, equal:[eq(Column#5, planner__core__join_reorder_through_projection.oj_t5.b)] + ├─TableReader(Build) 2.00 root data:Selection + │ └─Selection 2.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.oj_t5.b)) + │ └─TableFullScan 2.00 cop[tikv] table:oj_t5 keep order:false + └─Projection(Probe) 10.00 root planner__core__join_reorder_through_projection.oj_t2.a, mul(planner__core__join_reorder_through_projection.oj_t2.b, 2)->Column#5 + └─MergeJoin 10.00 root inner join, left key:planner__core__join_reorder_through_projection.oj_t2.a, right key:planner__core__join_reorder_through_projection.oj_t3.a + ├─TableReader(Build) 10.00 root data:TableFullScan + │ └─TableFullScan 10.00 cop[tikv] table:oj_t3 keep order:true + └─TableReader(Probe) 10.00 root data:TableFullScan + └─TableFullScan 10.00 cop[tikv] table:oj_t2 keep order:true select dt.key_a, ifnull(oj_t5.b, -1) as t5_b from (select oj_t2.a as key_a, oj_t2.b * 2 as doubled_b from oj_t2 join oj_t3 on oj_t2.a = oj_t3.a) dt @@ -875,18 +875,19 @@ explain format = 'brief' select dt1.*, dt2.* from (select t3.a as a3, t3.b * 2 as doubled3 from t3 join t4 on t3.a = t4.a) dt2 where dt1.a1 = dt2.a3; id estRows task access object operator info -Projection 19531.25 root planner__core__join_reorder_through_projection.t1.a, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#7, planner__core__join_reorder_through_projection.t3.a, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#14 -└─MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t3.a, right key:planner__core__join_reorder_through_projection.t4.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo - └─MergeJoin(Probe) 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t3.a +MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t3.a +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t3.a, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#14 +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t3.a, right key:planner__core__join_reorder_through_projection.t4.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +└─Projection(Probe) 12500.00 root planner__core__join_reorder_through_projection.t1.a, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#7 + └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo + └─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select dt1.*, dt2.* from (select t1.a as a1, t1.b * 2 as doubled1 from t1 join t2 on t1.a = t2.a) dt1, (select t3.a as a3, t3.b * 2 as doubled3 from t3 join t4 on t3.a = t4.a) dt2 @@ -929,22 +930,21 @@ explain format = 'brief' select dt1.*, dt2.* from (select t3.a as a3, t3.b * 2 as doubled3 from t3 join t4 on t3.a = t4.a) dt2 where dt1.doubled1 = dt2.doubled3; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#7, planner__core__join_reorder_through_projection.t3.a, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#14 -└─HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t3.a, planner__core__join_reorder_through_projection.t4.a)] - ├─IndexReader(Build) 10000.00 root index:IndexFullScan - │ └─IndexFullScan 10000.00 cop[tikv] table:t4, index:b(b) keep order:false, stats:pseudo - └─HashJoin(Probe) 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a)] - ├─IndexReader(Build) 10000.00 root index:IndexFullScan - │ └─IndexFullScan 10000.00 cop[tikv] table:t2, index:b(b) keep order:false, stats:pseudo - └─HashJoin(Probe) 10000.00 root inner join, equal:[eq(Column#17, Column#18)] - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t3.a, planner__core__join_reorder_through_projection.t3.b, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#18 - │ └─IndexReader 8000.00 root index:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t3.b, 2))) - │ └─IndexFullScan 10000.00 cop[tikv] table:t3, index:b(b) keep order:false, stats:pseudo - └─Projection(Probe) 8000.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#17 - └─IndexReader 8000.00 root index:Selection - └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t1.b, 2))) - └─IndexFullScan 10000.00 cop[tikv] table:t1, index:b(b) keep order:false, stats:pseudo +HashJoin 15625.00 root inner join, equal:[eq(Column#7, Column#14)] +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t3.a, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#14 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t3.a, right key:planner__core__join_reorder_through_projection.t4.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t3.b, 2))) +│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +└─Projection(Probe) 10000.00 root planner__core__join_reorder_through_projection.t1.a, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#7 + └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo + └─TableReader(Probe) 8000.00 root data:Selection + └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t1.b, 2))) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select dt1.*, dt2.* from (select t1.a as a1, t1.b * 2 as doubled1 from t1 join t2 on t1.a = t2.a) dt1, (select t3.a as a3, t3.b * 2 as doubled3 from t3 join t4 on t3.a = t4.a) dt2 @@ -988,18 +988,19 @@ explain format = 'brief' select outer_t.a, dt2.* from t1 outer_t, join t4 on dt1.key_a = t4.a) dt2 where outer_t.a = dt2.key_a; id estRows task access object operator info -Projection 19531.25 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10)->Column#14 -└─MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t4.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo - └─MergeJoin(Probe) 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:outer_t keep order:true, stats:pseudo +MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 15625.00 root planner__core__join_reorder_through_projection.t2.a, plus(Column#10, 10)->Column#14 +│ └─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t4.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 +│ │ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ │ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ │ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:outer_t keep order:true, stats:pseudo select outer_t.a, dt2.* from t1 outer_t, (select dt1.key_a, dt1.doubled_b + 10 as adjusted from (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt1 @@ -1045,21 +1046,20 @@ explain format = 'brief' select outer_t.a, dt2.* from t1 outer_t, join t4 on dt1.key_a = t4.a) dt2 where outer_t.b = dt2.adjusted; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10)->Column#14 -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t4.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─IndexHashJoin(Probe) 10000.00 root inner join, inner:IndexReader, outer key:Column#18, inner key:planner__core__join_reorder_through_projection.t1.b, equal cond:eq(Column#18, planner__core__join_reorder_through_projection.t1.b) - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t2.b, plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10)->Column#18 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─IndexReader(Probe) 10000.00 root index:Selection - └─Selection 10000.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - └─IndexRangeScan 10010.01 cop[tikv] table:outer_t, index:b(b) range: decided by [eq(planner__core__join_reorder_through_projection.t1.b, Column#18)], keep order:false, stats:pseudo +HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#14)] +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, plus(Column#10, 10)->Column#14 +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t4.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 +│ │ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ │ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ │ └─TableReader(Probe) 8000.00 root data:Selection +│ │ └─Selection 8000.00 cop[tikv] not(isnull(plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10))) +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo +└─IndexReader(Probe) 9990.00 root index:IndexFullScan + └─IndexFullScan 9990.00 cop[tikv] table:outer_t, index:b(b) keep order:false, stats:pseudo select outer_t.a, dt2.* from t1 outer_t, (select dt1.key_a, dt1.doubled_b + 10 as adjusted from (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt1 @@ -1161,17 +1161,16 @@ explain format = 'brief' select s.*, dt.* from expr_small s, (select m.a as key_a, m.b + 1 as expr_key, l.b as lb from expr_medium m join expr_large l on m.a = l.a) dt where s.a = dt.expr_key; id estRows task access object operator info -Projection 2.00 root planner__core__join_reorder_through_projection.expr_small.a, planner__core__join_reorder_through_projection.expr_small.b, planner__core__join_reorder_through_projection.expr_medium.a, plus(planner__core__join_reorder_through_projection.expr_medium.b, 1)->Column#7, planner__core__join_reorder_through_projection.expr_large.b -└─MergeJoin 2.00 root inner join, left key:planner__core__join_reorder_through_projection.expr_medium.a, right key:planner__core__join_reorder_through_projection.expr_large.a - ├─TableReader(Build) 20.00 root data:TableFullScan - │ └─TableFullScan 20.00 cop[tikv] table:l keep order:true - └─IndexJoin(Probe) 2.00 root inner join, inner:TableReader, outer key:Column#9, inner key:planner__core__join_reorder_through_projection.expr_small.a, equal cond:eq(Column#9, planner__core__join_reorder_through_projection.expr_small.a) - ├─Projection(Build) 4.80 root planner__core__join_reorder_through_projection.expr_medium.a, planner__core__join_reorder_through_projection.expr_medium.b, plus(planner__core__join_reorder_through_projection.expr_medium.b, 1)->Column#9 - │ └─TableReader 4.80 root data:Selection - │ └─Selection 4.80 cop[tikv] not(isnull(plus(planner__core__join_reorder_through_projection.expr_medium.b, 1))) - │ └─TableFullScan 6.00 cop[tikv] table:m keep order:true - └─TableReader(Probe) 2.00 root data:TableRangeScan - └─TableRangeScan 2.00 cop[tikv] table:s range: decided by [Column#9], keep order:false +HashJoin 2.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.expr_small.a, Column#7)] +├─TableReader(Build) 2.00 root data:TableFullScan +│ └─TableFullScan 2.00 cop[tikv] table:s keep order:false +└─Projection(Probe) 4.80 root planner__core__join_reorder_through_projection.expr_medium.a, plus(planner__core__join_reorder_through_projection.expr_medium.b, 1)->Column#7, planner__core__join_reorder_through_projection.expr_large.b + └─MergeJoin 4.80 root inner join, left key:planner__core__join_reorder_through_projection.expr_medium.a, right key:planner__core__join_reorder_through_projection.expr_large.a + ├─TableReader(Build) 20.00 root data:TableFullScan + │ └─TableFullScan 20.00 cop[tikv] table:l keep order:true + └─TableReader(Probe) 4.80 root data:Selection + └─Selection 4.80 cop[tikv] not(isnull(plus(planner__core__join_reorder_through_projection.expr_medium.b, 1))) + └─TableFullScan 6.00 cop[tikv] table:m keep order:true select s.*, dt.* from expr_small s, (select m.a as key_a, m.b + 1 as expr_key, l.b as lb from expr_medium m join expr_large l on m.a = l.a) dt where s.a = dt.expr_key @@ -1220,16 +1219,17 @@ explain format = 'brief' select s.*, dt.* from t_int_small s, from t_int_large l join t_double_medium m on cast(l.a as double) = m.a) dt where s.a = dt.key_a; id estRows task access object operator info -Projection 2.00 root planner__core__join_reorder_through_projection.t_int_small.a, planner__core__join_reorder_through_projection.t_int_small.b, planner__core__join_reorder_through_projection.t_int_large.a, mul(planner__core__join_reorder_through_projection.t_int_large.b, 2)->Column#8, planner__core__join_reorder_through_projection.t_double_medium.b -└─HashJoin 2.00 root inner join, equal:[eq(Column#9, planner__core__join_reorder_through_projection.t_double_medium.a)] - ├─MergeJoin(Build) 2.00 root inner join, left key:planner__core__join_reorder_through_projection.t_int_small.a, right key:planner__core__join_reorder_through_projection.t_int_large.a - │ ├─Projection(Build) 20.00 root planner__core__join_reorder_through_projection.t_int_large.a, planner__core__join_reorder_through_projection.t_int_large.b, cast(planner__core__join_reorder_through_projection.t_int_large.a, double BINARY)->Column#9 - │ │ └─TableReader 20.00 root data:TableFullScan - │ │ └─TableFullScan 20.00 cop[tikv] table:l keep order:true - │ └─TableReader(Probe) 2.00 root data:TableFullScan - │ └─TableFullScan 2.00 cop[tikv] table:s keep order:true - └─TableReader(Probe) 6.00 root data:TableFullScan - └─TableFullScan 6.00 cop[tikv] table:m keep order:false +HashJoin 2.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t_int_small.a, planner__core__join_reorder_through_projection.t_int_large.a)] +├─TableReader(Build) 2.00 root data:TableFullScan +│ └─TableFullScan 2.00 cop[tikv] table:s keep order:false +└─Projection(Probe) 6.00 root planner__core__join_reorder_through_projection.t_int_large.a, mul(planner__core__join_reorder_through_projection.t_int_large.b, 2)->Column#8, planner__core__join_reorder_through_projection.t_double_medium.b + └─Projection 6.00 root planner__core__join_reorder_through_projection.t_int_large.a, planner__core__join_reorder_through_projection.t_int_large.b, planner__core__join_reorder_through_projection.t_double_medium.b + └─HashJoin 6.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t_double_medium.a, Column#9)] + ├─TableReader(Build) 6.00 root data:TableFullScan + │ └─TableFullScan 6.00 cop[tikv] table:m keep order:false + └─Projection(Probe) 20.00 root planner__core__join_reorder_through_projection.t_int_large.a, planner__core__join_reorder_through_projection.t_int_large.b, cast(planner__core__join_reorder_through_projection.t_int_large.a, double BINARY)->Column#9 + └─TableReader 20.00 root data:TableFullScan + └─TableFullScan 20.00 cop[tikv] table:l keep order:false select s.*, dt.* from t_int_small s, (select l.a as key_a, l.b * 2 as doubled_b, m.b as mb from t_int_large l join t_double_medium m on cast(l.a as double) = m.a) dt @@ -1245,18 +1245,18 @@ explain format = 'brief' select t1.a, dt.key_a, dt.doubled_b from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a; id estRows task access object operator info -MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo -└─MergeJoin(Probe) 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 - │ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - │ ├─TableReader(Build) 10000.00 root data:TableFullScan - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - │ └─TableReader(Probe) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t5.a, right key:planner__core__join_reorder_through_projection.t2.a +├─MergeJoin(Build) 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 +│ │ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ │ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ │ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo select t1.a, dt.key_a, dt.doubled_b from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a @@ -1270,18 +1270,18 @@ explain format = 'brief' select t1.a, dt.key_a, dt.doubled_b from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a; id estRows task access object operator info -Projection 19531.25 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 -└─MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo - └─MergeJoin(Probe) 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t5.a, right key:planner__core__join_reorder_through_projection.t2.a +├─MergeJoin(Build) 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 +│ │ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ │ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ │ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo select t1.a, dt.key_a, dt.doubled_b from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a @@ -1295,7 +1295,7 @@ explain format = 'brief' select t1.a, dt.key_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and dt.key_a = t5.a; id estRows task access object operator info -HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t5.a)] +HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a)] ├─IndexReader(Build) 10000.00 root index:IndexFullScan │ └─IndexFullScan 10000.00 cop[tikv] table:t5, index:b(b) keep order:false, stats:pseudo └─HashJoin(Probe) 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#13)] @@ -1319,20 +1319,19 @@ explain format = 'brief' select t1.a, dt.key_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and dt.key_a = t5.a; id estRows task access object operator info -MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo -└─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─IndexHashJoin(Probe) 10000.00 root inner join, inner:IndexReader, outer key:Column#15, inner key:planner__core__join_reorder_through_projection.t1.b, equal cond:eq(Column#15, planner__core__join_reorder_through_projection.t1.b) - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#15 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─IndexReader(Probe) 10000.00 root index:Selection - └─Selection 10000.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - └─IndexRangeScan 10010.01 cop[tikv] table:t1, index:b(b) range: decided by [eq(planner__core__join_reorder_through_projection.t1.b, Column#15)], keep order:false, stats:pseudo +HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a)] +├─IndexReader(Build) 10000.00 root index:IndexFullScan +│ └─IndexFullScan 10000.00 cop[tikv] table:t5, index:b(b) keep order:false, stats:pseudo +└─HashJoin(Probe) 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#13)] + ├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 + │ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a + │ ├─TableReader(Build) 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo + │ └─TableReader(Probe) 8000.00 root data:Selection + │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo + └─IndexReader(Probe) 9990.00 root index:IndexFullScan + └─IndexFullScan 9990.00 cop[tikv] table:t1, index:b(b) keep order:false, stats:pseudo select t1.a, dt.key_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and dt.key_a = t5.a @@ -1345,7 +1344,7 @@ explain format = 'brief' select t1.a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b, upper(t2.c) as upper_c from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and t1.c = dt.upper_c and dt.key_a = t5.a; id estRows task access object operator info -HashJoin 14062.50 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t5.a)] +HashJoin 14062.50 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a)] ├─IndexReader(Build) 10000.00 root index:IndexFullScan │ └─IndexFullScan 10000.00 cop[tikv] table:t5, index:b(b) keep order:false, stats:pseudo └─HashJoin(Probe) 11250.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#13) eq(planner__core__join_reorder_through_projection.t1.c, Column#14)] @@ -1369,22 +1368,20 @@ explain format = 'brief' select t1.a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b, upper(t2.c) as upper_c from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and t1.c = dt.upper_c and dt.key_a = t5.a; id estRows task access object operator info -MergeJoin 14062.50 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo -└─MergeJoin(Probe) 11250.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─IndexHashJoin(Probe) 9000.00 root inner join, inner:IndexLookUp, outer key:Column#17, inner key:planner__core__join_reorder_through_projection.t1.b, equal cond:eq(Column#17, planner__core__join_reorder_through_projection.t1.b), eq(Column#18, planner__core__join_reorder_through_projection.t1.c) - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#17, upper(planner__core__join_reorder_through_projection.t2.c)->Column#18 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))), not(isnull(upper(planner__core__join_reorder_through_projection.t2.c))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─IndexLookUp(Probe) 9000.00 root - ├─Selection(Build) 9009.01 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - │ └─IndexRangeScan 9018.03 cop[tikv] table:t1, index:b(b) range: decided by [eq(planner__core__join_reorder_through_projection.t1.b, Column#17)], keep order:false, stats:pseudo - └─Selection(Probe) 9000.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.c)) - └─TableRowIDScan 9009.01 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin 14062.50 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a)] +├─IndexReader(Build) 10000.00 root index:IndexFullScan +│ └─IndexFullScan 10000.00 cop[tikv] table:t5, index:b(b) keep order:false, stats:pseudo +└─HashJoin(Probe) 11250.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#13) eq(planner__core__join_reorder_through_projection.t1.c, Column#14)] + ├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13, upper(planner__core__join_reorder_through_projection.t2.c)->Column#14 + │ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a + │ ├─TableReader(Build) 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo + │ └─TableReader(Probe) 8000.00 root data:Selection + │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))), not(isnull(upper(planner__core__join_reorder_through_projection.t2.c))) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo + └─TableReader(Probe) 9980.01 root data:Selection + └─Selection 9980.01 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)), not(isnull(planner__core__join_reorder_through_projection.t1.c)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo select t1.a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b, upper(t2.c) as upper_c from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and t1.c = dt.upper_c and dt.key_a = t5.a @@ -1395,18 +1392,18 @@ explain format = 'brief' select t1.a, dt.key_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a and dt.doubled_b > 100; id estRows task access object operator info -MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo -└─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─MergeJoin(Build) 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - │ ├─TableReader(Build) 10000.00 root data:TableFullScan - │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - │ └─TableReader(Probe) 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t5.a, right key:planner__core__join_reorder_through_projection.t2.a +├─MergeJoin(Build) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─MergeJoin(Build) 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ │ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ │ └─TableReader(Probe) 8000.00 root data:Selection +│ │ └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo select t1.a, dt.key_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a and dt.doubled_b > 100 @@ -1420,18 +1417,18 @@ explain format = 'brief' select t1.a, dt.key_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a and dt.doubled_b > 100; id estRows task access object operator info -MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo -└─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t5.a, right key:planner__core__join_reorder_through_projection.t2.a +├─MergeJoin(Build) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─MergeJoin(Build) 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ │ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ │ └─TableReader(Probe) 8000.00 root data:Selection +│ │ └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo select t1.a, dt.key_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.key_a = t5.a and dt.doubled_b > 100 @@ -1447,7 +1444,7 @@ explain format = 'brief' select t1.a, dt2.key_a from t1, t5, join t4 on dt1.key_a = t4.a) dt2 where t1.b = dt2.adjusted and dt2.key_a = t5.a; id estRows task access object operator info -HashJoin 19531.25 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t5.a)] +HashJoin 19531.25 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a)] ├─IndexReader(Build) 10000.00 root index:IndexFullScan │ └─IndexFullScan 10000.00 cop[tikv] table:t5, index:b(b) keep order:false, stats:pseudo └─HashJoin(Probe) 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#17)] @@ -1478,23 +1475,23 @@ explain format = 'brief' select t1.a, dt2.key_a from t1, t5, join t4 on dt1.key_a = t4.a) dt2 where t1.b = dt2.adjusted and dt2.key_a = t5.a; id estRows task access object operator info -MergeJoin 19531.25 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a -├─TableReader(Build) 10000.00 root data:TableFullScan -│ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo -└─MergeJoin(Probe) 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t4.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─IndexHashJoin(Probe) 10000.00 root inner join, inner:IndexReader, outer key:Column#21, inner key:planner__core__join_reorder_through_projection.t1.b, equal cond:eq(Column#21, planner__core__join_reorder_through_projection.t1.b) - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10)->Column#21 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─IndexReader(Probe) 10000.00 root index:Selection - └─Selection 10000.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - └─IndexRangeScan 10010.01 cop[tikv] table:t1, index:b(b) range: decided by [eq(planner__core__join_reorder_through_projection.t1.b, Column#21)], keep order:false, stats:pseudo +HashJoin 19531.25 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a)] +├─IndexReader(Build) 10000.00 root index:IndexFullScan +│ └─IndexFullScan 10000.00 cop[tikv] table:t5, index:b(b) keep order:false, stats:pseudo +└─HashJoin(Probe) 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#17)] + ├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, plus(Column#13, 10)->Column#17 + │ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t4.a + │ ├─TableReader(Build) 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo + │ └─Projection(Probe) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 + │ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a + │ ├─TableReader(Build) 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo + │ └─TableReader(Probe) 8000.00 root data:Selection + │ └─Selection 8000.00 cop[tikv] not(isnull(plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10))) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo + └─IndexReader(Probe) 9990.00 root index:IndexFullScan + └─IndexFullScan 9990.00 cop[tikv] table:t1, index:b(b) keep order:false, stats:pseudo select t1.a, dt2.key_a from t1, t5, (select dt1.key_a, dt1.doubled_b + 10 as adjusted from (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt1 @@ -1531,16 +1528,16 @@ explain format = 'brief' select t1.a, dt.key_a, dt.doubled_b from t1, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.doubled_b > 100; id estRows task access object operator info -Projection 12500.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 -└─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t1.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo - └─TableReader(Probe) 8000.00 root data:Selection - └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select t1.a, dt.key_a, dt.doubled_b from t1, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.doubled_b > 100 @@ -1555,16 +1552,16 @@ explain format = 'brief' select t1.a, dt.key_a, dt.doubled_b from t1, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.doubled_b > 100; id estRows task access object operator info -Projection 12500.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 -└─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a - ├─TableReader(Build) 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─TableReader(Probe) 10000.00 root data:TableFullScan - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo +MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] gt(mul(planner__core__join_reorder_through_projection.t2.b, 2), 100) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 10000.00 root data:TableFullScan + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select t1.a, dt.key_a, dt.doubled_b from t1, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.a = dt.key_a and dt.doubled_b > 100 @@ -1602,18 +1599,17 @@ explain format = 'brief' select t1.*, dt.* from t1, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b; id estRows task access object operator info -Projection 12500.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, planner__core__join_reorder_through_projection.t1.c, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 -└─HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t3.a)] - ├─IndexReader(Build) 10000.00 root index:IndexFullScan - │ └─IndexFullScan 10000.00 cop[tikv] table:t3, index:b(b) keep order:false, stats:pseudo - └─HashJoin(Probe) 10000.00 root inner join, equal:[eq(Column#12, planner__core__join_reorder_through_projection.t1.b)] - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t2.b, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#12 - │ └─IndexReader 8000.00 root index:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) - │ └─IndexFullScan 10000.00 cop[tikv] table:t2, index:b(b) keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#10)] +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo select t1.*, dt.* from t1, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b @@ -1649,20 +1645,17 @@ explain format = 'brief' select t1.*, dt.* from t1, from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and t1.c = dt.upper_c; id estRows task access object operator info -Projection 12500.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, planner__core__join_reorder_through_projection.t1.c, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, upper(planner__core__join_reorder_through_projection.t2.c)->Column#11 -└─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─IndexHashJoin(Probe) 10000.00 root inner join, inner:IndexLookUp, outer key:Column#14, inner key:planner__core__join_reorder_through_projection.t1.b, equal cond:eq(Column#14, planner__core__join_reorder_through_projection.t1.b), eq(Column#15, planner__core__join_reorder_through_projection.t1.c) - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t2.b, planner__core__join_reorder_through_projection.t2.c, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#14, upper(planner__core__join_reorder_through_projection.t2.c)->Column#15 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))), not(isnull(upper(planner__core__join_reorder_through_projection.t2.c))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─IndexLookUp(Probe) 10000.00 root - ├─Selection(Build) 10010.01 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - │ └─IndexRangeScan 10020.03 cop[tikv] table:t1, index:b(b) range: decided by [eq(planner__core__join_reorder_through_projection.t1.b, Column#14)], keep order:false, stats:pseudo - └─Selection(Probe) 10000.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.c)) - └─TableRowIDScan 10010.01 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#10) eq(planner__core__join_reorder_through_projection.t1.c, Column#11)] +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10, upper(planner__core__join_reorder_through_projection.t2.c)->Column#11 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))), not(isnull(upper(planner__core__join_reorder_through_projection.t2.c))) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 9980.01 root data:Selection + └─Selection 9980.01 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)), not(isnull(planner__core__join_reorder_through_projection.t1.c)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo select t1.*, dt.* from t1, (select t2.a as key_a, t2.b * 2 as doubled_b, upper(t2.c) as upper_c from t2 join t3 on t2.a = t3.a) dt @@ -1702,22 +1695,21 @@ explain format = 'brief' select t1.*, dt.*, t5.a as t5_a from t1, t5, where t1.b = dt.doubled_b and dt.key_a = t5.a; id estRows task access object operator info Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, planner__core__join_reorder_through_projection.t1.c, planner__core__join_reorder_through_projection.t2.a, Column#13, planner__core__join_reorder_through_projection.t5.a -└─Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, planner__core__join_reorder_through_projection.t1.c, planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 - └─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t5.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t5 keep order:true, stats:pseudo - └─IndexHashJoin(Probe) 10000.00 root inner join, inner:IndexLookUp, outer key:Column#15, inner key:planner__core__join_reorder_through_projection.t1.b, equal cond:eq(Column#15, planner__core__join_reorder_through_projection.t1.b) - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t2.b, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#15 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─IndexLookUp(Probe) 10000.00 root - ├─Selection(Build) 10000.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - │ └─IndexRangeScan 10010.01 cop[tikv] table:t1, index:b(b) range: decided by [eq(planner__core__join_reorder_through_projection.t1.b, Column#15)], keep order:false, stats:pseudo - └─TableRowIDScan(Probe) 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo +└─Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, planner__core__join_reorder_through_projection.t1.c, planner__core__join_reorder_through_projection.t5.a, planner__core__join_reorder_through_projection.t2.a, Column#13 + └─HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t5.a)] + ├─IndexReader(Build) 10000.00 root index:IndexFullScan + │ └─IndexFullScan 10000.00 cop[tikv] table:t5, index:b(b) keep order:false, stats:pseudo + └─HashJoin(Probe) 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#13)] + ├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#13 + │ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a + │ ├─TableReader(Build) 10000.00 root data:TableFullScan + │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo + │ └─TableReader(Probe) 8000.00 root data:Selection + │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo select t1.*, dt.*, t5.a as t5_a from t1, t5, (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt where t1.b = dt.doubled_b and dt.key_a = t5.a @@ -1760,22 +1752,21 @@ explain format = 'brief' select t1.*, dt2.* from t1, join t4 on dt1.key_a = t4.a) dt2 where t1.b = dt2.adjusted; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, planner__core__join_reorder_through_projection.t1.c, planner__core__join_reorder_through_projection.t2.a, plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10)->Column#14 -└─MergeJoin 15625.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t4.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo - └─MergeJoin(Probe) 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo - └─IndexHashJoin(Probe) 10000.00 root inner join, inner:IndexLookUp, outer key:Column#18, inner key:planner__core__join_reorder_through_projection.t1.b, equal cond:eq(Column#18, planner__core__join_reorder_through_projection.t1.b) - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t2.b, plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10)->Column#18 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo - └─IndexLookUp(Probe) 10000.00 root - ├─Selection(Build) 10000.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - │ └─IndexRangeScan 10010.01 cop[tikv] table:t1, index:b(b) range: decided by [eq(planner__core__join_reorder_through_projection.t1.b, Column#18)], keep order:false, stats:pseudo - └─TableRowIDScan(Probe) 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#14)] +├─Projection(Build) 12500.00 root planner__core__join_reorder_through_projection.t2.a, plus(Column#10, 10)->Column#14 +│ └─MergeJoin 12500.00 root inner join, left key:planner__core__join_reorder_through_projection.t4.a, right key:planner__core__join_reorder_through_projection.t2.a +│ ├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#10 +│ │ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ │ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ │ └─TableReader(Probe) 8000.00 root data:Selection +│ │ └─Selection 8000.00 cop[tikv] not(isnull(plus(mul(planner__core__join_reorder_through_projection.t2.b, 2), 10))) +│ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +│ └─TableReader(Probe) 10000.00 root data:TableFullScan +│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo +└─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo select t1.*, dt2.* from t1, (select dt1.key_a, dt1.doubled_b + 10 as adjusted from (select t2.a as key_a, t2.b * 2 as doubled_b from t2 join t3 on t2.a = t3.a) dt1 @@ -1816,22 +1807,21 @@ explain format = 'brief' select dt1.*, dt2.* from (select t3.a as a3, t3.b * 2 as doubled2 from t3 join t4 on t3.a = t4.a) dt2 where dt1.doubled1 = dt2.doubled2; id estRows task access object operator info -Projection 15625.00 root planner__core__join_reorder_through_projection.t1.a, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#7, planner__core__join_reorder_through_projection.t3.a, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#14 -└─HashJoin 15625.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t3.a, planner__core__join_reorder_through_projection.t4.a)] - ├─IndexReader(Build) 10000.00 root index:IndexFullScan - │ └─IndexFullScan 10000.00 cop[tikv] table:t4, index:b(b) keep order:false, stats:pseudo - └─HashJoin(Probe) 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a)] - ├─IndexReader(Build) 10000.00 root index:IndexFullScan - │ └─IndexFullScan 10000.00 cop[tikv] table:t2, index:b(b) keep order:false, stats:pseudo - └─HashJoin(Probe) 10000.00 root inner join, equal:[eq(Column#17, Column#18)] - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t3.a, planner__core__join_reorder_through_projection.t3.b, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#18 - │ └─IndexReader 8000.00 root index:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t3.b, 2))) - │ └─IndexFullScan 10000.00 cop[tikv] table:t3, index:b(b) keep order:false, stats:pseudo - └─Projection(Probe) 8000.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t1.b, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#17 - └─IndexReader 8000.00 root index:Selection - └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t1.b, 2))) - └─IndexFullScan 10000.00 cop[tikv] table:t1, index:b(b) keep order:false, stats:pseudo +HashJoin 15625.00 root inner join, equal:[eq(Column#7, Column#14)] +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t3.a, mul(planner__core__join_reorder_through_projection.t3.b, 2)->Column#14 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t3.a, right key:planner__core__join_reorder_through_projection.t4.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t3.b, 2))) +│ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +└─Projection(Probe) 10000.00 root planner__core__join_reorder_through_projection.t1.a, mul(planner__core__join_reorder_through_projection.t1.b, 2)->Column#7 + └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t1.a, right key:planner__core__join_reorder_through_projection.t2.a + ├─TableReader(Build) 10000.00 root data:TableFullScan + │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo + └─TableReader(Probe) 8000.00 root data:Selection + └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t1.b, 2))) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:true, stats:pseudo select dt1.*, dt2.* from (select t1.a as a1, t1.b * 2 as doubled1 from t1 join t2 on t1.a = t2.a) dt1, (select t3.a as a3, t3.b * 2 as doubled2 from t3 join t4 on t3.a = t4.a) dt2 @@ -2333,36 +2323,32 @@ select t2.a as a2, t2.b * 2 as doubled_b, t3.a as a3 from t2 join t3 on t2.a = t3.a ) dt on t1.b = dt.doubled_b; id estRows task access object operator info -Projection 12500.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a -└─HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t3.a)] - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─HashJoin(Probe) 10000.00 root inner join, equal:[eq(Column#9, planner__core__join_reorder_through_projection.t1.b)] - ├─Projection(Build) 8000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#9 - │ └─TableReader 8000.00 root data:Selection - │ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) - │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#7)] +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#7 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo explain format = 'brief' select t1.a, dt.a2 from t1 join ( select /*+ merge_join(t2) */ t2.a as a2, t2.b * 2 as doubled_b, t3.a as a3 from t2 join t3 on t2.a = t3.a ) dt on t1.b = dt.doubled_b; id estRows task access object operator info -Projection 12500.00 root planner__core__join_reorder_through_projection.t1.a, planner__core__join_reorder_through_projection.t2.a -└─HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t2.a, planner__core__join_reorder_through_projection.t3.a)] - ├─TableReader(Build) 10000.00 root data:TableFullScan - │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - └─MergeJoin(Probe) 10000.00 root inner join, left key:Column#9, right key:planner__core__join_reorder_through_projection.t1.b - ├─Sort(Build) 9990.00 root planner__core__join_reorder_through_projection.t1.b - │ └─TableReader 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─Sort(Probe) 8000.00 root Column#9 - └─Projection 8000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#9 - └─TableReader 8000.00 root data:Selection - └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) - └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +HashJoin 12500.00 root inner join, equal:[eq(planner__core__join_reorder_through_projection.t1.b, Column#7)] +├─Projection(Build) 10000.00 root planner__core__join_reorder_through_projection.t2.a, mul(planner__core__join_reorder_through_projection.t2.b, 2)->Column#7 +│ └─MergeJoin 10000.00 root inner join, left key:planner__core__join_reorder_through_projection.t2.a, right key:planner__core__join_reorder_through_projection.t3.a +│ ├─TableReader(Build) 10000.00 root data:TableFullScan +│ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:true, stats:pseudo +│ └─TableReader(Probe) 8000.00 root data:Selection +│ └─Selection 8000.00 cop[tikv] not(isnull(mul(planner__core__join_reorder_through_projection.t2.b, 2))) +│ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:true, stats:pseudo +└─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__join_reorder_through_projection.t1.b)) + └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo set tidb_opt_join_reorder_through_proj = off; drop table if exists t1, t2, t3, t4, t5; diff --git a/tests/integrationtest/r/planner/core/plan_cache.result b/tests/integrationtest/r/planner/core/plan_cache.result index 7e375fbfeb310..ae4dc8143dfb4 100644 --- a/tests/integrationtest/r/planner/core/plan_cache.result +++ b/tests/integrationtest/r/planner/core/plan_cache.result @@ -686,11 +686,11 @@ TableReader_7 8000.00 root data:Selection_6 └─TableFullScan_5 10000.00 cop[tikv] table:t keep order:false, stats:pseudo explain format = 'plan_cache' select * from t t1, t t2; id estRows task access object operator info -HashJoin_7 100000000.00 root CARTESIAN inner join -├─TableReader_12(Build) 10000.00 root data:TableFullScan_11 -│ └─TableFullScan_11 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo -└─TableReader_10(Probe) 10000.00 root data:TableFullScan_9 - └─TableFullScan_9 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo +HashJoin_8 100000000.00 root CARTESIAN inner join +├─TableReader_13(Build) 10000.00 root data:TableFullScan_12 +│ └─TableFullScan_12 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo +└─TableReader_11(Probe) 10000.00 root data:TableFullScan_10 + └─TableFullScan_10 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo explain format = 'plan_cache' select * from t where a in (select a from t); id estRows task access object operator info HashJoin_10 9990.00 root inner join, equal:[eq(planner__core__plan_cache.t.a, planner__core__plan_cache.t.a)] diff --git a/tests/integrationtest/r/planner/core/rule_join_reorder.result b/tests/integrationtest/r/planner/core/rule_join_reorder.result index 3e4fa745acca8..b49ebd6d69aa9 100644 --- a/tests/integrationtest/r/planner/core/rule_join_reorder.result +++ b/tests/integrationtest/r/planner/core/rule_join_reorder.result @@ -47,26 +47,26 @@ Sort 2.50 root planner__core__rule_join_reorder.queries_identifier.id explain format='brief' select * from t left join t1 on t.a=t1.a inner join t2 on t.a=t2.a and t2.c = 100 left join t3 on t2.a=t3.a and t3.b > 1 left join t4 on t2.a = t4.a where (t2.b > 100 or t.a > 10 or t1.b < 10); id estRows task access object operator info Projection 19.51 root planner__core__rule_join_reorder.t.a, planner__core__rule_join_reorder.t1.a, planner__core__rule_join_reorder.t1.b, planner__core__rule_join_reorder.t2.a, planner__core__rule_join_reorder.t2.b, planner__core__rule_join_reorder.t2.c, planner__core__rule_join_reorder.t3.a, planner__core__rule_join_reorder.t3.b, planner__core__rule_join_reorder.t4.a, planner__core__rule_join_reorder.t4.b -└─Selection 19.51 root or(gt(planner__core__rule_join_reorder.t2.b, 100), or(gt(planner__core__rule_join_reorder.t.a, 10), lt(planner__core__rule_join_reorder.t1.b, 10))), or(gt(planner__core__rule_join_reorder.t2.b, 100), or(gt(planner__core__rule_join_reorder.t2.a, 10), lt(planner__core__rule_join_reorder.t1.b, 10))) - └─HashJoin 24.39 root left outer join, equal:[eq(planner__core__rule_join_reorder.t2.a, planner__core__rule_join_reorder.t4.a)] - ├─HashJoin(Build) 19.51 root left outer join, equal:[eq(planner__core__rule_join_reorder.t.a, planner__core__rule_join_reorder.t1.a)] - │ ├─HashJoin(Build) 15.61 root inner join, equal:[eq(planner__core__rule_join_reorder.t2.a, planner__core__rule_join_reorder.t.a)] - │ │ ├─HashJoin(Build) 12.49 root left outer join, equal:[eq(planner__core__rule_join_reorder.t2.a, planner__core__rule_join_reorder.t3.a)] - │ │ │ ├─TableReader(Build) 9.99 root data:Selection - │ │ │ │ └─Selection 9.99 cop[tikv] eq(planner__core__rule_join_reorder.t2.c, 100), not(isnull(planner__core__rule_join_reorder.t2.a)) - │ │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo - │ │ │ └─TableReader(Probe) 3330.00 root data:Selection - │ │ │ └─Selection 3330.00 cop[tikv] gt(planner__core__rule_join_reorder.t3.b, 1), not(isnull(planner__core__rule_join_reorder.t3.a)) - │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo - │ │ └─TableReader(Probe) 9990.00 root data:Selection - │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__rule_join_reorder.t.a)) - │ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo - │ └─TableReader(Probe) 9990.00 root data:Selection - │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__rule_join_reorder.t1.a)) - │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo - └─TableReader(Probe) 9990.00 root data:Selection - └─Selection 9990.00 cop[tikv] not(isnull(planner__core__rule_join_reorder.t4.a)) - └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo +└─HashJoin 19.51 root left outer join, equal:[eq(planner__core__rule_join_reorder.t2.a, planner__core__rule_join_reorder.t4.a)] + ├─Selection(Build) 15.61 root or(gt(planner__core__rule_join_reorder.t2.b, 100), or(gt(planner__core__rule_join_reorder.t.a, 10), lt(planner__core__rule_join_reorder.t1.b, 10))), or(gt(planner__core__rule_join_reorder.t2.b, 100), or(gt(planner__core__rule_join_reorder.t2.a, 10), lt(planner__core__rule_join_reorder.t1.b, 10))) + │ └─HashJoin 19.51 root left outer join, equal:[eq(planner__core__rule_join_reorder.t.a, planner__core__rule_join_reorder.t1.a)] + │ ├─HashJoin(Build) 15.61 root inner join, equal:[eq(planner__core__rule_join_reorder.t2.a, planner__core__rule_join_reorder.t.a)] + │ │ ├─HashJoin(Build) 12.49 root left outer join, equal:[eq(planner__core__rule_join_reorder.t2.a, planner__core__rule_join_reorder.t3.a)] + │ │ │ ├─TableReader(Build) 9.99 root data:Selection + │ │ │ │ └─Selection 9.99 cop[tikv] eq(planner__core__rule_join_reorder.t2.c, 100), not(isnull(planner__core__rule_join_reorder.t2.a)) + │ │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo + │ │ │ └─TableReader(Probe) 3330.00 root data:Selection + │ │ │ └─Selection 3330.00 cop[tikv] gt(planner__core__rule_join_reorder.t3.b, 1), not(isnull(planner__core__rule_join_reorder.t3.a)) + │ │ │ └─TableFullScan 10000.00 cop[tikv] table:t3 keep order:false, stats:pseudo + │ │ └─TableReader(Probe) 9990.00 root data:Selection + │ │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__rule_join_reorder.t.a)) + │ │ └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(planner__core__rule_join_reorder.t1.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo + └─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(planner__core__rule_join_reorder.t4.a)) + └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo drop table if exists t1, t2, t3; CREATE TABLE `t1` (`data_status` tinyint(1) DEFAULT '0',`part` tinyint(255) unsigned DEFAULT NULL); CREATE TABLE `t2` (`id` bigint(20) NOT NULL AUTO_INCREMENT,`routing_rule_switch` tinyint(1) DEFAULT '0',PRIMARY KEY (`id`)); diff --git a/tests/integrationtest/r/select.result b/tests/integrationtest/r/select.result index 1ad0adbb023af..a9175e8e37484 100644 --- a/tests/integrationtest/r/select.result +++ b/tests/integrationtest/r/select.result @@ -554,17 +554,17 @@ HashJoin 12.00 root CARTESIAN left outer join, left cond:[eq(select.t2.a, 1)] └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false explain format = 'brief' select * from t2 left join (t1 left join t3 on t1.a=t3.a) on t2.a=t3.a; id estRows task access object operator info -HashJoin 4.00 root left outer join, equal:[eq(select.t2.a, select.t3.a)] -├─Projection(Build) 4.00 root select.t1.a, select.t1.b, select.t3.a, select.t3.b -│ └─HashJoin 4.00 root inner join, equal:[eq(select.t3.a, select.t1.a)] -│ ├─TableReader(Build) 2.00 root data:Selection -│ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) -│ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false -│ └─TableReader(Probe) 4.00 root data:Selection -│ └─Selection 4.00 cop[tikv] not(isnull(select.t1.a)) -│ └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false -└─TableReader(Probe) 3.00 root data:TableFullScan - └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false +Projection 4.00 root select.t2.a, select.t2.b, select.t1.a, select.t1.b, select.t3.a, select.t3.b +└─HashJoin 4.00 root left outer join, equal:[eq(select.t2.a, select.t3.a)] + ├─HashJoin(Build) 4.00 root inner join, equal:[eq(select.t3.a, select.t1.a)] + │ ├─TableReader(Build) 2.00 root data:Selection + │ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) + │ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false + │ └─TableReader(Probe) 4.00 root data:Selection + │ └─Selection 4.00 cop[tikv] not(isnull(select.t1.a)) + │ └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false + └─TableReader(Probe) 3.00 root data:TableFullScan + └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false explain format = 'brief' select * from t2 left join t1 on t1.a=t2.a join t3 on t2.b=t3.b; id estRows task access object operator info Projection 4.00 root select.t2.a, select.t2.b, select.t1.a, select.t1.b, select.t3.a, select.t3.b @@ -595,65 +595,66 @@ Projection 4.00 root select.t1.a, select.t1.b, select.t2.a, select.t2.b, select └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false explain format = 'brief' select * from t2 right join t3 on t3.a=t2.a right join t1 on t2.a=t1.a; id estRows task access object operator info -HashJoin 4.00 root right outer join, equal:[eq(select.t2.a, select.t1.a)] -├─Projection(Build) 2.00 root select.t2.a, select.t2.b, select.t3.a, select.t3.b -│ └─HashJoin 2.00 root inner join, equal:[eq(select.t3.a, select.t2.a)] -│ ├─TableReader(Build) 2.00 root data:Selection -│ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) -│ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false -│ └─TableReader(Probe) 3.00 root data:Selection -│ └─Selection 3.00 cop[tikv] not(isnull(select.t2.a)) -│ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false -└─TableReader(Probe) 4.00 root data:TableFullScan - └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false -explain format = 'brief' select * from (t1 left join t2 on t1.a=t2.a) left join (t3 left join t4 on t3.a=t4.a) on t2.a=t4.a; -id estRows task access object operator info -HashJoin 4.00 root left outer join, equal:[eq(select.t2.a, select.t4.a)] -├─HashJoin(Build) 2.50 root inner join, equal:[eq(select.t3.a, select.t4.a)] -│ ├─TableReader(Build) 2.00 root data:Selection -│ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) -│ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(select.t4.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─HashJoin(Probe) 4.00 root left outer join, equal:[eq(select.t1.a, select.t2.a)] - ├─TableReader(Build) 3.00 root data:Selection - │ └─Selection 3.00 cop[tikv] not(isnull(select.t2.a)) - │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false +Projection 4.00 root select.t2.a, select.t2.b, select.t3.a, select.t3.b, select.t1.a, select.t1.b +└─HashJoin 4.00 root right outer join, equal:[eq(select.t2.a, select.t1.a)] + ├─HashJoin(Build) 2.00 root inner join, equal:[eq(select.t3.a, select.t2.a)] + │ ├─TableReader(Build) 2.00 root data:Selection + │ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) + │ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false + │ └─TableReader(Probe) 3.00 root data:Selection + │ └─Selection 3.00 cop[tikv] not(isnull(select.t2.a)) + │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false └─TableReader(Probe) 4.00 root data:TableFullScan └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false +explain format = 'brief' select * from (t1 left join t2 on t1.a=t2.a) left join (t3 left join t4 on t3.a=t4.a) on t2.a=t4.a; +id estRows task access object operator info +HashJoin 4.00 root left outer join, equal:[eq(select.t1.a, select.t2.a)] +├─HashJoin(Build) 3.00 root left outer join, equal:[eq(select.t2.a, select.t4.a)] +│ ├─HashJoin(Build) 2.50 root inner join, equal:[eq(select.t3.a, select.t4.a)] +│ │ ├─TableReader(Build) 2.00 root data:Selection +│ │ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) +│ │ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false +│ │ └─TableReader(Probe) 9990.00 root data:Selection +│ │ └─Selection 9990.00 cop[tikv] not(isnull(select.t4.a)) +│ │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo +│ └─TableReader(Probe) 3.00 root data:Selection +│ └─Selection 3.00 cop[tikv] not(isnull(select.t2.a)) +│ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false +└─TableReader(Probe) 4.00 root data:TableFullScan + └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false explain format = 'brief' select * from (t1 left join t2 on t1.a=t2.a) left join (t3 left join t4 on t3.a=t4.a) on t2.a=t3.a; id estRows task access object operator info -HashJoin 4.00 root left outer join, equal:[eq(select.t2.a, select.t3.a)] -├─HashJoin(Build) 2.50 root left outer join, equal:[eq(select.t3.a, select.t4.a)] -│ ├─TableReader(Build) 2.00 root data:Selection -│ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) -│ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(select.t4.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─HashJoin(Probe) 4.00 root left outer join, equal:[eq(select.t1.a, select.t2.a)] - ├─TableReader(Build) 3.00 root data:Selection - │ └─Selection 3.00 cop[tikv] not(isnull(select.t2.a)) - │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false - └─TableReader(Probe) 4.00 root data:TableFullScan - └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false +HashJoin 5.00 root left outer join, equal:[eq(select.t3.a, select.t4.a)] +├─HashJoin(Build) 4.00 root left outer join, equal:[eq(select.t1.a, select.t2.a)] +│ ├─HashJoin(Build) 3.00 root left outer join, equal:[eq(select.t2.a, select.t3.a)] +│ │ ├─TableReader(Build) 2.00 root data:Selection +│ │ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) +│ │ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false +│ │ └─TableReader(Probe) 3.00 root data:Selection +│ │ └─Selection 3.00 cop[tikv] not(isnull(select.t2.a)) +│ │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false +│ └─TableReader(Probe) 4.00 root data:TableFullScan +│ └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false +└─TableReader(Probe) 9990.00 root data:Selection + └─Selection 9990.00 cop[tikv] not(isnull(select.t4.a)) + └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo explain format = 'brief' select * from (t1 left join t2 on t1.a=t2.a) left join (t3 left join t4 on t3.a=t4.a) on t1.a=t4.a; id estRows task access object operator info -HashJoin 4.00 root left outer join, equal:[eq(select.t1.a, select.t4.a)] -├─HashJoin(Build) 2.50 root inner join, equal:[eq(select.t3.a, select.t4.a)] -│ ├─TableReader(Build) 2.00 root data:Selection -│ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) -│ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false -│ └─TableReader(Probe) 9990.00 root data:Selection -│ └─Selection 9990.00 cop[tikv] not(isnull(select.t4.a)) -│ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo -└─HashJoin(Probe) 4.00 root left outer join, equal:[eq(select.t1.a, select.t2.a)] +Projection 4.00 root select.t1.a, select.t1.b, select.t2.a, select.t2.b, select.t3.a, select.t3.b, select.t4.a, select.t4.b +└─HashJoin 4.00 root left outer join, equal:[eq(select.t1.a, select.t2.a)] ├─TableReader(Build) 3.00 root data:Selection │ └─Selection 3.00 cop[tikv] not(isnull(select.t2.a)) │ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false - └─TableReader(Probe) 4.00 root data:TableFullScan - └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false + └─HashJoin(Probe) 4.00 root left outer join, equal:[eq(select.t1.a, select.t4.a)] + ├─HashJoin(Build) 2.50 root inner join, equal:[eq(select.t3.a, select.t4.a)] + │ ├─TableReader(Build) 2.00 root data:Selection + │ │ └─Selection 2.00 cop[tikv] not(isnull(select.t3.a)) + │ │ └─TableFullScan 2.00 cop[tikv] table:t3 keep order:false + │ └─TableReader(Probe) 9990.00 root data:Selection + │ └─Selection 9990.00 cop[tikv] not(isnull(select.t4.a)) + │ └─TableFullScan 10000.00 cop[tikv] table:t4 keep order:false, stats:pseudo + └─TableReader(Probe) 4.00 root data:TableFullScan + └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false drop table if exists t3; create table t3(a char(10), primary key (a)); insert into t3 values ('a'); From d9a708fa06b52cb865fbcbd0bde8a2140b587750 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 15:59:59 +0800 Subject: [PATCH 23/25] unit test Signed-off-by: guo-shaoge --- .../mpp/testdata/integration_suite_out.json | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/pkg/planner/core/casetest/mpp/testdata/integration_suite_out.json b/pkg/planner/core/casetest/mpp/testdata/integration_suite_out.json index 4fd3b28008238..d947bc3d3e9e1 100644 --- a/pkg/planner/core/casetest/mpp/testdata/integration_suite_out.json +++ b/pkg/planner/core/casetest/mpp/testdata/integration_suite_out.json @@ -1713,23 +1713,22 @@ " │ └─Projection 10000.00 mpp[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c4, decimal(40,20))->Column#29", " │ └─TableFullScan 10000.00 mpp[tiflash] table:t4 keep order:false, stats:pseudo", " └─Projection(Probe) 15593.77 mpp[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5", - " └─Projection 15593.77 mpp[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5", - " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t.c5, test.t.c3)]", - " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", - " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#25, collate: binary]", - " │ └─Projection 10000.00 mpp[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c3, decimal(40,20))->Column#25", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 12475.01 mpp[tiflash] ", - " └─ExchangeSender 12475.01 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c5, collate: binary]", - " └─HashJoin 12475.01 mpp[tiflash] inner join, equal:[eq(test.t.c2, test.t.c1)]", - " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", - " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c2, collate: binary]", - " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t.c2)), not(isnull(test.t.c5))", - " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", - " └─ExchangeReceiver(Probe) 9990.00 mpp[tiflash] ", - " └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c1, collate: binary]", - " └─Selection 9990.00 mpp[tiflash] not(isnull(test.t.c1))", - " └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo" + " └─HashJoin 15593.77 mpp[tiflash] inner join, equal:[eq(test.t.c5, test.t.c3)]", + " ├─ExchangeReceiver(Build) 10000.00 mpp[tiflash] ", + " │ └─ExchangeSender 10000.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: Column#25, collate: binary]", + " │ └─Projection 10000.00 mpp[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c3, decimal(40,20))->Column#25", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t3 keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) 12475.01 mpp[tiflash] ", + " └─ExchangeSender 12475.01 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c5, collate: binary]", + " └─HashJoin 12475.01 mpp[tiflash] inner join, equal:[eq(test.t.c2, test.t.c1)]", + " ├─ExchangeReceiver(Build) 9980.01 mpp[tiflash] ", + " │ └─ExchangeSender 9980.01 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c2, collate: binary]", + " │ └─Selection 9980.01 mpp[tiflash] not(isnull(test.t.c2)), not(isnull(test.t.c5))", + " │ └─TableFullScan 10000.00 mpp[tiflash] table:t2 pushed down filter:empty, keep order:false, stats:pseudo", + " └─ExchangeReceiver(Probe) 9990.00 mpp[tiflash] ", + " └─ExchangeSender 9990.00 mpp[tiflash] ExchangeType: HashPartition, Compression: FAST, Hash Cols: [name: test.t.c1, collate: binary]", + " └─Selection 9990.00 mpp[tiflash] not(isnull(test.t.c1))", + " └─TableFullScan 10000.00 mpp[tiflash] table:t1 pushed down filter:empty, keep order:false, stats:pseudo" ] }, { From f4f4580650d750af0990880f3f27c5a5e6c2f248 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 16:54:32 +0800 Subject: [PATCH 24/25] unittest Signed-off-by: guo-shaoge --- .../testdata/cdc_join_reorder_suite_out.json | 300 +++++++++--------- .../testdata/plan_suite_unexported_out.json | 2 +- pkg/planner/core/tests/null/null_test.go | 18 +- pkg/planner/core/tests/redact/redact_test.go | 21 +- 4 files changed, 171 insertions(+), 170 deletions(-) diff --git a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json index a78a8ca3ca63f..587d690dcf825 100644 --- a/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json +++ b/pkg/planner/core/casetest/rule/testdata/cdc_join_reorder_suite_out.json @@ -1362,18 +1362,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort_14 3.00 root test.t1.a", - "└─HashJoin_17 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader_29(Build) 3.00 root data:Selection_28", - " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_19(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader_26(Build) 3.00 root data:Selection_25", - " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan_24 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader_23(Probe) 3.00 root data:Selection_22", - " └─Selection_22 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan_21 3.00 cop[tikv] table:t1 keep order:false" + "Sort_16 3.00 root test.t1.a", + "└─HashJoin_19 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_31(Build) 3.00 root data:Selection_30", + " │ └─Selection_30 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_29 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_21(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_26 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:Selection_24", + " └─Selection_24 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1382,22 +1382,22 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort_23 3.00 root test.t1.a", - "└─HashJoin_26 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader_43(Build) 3.00 root data:Selection_42", - " │ └─Selection_42 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan_41 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin_28(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader_40(Build) 3.00 root data:Selection_39", - " │ └─Selection_39 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_38 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_30(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader_37(Build) 3.00 root data:Selection_36", - " │ └─Selection_36 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan_35 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader_34(Probe) 3.00 root data:Selection_33", - " └─Selection_33 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan_32 3.00 cop[tikv] table:t1 keep order:false" + "Sort_38 3.00 root test.t1.a", + "└─HashJoin_41 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_58(Build) 3.00 root data:Selection_57", + " │ └─Selection_57 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_56 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_43(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_55(Build) 3.00 root data:Selection_54", + " │ └─Selection_54 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_53 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_45(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_52(Build) 3.00 root data:Selection_51", + " │ └─Selection_51 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_50 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_49(Probe) 3.00 root data:Selection_48", + " └─Selection_48 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_47 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000" @@ -1406,48 +1406,48 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t3.a = t4.a JOIN t5 ON t4.a = t5.a ORDER BY t1.a", "Plan": [ - "Sort_36 3.00 root test.t1.a", - "└─HashJoin_39 3.00 root inner join, equal:[eq(test.t4.a, test.t5.a)]", - " ├─TableReader_61(Build) 3.00 root data:Selection_60", - " │ └─Selection_60 3.00 cop[tikv] not(isnull(test.t5.a))", - " │ └─TableFullScan_59 3.00 cop[tikv] table:t5 keep order:false", - " └─HashJoin_41(Probe) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader_58(Build) 3.00 root data:Selection_57", - " │ └─Selection_57 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan_56 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin_43(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader_55(Build) 3.00 root data:Selection_54", - " │ └─Selection_54 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_53 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_45(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader_52(Build) 3.00 root data:Selection_51", - " │ └─Selection_51 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan_50 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader_49(Probe) 3.00 root data:Selection_48", - " └─Selection_48 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan_47 3.00 cop[tikv] table:t1 keep order:false" + "Sort_106 3.00 root test.t1.a", + "└─HashJoin_109 3.00 root inner join, equal:[eq(test.t4.a, test.t5.a)]", + " ├─TableReader_131(Build) 3.00 root data:Selection_130", + " │ └─Selection_130 3.00 cop[tikv] not(isnull(test.t5.a))", + " │ └─TableFullScan_129 3.00 cop[tikv] table:t5 keep order:false", + " └─HashJoin_111(Probe) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_128(Build) 3.00 root data:Selection_127", + " │ └─Selection_127 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_126 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_113(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_125(Build) 3.00 root data:Selection_124", + " │ └─Selection_124 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_123 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_115(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_122(Build) 3.00 root data:Selection_121", + " │ └─Selection_121 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_120 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_119(Probe) 3.00 root data:Selection_118", + " └─Selection_118 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_117 3.00 cop[tikv] table:t1 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t2 JOIN t1 ON t2.a = t1.a JOIN t3 ON t2.a = t3.a JOIN t4 ON t2.a = t4.a ORDER BY t2.a", "Plan": [ - "Sort_25 3.00 root test.t2.a", - "└─HashJoin_28 3.00 root inner join, equal:[eq(test.t2.a, test.t4.a)]", - " ├─TableReader_45(Build) 3.00 root data:Selection_44", - " │ └─Selection_44 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan_43 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin_30(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader_42(Build) 3.00 root data:Selection_41", - " │ └─Selection_41 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_40 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_32(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", - " ├─TableReader_39(Build) 3.00 root data:Selection_38", - " │ └─Selection_38 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan_37 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader_36(Probe) 3.00 root data:Selection_35", - " └─Selection_35 3.00 cop[tikv] not(isnull(test.t2.a))", - " └─TableFullScan_34 3.00 cop[tikv] table:t2 keep order:false" + "Sort_38 3.00 root test.t2.a", + "└─HashJoin_41 3.00 root inner join, equal:[eq(test.t2.a, test.t4.a)]", + " ├─TableReader_58(Build) 3.00 root data:Selection_57", + " │ └─Selection_57 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_56 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_43(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_55(Build) 3.00 root data:Selection_54", + " │ └─Selection_54 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_53 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_45(Probe) 3.00 root inner join, equal:[eq(test.t2.a, test.t1.a)]", + " ├─TableReader_52(Build) 3.00 root data:Selection_51", + " │ └─Selection_51 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_50 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_49(Probe) 3.00 root data:Selection_48", + " └─Selection_48 3.00 cop[tikv] not(isnull(test.t2.a))", + " └─TableFullScan_47 3.00 cop[tikv] table:t2 keep order:false" ], "Result": [ "1 100 1 10 1 1000 1 10000" @@ -1456,18 +1456,18 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b < t2.b JOIN t3 ON t2.a = t3.a ORDER BY t1.a", "Plan": [ - "Sort_14 3.00 root test.t1.a", - "└─HashJoin_17 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader_29(Build) 3.00 root data:Selection_28", - " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_19(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", - " ├─TableReader_26(Build) 3.00 root data:Selection_25", - " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ └─TableFullScan_24 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader_23(Probe) 3.00 root data:Selection_22", - " └─Selection_22 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", - " └─TableFullScan_21 3.00 cop[tikv] table:t1 keep order:false" + "Sort_16 3.00 root test.t1.a", + "└─HashJoin_19 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_31(Build) 3.00 root data:Selection_30", + " │ └─Selection_30 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_29 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_21(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)], other cond:lt(test.t1.b, test.t2.b)", + " ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ └─TableFullScan_26 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_25(Probe) 3.00 root data:Selection_24", + " └─Selection_24 3.00 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", + " └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000" @@ -1476,36 +1476,36 @@ { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.b = t3.b ORDER BY t1.a", "Plan": [ - "Sort_14 3.00 root test.t1.a", - "└─HashJoin_18 3.00 root inner join, equal:[eq(test.t2.b, test.t3.b)]", - " ├─HashJoin_19(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " │ ├─TableReader_26(Build) 3.00 root data:Selection_25", - " │ │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - " │ │ └─TableFullScan_24 3.00 cop[tikv] table:t2 keep order:false", - " │ └─TableReader_23(Probe) 3.00 root data:Selection_22", - " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t1.a))", - " │ └─TableFullScan_21 3.00 cop[tikv] table:t1 keep order:false", - " └─TableReader_29(Probe) 3.00 root data:Selection_28", - " └─Selection_28 3.00 cop[tikv] not(isnull(test.t3.b))", - " └─TableFullScan_27 3.00 cop[tikv] table:t3 keep order:false" + "Sort_16 3.00 root test.t1.a", + "└─HashJoin_20 3.00 root inner join, equal:[eq(test.t2.b, test.t3.b)]", + " ├─HashJoin_21(Build) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " │ ├─TableReader_28(Build) 3.00 root data:Selection_27", + " │ │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + " │ │ └─TableFullScan_26 3.00 cop[tikv] table:t2 keep order:false", + " │ └─TableReader_25(Probe) 3.00 root data:Selection_24", + " │ └─Selection_24 3.00 cop[tikv] not(isnull(test.t1.a))", + " │ └─TableFullScan_23 3.00 cop[tikv] table:t1 keep order:false", + " └─TableReader_31(Probe) 3.00 root data:Selection_30", + " └─Selection_30 3.00 cop[tikv] not(isnull(test.t3.b))", + " └─TableFullScan_29 3.00 cop[tikv] table:t3 keep order:false" ], "Result": null }, { "SQL": "SELECT * FROM t1 JOIN t2 ON t1.a = t2.a JOIN t3 ON t3.b > 0 ORDER BY t1.a, t3.a", "Plan": [ - "Sort_12 9.00 root test.t1.a, test.t3.a", - "└─HashJoin_15 9.00 root CARTESIAN inner join", - " ├─TableReader_27(Build) 3.00 root data:Selection_26", - " │ └─Selection_26 3.00 cop[tikv] gt(test.t3.b, 0)", - " │ └─TableFullScan_25 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_17(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader_24(Build) 3.00 root data:Selection_23", - " │ └─Selection_23 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan_22 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader_21(Probe) 3.00 root data:Selection_20", - " └─Selection_20 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan_19 3.00 cop[tikv] table:t1 keep order:false" + "Sort_17 9.00 root test.t1.a, test.t3.a", + "└─HashJoin_20 9.00 root CARTESIAN inner join", + " ├─TableReader_32(Build) 3.00 root data:Selection_31", + " │ └─Selection_31 3.00 cop[tikv] gt(test.t3.b, 0)", + " │ └─TableFullScan_30 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_22(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_29(Build) 3.00 root data:Selection_28", + " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_27 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_26(Probe) 3.00 root data:Selection_25", + " └─Selection_25 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000", @@ -1519,15 +1519,36 @@ { "SQL": "SELECT /*+ set_var(tidb_opt_cartesian_join_order_threshold=0) */ * FROM (t1 JOIN t2 ON t1.a = t2.a), (t3 JOIN t4 ON t3.a = t4.a) ORDER BY t1.a, t3.a", "Plan": [ - "Sort_15 9.00 root test.t1.a, test.t3.a", - "└─HashJoin_18 9.00 root CARTESIAN inner join", - " ├─HashJoin_28(Build) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", - " │ ├─TableReader_35(Build) 3.00 root data:Selection_34", - " │ │ └─Selection_34 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ │ └─TableFullScan_33 3.00 cop[tikv] table:t4 keep order:false", - " │ └─TableReader_32(Probe) 3.00 root data:Selection_31", - " │ └─Selection_31 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_30 3.00 cop[tikv] table:t3 keep order:false", + "Sort_38 9.00 root test.t1.a, test.t3.a", + "└─HashJoin_41 9.00 root CARTESIAN inner join", + " ├─HashJoin_51(Build) 3.00 root inner join, equal:[eq(test.t3.a, test.t4.a)]", + " │ ├─TableReader_58(Build) 3.00 root data:Selection_57", + " │ │ └─Selection_57 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ │ └─TableFullScan_56 3.00 cop[tikv] table:t4 keep order:false", + " │ └─TableReader_55(Probe) 3.00 root data:Selection_54", + " │ └─Selection_54 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_53 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_43(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_50(Build) 3.00 root data:Selection_49", + " │ └─Selection_49 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_48 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_47(Probe) 3.00 root data:Selection_46", + " └─Selection_46 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_45 3.00 cop[tikv] table:t1 keep order:false" + ], + "Result": [ + "1 10 1 100 1 1000 1 10000", + "2 20 2 200 1 1000 1 10000" + ] + }, + { + "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "Plan": [ + "Sort_15 3.00 root test.t1.a", + "└─HashJoin_18 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", + " ├─TableReader_30(Build) 3.00 root data:Selection_29", + " │ └─Selection_29 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_28 3.00 cop[tikv] table:t3 keep order:false", " └─HashJoin_20(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", " ├─TableReader_27(Build) 3.00 root data:Selection_26", " │ └─Selection_26 3.00 cop[tikv] not(isnull(test.t2.a))", @@ -1537,19 +1558,18 @@ " └─TableFullScan_22 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ - "1 10 1 100 1 1000 1 10000", - "2 20 2 200 1 1000 1 10000" + "1 10 1 100 1 1000" ] }, { - "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t1.a", + "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a", "Plan": [ - "Sort_13 3.00 root test.t1.a", + "Sort_13 3.00 root test.t2.a", "└─HashJoin_16 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", " ├─TableReader_28(Build) 3.00 root data:Selection_27", " │ └─Selection_27 3.00 cop[tikv] not(isnull(test.t3.a))", " │ └─TableFullScan_26 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_18(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t2.a)]", + " └─HashJoin_18(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", " ├─TableReader_25(Build) 3.00 root data:Selection_24", " │ └─Selection_24 3.00 cop[tikv] not(isnull(test.t2.a))", " │ └─TableFullScan_23 3.00 cop[tikv] table:t2 keep order:false", @@ -1561,45 +1581,25 @@ "1 10 1 100 1 1000" ] }, - { - "SQL": "SELECT * FROM t1 RIGHT JOIN t2 ON t1.a = t2.a JOIN t3 ON t2.a = t3.a ORDER BY t2.a", - "Plan": [ - "Sort_11 3.00 root test.t2.a", - "└─HashJoin_14 3.00 root inner join, equal:[eq(test.t2.a, test.t3.a)]", - " ├─TableReader_26(Build) 3.00 root data:Selection_25", - " │ └─Selection_25 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_24 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_16(Probe) 3.00 root right outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader_23(Build) 3.00 root data:Selection_22", - " │ └─Selection_22 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan_21 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader_20(Probe) 3.00 root data:Selection_19", - " └─Selection_19 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan_18 3.00 cop[tikv] table:t1 keep order:false" - ], - "Result": [ - "1 10 1 100 1 1000" - ] - }, { "SQL": "SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a JOIN t3 ON t1.a = t3.a LEFT JOIN t4 ON t3.a = t4.a ORDER BY t1.a", "Plan": [ - "Sort_15 3.00 root test.t1.a", - "└─HashJoin_18 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", - " ├─TableReader_35(Build) 3.00 root data:Selection_34", - " │ └─Selection_34 3.00 cop[tikv] not(isnull(test.t4.a))", - " │ └─TableFullScan_33 3.00 cop[tikv] table:t4 keep order:false", - " └─HashJoin_20(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", - " ├─TableReader_32(Build) 3.00 root data:Selection_31", - " │ └─Selection_31 3.00 cop[tikv] not(isnull(test.t3.a))", - " │ └─TableFullScan_30 3.00 cop[tikv] table:t3 keep order:false", - " └─HashJoin_22(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─TableReader_29(Build) 3.00 root data:Selection_28", - " │ └─Selection_28 3.00 cop[tikv] not(isnull(test.t2.a))", - " │ └─TableFullScan_27 3.00 cop[tikv] table:t2 keep order:false", - " └─TableReader_26(Probe) 3.00 root data:Selection_25", - " └─Selection_25 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan_24 3.00 cop[tikv] table:t1 keep order:false" + "Sort_21 3.00 root test.t1.a", + "└─HashJoin_24 3.00 root left outer join, equal:[eq(test.t3.a, test.t4.a)]", + " ├─TableReader_41(Build) 3.00 root data:Selection_40", + " │ └─Selection_40 3.00 cop[tikv] not(isnull(test.t4.a))", + " │ └─TableFullScan_39 3.00 cop[tikv] table:t4 keep order:false", + " └─HashJoin_26(Probe) 3.00 root inner join, equal:[eq(test.t1.a, test.t3.a)]", + " ├─TableReader_38(Build) 3.00 root data:Selection_37", + " │ └─Selection_37 3.00 cop[tikv] not(isnull(test.t3.a))", + " │ └─TableFullScan_36 3.00 cop[tikv] table:t3 keep order:false", + " └─HashJoin_28(Probe) 3.00 root left outer join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─TableReader_35(Build) 3.00 root data:Selection_34", + " │ └─Selection_34 3.00 cop[tikv] not(isnull(test.t2.a))", + " │ └─TableFullScan_33 3.00 cop[tikv] table:t2 keep order:false", + " └─TableReader_32(Probe) 3.00 root data:Selection_31", + " └─Selection_31 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan_30 3.00 cop[tikv] table:t1 keep order:false" ], "Result": [ "1 10 1 100 1 1000 1 10000", diff --git a/pkg/planner/core/testdata/plan_suite_unexported_out.json b/pkg/planner/core/testdata/plan_suite_unexported_out.json index 4b87ba4047a4c..0c6590ec34894 100644 --- a/pkg/planner/core/testdata/plan_suite_unexported_out.json +++ b/pkg/planner/core/testdata/plan_suite_unexported_out.json @@ -990,7 +990,7 @@ "DataScan(t1)->Aggr(approx_count_distinct(test.t.a, test.t.b))->Projection", "DataScan(t1)->Projection", "DataScan(t2)->Projection", - "Join{Join{DataScan(t1)->DataScan(t2)}(test.t.a,test.t.a)->DataScan(t3)->TopN([test.t.b true],0,1)}(test.t.b,test.t.b)->TopN([test.t.b true],0,1)->Aggr(max(test.t.b))->Projection", + "Join{Join{DataScan(t1)->DataScan(t3)->TopN([test.t.b true],0,1)}(test.t.b,test.t.b)->DataScan(t2)}(test.t.a,test.t.a)->Projection->TopN([test.t.b true],0,1)->Aggr(max(test.t.b))->Projection", "DataScan(t1)->Projection", "Join{DataScan(t1)->DataScan(t2)}(test.t.a,test.t.a)->Sort->Projection", "DataScan(a)->Projection" diff --git a/pkg/planner/core/tests/null/null_test.go b/pkg/planner/core/tests/null/null_test.go index 8763220e794bf..decb14dcb4acd 100644 --- a/pkg/planner/core/tests/null/null_test.go +++ b/pkg/planner/core/tests/null/null_test.go @@ -79,15 +79,15 @@ WHERE ISNULL(tcd8c2aac.col_21) OR tcd8c2aac.col_21='yJTkLeL5^yJ' GROUP BY tcd8c2aac.col_21 HAVING ISNULL(tcd8c2aac.col_21) LIMIT 48579914;`).Check(testkit.Rows( - "Limit_16 6.40 root offset:0, count:48579914", - "└─HashAgg_17 6.40 root group by:test.tcd8c2aac.col_21, funcs:group_concat(test.tcd8c2aac.col_21 order by test.tcd8c2aac.col_21 separator \",\")->Column#14", - " └─HashJoin_20 80000.00 root CARTESIAN inner join", - " ├─IndexLookUp_24(Build) 8.00 root ", - " │ ├─Selection_23(Build) 8.00 cop[tikv] isnull(test.tcd8c2aac.col_21)", - " │ │ └─IndexRangeScan_21 10.00 cop[tikv] table:tcd8c2aac, index:idx_12(col_21) range:[NULL,NULL], keep order:false, stats:pseudo", - " │ └─TableRowIDScan_22(Probe) 8.00 cop[tikv] table:tcd8c2aac keep order:false, stats:pseudo", - " └─IndexReader_28(Probe) 10000.00 root index:IndexFullScan_27", - " └─IndexFullScan_27 10000.00 cop[tikv] table:tle50fd846, index:PRIMARY(col_48) keep order:false, stats:pseudo")) + `Limit_17 6.40 root offset:0, count:48579914`, + `└─HashAgg_18 6.40 root group by:test.tcd8c2aac.col_21, funcs:group_concat(test.tcd8c2aac.col_21 order by test.tcd8c2aac.col_21 separator ",")->Column#14`, + ` └─HashJoin_21 80000.00 root CARTESIAN inner join`, + ` ├─IndexLookUp_25(Build) 8.00 root `, + ` │ ├─Selection_24(Build) 8.00 cop[tikv] isnull(test.tcd8c2aac.col_21)`, + ` │ │ └─IndexRangeScan_22 10.00 cop[tikv] table:tcd8c2aac, index:idx_12(col_21) range:[NULL,NULL], keep order:false, stats:pseudo`, + ` │ └─TableRowIDScan_23(Probe) 8.00 cop[tikv] table:tcd8c2aac keep order:false, stats:pseudo`, + ` └─IndexReader_29(Probe) 10000.00 root index:IndexFullScan_28`, + ` └─IndexFullScan_28 10000.00 cop[tikv] table:tle50fd846, index:PRIMARY(col_48) keep order:false, stats:pseudo`)) tk.MustQuery(`SELECT GROUP_CONCAT(tcd8c2aac.col_21 ORDER BY tcd8c2aac.col_21 SEPARATOR ',') AS r0 FROM tcd8c2aac JOIN tle50fd846 diff --git a/pkg/planner/core/tests/redact/redact_test.go b/pkg/planner/core/tests/redact/redact_test.go index ef267baa9a947..9b1a0232869a8 100644 --- a/pkg/planner/core/tests/redact/redact_test.go +++ b/pkg/planner/core/tests/redact/redact_test.go @@ -84,11 +84,11 @@ func TestRedactExplain(t *testing.T) { // CTE tk.MustQuery("explain with recursive cte(a) as (select 1 union select a + 1 from cte where a < 1000) select * from cte, t limit 100 offset 100;").Check( testkit.Rows( - "Limit_25 100.00 root offset:‹100›, count:‹100›", - "└─HashJoin_27 200.00 root CARTESIAN inner join", - " ├─CTEFullScan_31(Build) 2.00 root CTE:cte data:CTE_0", - " └─TableReader_33(Probe) 100.00 root data:TableFullScan_32", - " └─TableFullScan_32 100.00 cop[tikv] table:t keep order:false, stats:pseudo", + "Limit_26 100.00 root offset:‹100›, count:‹100›", + "└─HashJoin_28 200.00 root CARTESIAN inner join", + " ├─CTEFullScan_32(Build) 2.00 root CTE:cte data:CTE_0", + " └─TableReader_34(Probe) 100.00 root data:TableFullScan_33", + " └─TableFullScan_33 100.00 cop[tikv] table:t keep order:false, stats:pseudo", "CTE_0 2.00 root Recursive CTE", "├─Projection_16(Seed Part) 1.00 root ‹1›->Column#2", "│ └─TableDual_17 1.00 root rows:1", @@ -156,11 +156,12 @@ func TestRedactExplain(t *testing.T) { " └─TableFullScan 10000.00 cop[tikv] table:tlist keep order:false, stats:pseudo")) // CTE tk.MustQuery("explain with recursive cte(a) as (select 1 union select a + 1 from cte where a < 1000) select * from cte, t limit 100 offset 100;").Check( - testkit.Rows("Limit_25 100.00 root offset:?, count:?", - "└─HashJoin_27 200.00 root CARTESIAN inner join", - " ├─CTEFullScan_31(Build) 2.00 root CTE:cte data:CTE_0", - " └─TableReader_33(Probe) 100.00 root data:TableFullScan_32", - " └─TableFullScan_32 100.00 cop[tikv] table:t keep order:false, stats:pseudo", + testkit.Rows( + "Limit_26 100.00 root offset:?, count:?", + "└─HashJoin_28 200.00 root CARTESIAN inner join", + " ├─CTEFullScan_32(Build) 2.00 root CTE:cte data:CTE_0", + " └─TableReader_34(Probe) 100.00 root data:TableFullScan_33", + " └─TableFullScan_33 100.00 cop[tikv] table:t keep order:false, stats:pseudo", "CTE_0 2.00 root Recursive CTE", "├─Projection_16(Seed Part) 1.00 root ?->Column#2", "│ └─TableDual_17 1.00 root rows:1", From 397660a702958c733d408f9f642756b6d0b0e472 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Sat, 6 Jun 2026 17:40:59 +0800 Subject: [PATCH 25/25] case Signed-off-by: guo-shaoge --- pkg/planner/core/logical_plan_trace_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/planner/core/logical_plan_trace_test.go b/pkg/planner/core/logical_plan_trace_test.go index a904223bc1e65..edb4fda6c8fe4 100644 --- a/pkg/planner/core/logical_plan_trace_test.go +++ b/pkg/planner/core/logical_plan_trace_test.go @@ -414,6 +414,8 @@ func TestSingleRuleTraceStep(t *testing.T) { require.NoError(t, err, comment) sctx := MockContext() sctx.GetSessionVars().StmtCtx.EnableOptimizeTrace = true + // new join reorder doesn't support trace. + sctx.GetSessionVars().TiDBOptEnableAdvancedJoinReorder = false sctx.GetSessionVars().AllowAggPushDown = true builder, _ := NewPlanBuilder().Init(sctx, s.is, hint.NewQBHintHandler(nil)) domain.GetDomain(sctx).MockInfoCacheAndLoadInfoSchema(s.is)