From f958c5a27d61c4de09ee8747caac0f87b72c4225 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Tue, 29 Nov 2022 01:09:56 +0800 Subject: [PATCH 1/6] fixup --- planner/core/plan_cost_ver2.go | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/planner/core/plan_cost_ver2.go b/planner/core/plan_cost_ver2.go index 1eaa67a6fc06b..1677b8ef52479 100644 --- a/planner/core/plan_cost_ver2.go +++ b/planner/core/plan_cost_ver2.go @@ -256,14 +256,17 @@ func (p *PhysicalIndexLookUpReader) getPlanCostVer2(taskType property.TaskType, } tableSideCost := divCostVer2(sumCostVer2(tableNetCost, tableChildCost), distConcurrency) - // double-read: assume at least 1 row to double-read to avoid 0 double-read cost. - doubleReadRows := math.Max(indexRows, 1) + doubleReadRows := indexRows doubleReadCPUCost := newCostVer2(option, cpuFactor, indexRows*cpuFactor.Value, func() string { return fmt.Sprintf("double-read-cpu(%v*%v)", doubleReadRows, cpuFactor) }) batchSize := float64(p.ctx.GetSessionVars().IndexLookupSize) taskPerBatch := 32.0 // TODO: remove this magic number doubleReadTasks := doubleReadRows / batchSize * taskPerBatch + if doubleReadRows <= 1 { + // prefer to use IndexLookup if double-read data-size is very small + doubleReadTasks = 0 + } doubleReadRequestCost := doubleReadCostVer2(option, doubleReadTasks, requestFactor) doubleReadCost := sumCostVer2(doubleReadCPUCost, doubleReadRequestCost) @@ -448,13 +451,16 @@ func (p *PhysicalHashAgg) getPlanCostVer2(taskType property.TaskType, option *Pl groupCost := groupCostVer2(option, inputRows, p.GroupByItems, cpuFactor) hashBuildCost := hashBuildCostVer2(option, outputRows, outputRowSize, float64(len(p.GroupByItems)), cpuFactor, memFactor) hashProbeCost := hashProbeCostVer2(option, inputRows, float64(len(p.GroupByItems)), cpuFactor) + startCost := newCostVer2(option, cpuFactor, + 10*3*cpuFactor.Value, + func() string { return fmt.Sprintf("cpu(10*3*%v)", cpuFactor) }) childCost, err := p.children[0].getPlanCostVer2(taskType, option) if err != nil { return zeroCostVer2, err } - p.planCostVer2 = sumCostVer2(childCost, divCostVer2(sumCostVer2(aggCost, groupCost, hashBuildCost, hashProbeCost), concurrency)) + p.planCostVer2 = sumCostVer2(startCost, childCost, divCostVer2(sumCostVer2(aggCost, groupCost, hashBuildCost, hashProbeCost), concurrency)) p.planCostInit = true return p.planCostVer2, nil } @@ -532,7 +538,10 @@ func (p *PhysicalHashJoin) getPlanCostVer2(taskType property.TaskType, option *P p.planCostVer2 = sumCostVer2(buildChildCost, probeChildCost, divCostVer2(sumCostVer2(buildHashCost, buildFilterCost, probeHashCost, probeFilterCost), mppConcurrency)) } else { // TiDB HashJoin - p.planCostVer2 = sumCostVer2(buildChildCost, probeChildCost, buildHashCost, buildFilterCost, + startCost := newCostVer2(option, cpuFactor, + 10*3*cpuFactor.Value, + func() string { return fmt.Sprintf("cpu(10*3*%v)", cpuFactor) }) + p.planCostVer2 = sumCostVer2(startCost, buildChildCost, probeChildCost, buildHashCost, buildFilterCost, divCostVer2(sumCostVer2(probeFilterCost, probeHashCost), tidbConcurrency)) } p.planCostInit = true @@ -563,6 +572,9 @@ func (p *PhysicalIndexJoin) getIndexJoinCostVer2(taskType property.TaskType, opt buildTaskCost := newCostVer2(option, cpuFactor, buildRows*10*cpuFactor.Value, func() string { return fmt.Sprintf("cpu(%v*10*%v)", buildRows, cpuFactor) }) + startCost := newCostVer2(option, cpuFactor, + 10*3*cpuFactor.Value, + func() string { return fmt.Sprintf("cpu(10*3*%v)", cpuFactor) }) probeFilterCost := filterCostVer2(option, probeRowsTot, probeFilters, cpuFactor) probeChildCost, err := probe.getPlanCostVer2(taskType, option) @@ -587,7 +599,7 @@ func (p *PhysicalIndexJoin) getIndexJoinCostVer2(taskType property.TaskType, opt batchRatio := 6.0 probeCost := divCostVer2(mulCostVer2(probeChildCost, buildRows), batchRatio) - p.planCostVer2 = sumCostVer2(buildChildCost, buildFilterCost, buildTaskCost, divCostVer2(sumCostVer2(probeCost, probeFilterCost, hashTableCost), probeConcurrency)) + p.planCostVer2 = sumCostVer2(startCost, buildChildCost, buildFilterCost, buildTaskCost, divCostVer2(sumCostVer2(probeCost, probeFilterCost, hashTableCost), probeConcurrency)) p.planCostInit = true return p.planCostVer2, nil } From a36e38ede8aaf22c7f25a4013bf5b8d05afa7fcd Mon Sep 17 00:00:00 2001 From: qw4990 Date: Tue, 29 Nov 2022 11:02:16 +0800 Subject: [PATCH 2/6] fixup --- executor/explainfor_test.go | 24 +- executor/join_test.go | 2 +- executor/testdata/executor_suite_out.json | 4 +- planner/core/integration_test.go | 16 +- planner/core/point_get_plan_test.go | 2 +- planner/core/testdata/analyze_suite_out.json | 6 +- .../core/testdata/binary_plan_suite_out.json | 8 +- .../core/testdata/enforce_mpp_suite_out.json | 149 ++- .../expression_rewriter_suite_out.json | 36 +- .../core/testdata/integration_suite_out.json | 982 +++++++++--------- .../core/testdata/join_reorder_suite_out.json | 86 +- planner/core/testdata/plan_suite_out.json | 40 +- .../testdata/clustered_index_suite_out.json | 12 +- statistics/testdata/stats_suite_out.json | 291 +++--- util/ranger/testdata/ranger_suite_out.json | 2 +- 15 files changed, 799 insertions(+), 861 deletions(-) diff --git a/executor/explainfor_test.go b/executor/explainfor_test.go index 4cf45d998dac1..5a32a32eb040e 100644 --- a/executor/explainfor_test.go +++ b/executor/explainfor_test.go @@ -462,12 +462,12 @@ func TestPointGetUserVarPlanCache(t *testing.T) { 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 1.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b`, - `└─IndexJoin_17 1.00 root inner join, inner:TableReader_13, outer key:test.t2.a, inner key:test.t1.a, equal cond:eq(test.t2.a, test.t1.a)`, - ` ├─Selection_44(Build) 0.80 root not(isnull(test.t2.a))`, - ` │ └─Point_Get_43 1.00 root table:t2, index:idx_a(a) `, - ` └─TableReader_13(Probe) 0.00 root data:Selection_12`, - ` └─Selection_12 0.00 cop[tikv] eq(test.t1.a, 1)`, - ` └─TableRangeScan_11 0.80 cop[tikv] table:t1 range: decided by [eq(test.t1.a, test.t2.a)], keep order:false, stats:pseudo`)) + `└─MergeJoin_10 1.00 root inner join, left key:test.t2.a, right key:test.t1.a`, + ` ├─Selection_42(Build) 10.00 root eq(test.t1.a, 1)`, + ` │ └─TableReader_41 10.00 root data:TableRangeScan_40`, + ` │ └─TableRangeScan_40 10.00 cop[tikv] table:t1 range:[1,1], keep order:true, stats:pseudo`, + ` └─Selection_39(Probe) 0.80 root not(isnull(test.t2.a))`, + ` └─Point_Get_38 1.00 root table:t2, index:idx_a(a) `)) tk.MustExec("set @a=2") tk.MustQuery("execute stmt using @a").Check(testkit.Rows( @@ -478,12 +478,12 @@ func TestPointGetUserVarPlanCache(t *testing.T) { 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 1.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b`, - `└─IndexJoin_17 1.00 root inner join, inner:TableReader_13, outer key:test.t2.a, inner key:test.t1.a, equal cond:eq(test.t2.a, test.t1.a)`, - ` ├─Selection_44(Build) 0.80 root not(isnull(test.t2.a))`, - ` │ └─Point_Get_43 1.00 root table:t2, index:idx_a(a) `, - ` └─TableReader_13(Probe) 0.00 root data:Selection_12`, - ` └─Selection_12 0.00 cop[tikv] eq(test.t1.a, 2)`, - ` └─TableRangeScan_11 0.80 cop[tikv] table:t1 range: decided by [eq(test.t1.a, test.t2.a)], keep order:false, stats:pseudo`)) + `└─MergeJoin_10 1.00 root inner join, left key:test.t2.a, right key:test.t1.a`, + ` ├─Selection_42(Build) 10.00 root eq(test.t1.a, 1)`, + ` │ └─TableReader_41 10.00 root data:TableRangeScan_40`, + ` │ └─TableRangeScan_40 10.00 cop[tikv] table:t1 range:[1,1], keep order:true, stats:pseudo`, + ` └─Selection_39(Probe) 0.80 root not(isnull(test.t2.a))`, + ` └─Point_Get_38 1.00 root table:t2, index:idx_a(a) `)) tk.MustQuery("execute stmt using @a").Check(testkit.Rows( "2 4 2 2", )) diff --git a/executor/join_test.go b/executor/join_test.go index 5daa60d9a595f..a5d5f6efc9fb5 100644 --- a/executor/join_test.go +++ b/executor/join_test.go @@ -1479,7 +1479,7 @@ func TestIndexNestedLoopHashJoin(t *testing.T) { " └─TableRowIDScan 27.00 cop[tikv] table:l2 keep order:false")) tk.MustQuery("select * from t l1 where exists ( select * from t l2 where l2.l_orderkey = l1.l_orderkey and l2.l_suppkey <> l1.l_suppkey )order by `l_orderkey`,`l_linenumber`;").Check(testkit.Rows("0 0 0 0", "0 1 0 1", "0 2 0 0", "1 0 1 0", "1 1 1 1", "1 2 1 0", "2 0 0 0", "2 1 0 1", "2 2 0 0")) tk.MustQuery("desc format = 'brief' select count(*) from t l1 where exists ( select * from t l2 where l2.l_orderkey = l1.l_orderkey and l2.l_suppkey <> l1.l_suppkey );").Check(testkit.Rows( - "HashAgg 1.00 root funcs:count(1)->Column#11", + "StreamAgg 1.00 root funcs:count(1)->Column#11", "└─IndexHashJoin 7.20 root semi join, inner:IndexLookUp, outer key:test.t.l_orderkey, inner key:test.t.l_orderkey, equal cond:eq(test.t.l_orderkey, test.t.l_orderkey), other cond:ne(test.t.l_suppkey, test.t.l_suppkey)", " ├─TableReader(Build) 9.00 root data:Selection", " │ └─Selection 9.00 cop[tikv] not(isnull(test.t.l_suppkey))", diff --git a/executor/testdata/executor_suite_out.json b/executor/testdata/executor_suite_out.json index c06ee935e8b37..e0fbfecb07095 100644 --- a/executor/testdata/executor_suite_out.json +++ b/executor/testdata/executor_suite_out.json @@ -674,7 +674,7 @@ { "SQL": "select count(*) from t as t1 inner join t as t2 on t1.c1 = t2.c1 where t1.c1 != NULL", "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#7", + "StreamAgg 1.00 root funcs:count(1)->Column#7", "└─MergeJoin 0.00 root inner join, left key:test.t.c1, right key:test.t.c1", " ├─TableDual(Build) 0.00 root rows:0", " └─TableDual(Probe) 0.00 root rows:0" @@ -704,7 +704,7 @@ { "SQL": "select count(*) from t as t1 left join t as t2 on t1.c1 = t2.c1 where t1.c1 != NULL", "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#7", + "StreamAgg 1.00 root funcs:count(1)->Column#7", "└─MergeJoin 0.00 root left outer join, left key:test.t.c1, right key:test.t.c1", " ├─TableDual(Build) 0.00 root rows:0", " └─TableDual(Probe) 0.00 root rows:0" diff --git a/planner/core/integration_test.go b/planner/core/integration_test.go index db60c99fdf4c5..2d119d8c99d5c 100644 --- a/planner/core/integration_test.go +++ b/planner/core/integration_test.go @@ -1231,9 +1231,9 @@ func TestAggPushDownEngine(t *testing.T) { tk.MustExec("set @@session.tidb_isolation_read_engines = 'tiflash'") tk.MustQuery("explain format = 'brief' select approx_count_distinct(a) from t").Check(testkit.Rows( - "HashAgg 1.00 root funcs:approx_count_distinct(Column#4)->Column#3", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:approx_count_distinct(test.t.a)->Column#4", + "StreamAgg 1.00 root funcs:approx_count_distinct(Column#5)->Column#3", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:approx_count_distinct(test.t.a)->Column#5", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo")) tk.MustExec("set @@session.tidb_isolation_read_engines = 'tikv'") @@ -6695,7 +6695,7 @@ func TestAggPushToCopForCachedTable(t *testing.T) { tk.MustExec("alter table t32157 cache") tk.MustQuery("explain format = 'brief' select /*+AGG_TO_COP()*/ count(*) from t32157 ignore index(primary) where process_code = 'GDEP0071'").Check(testkit.Rows( - "HashAgg 1.00 root funcs:count(1)->Column#8]\n" + + "StreamAgg 1.00 root funcs:count(1)->Column#8]\n" + "[└─UnionScan 10.00 root eq(test.t32157.process_code, \"GDEP0071\")]\n" + "[ └─TableReader 10.00 root data:Selection]\n" + "[ └─Selection 10.00 cop[tikv] eq(test.t32157.process_code, \"GDEP0071\")]\n" + @@ -7963,10 +7963,10 @@ func TestNullConditionForPrefixIndex(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( - "HashAgg_12 1.00 root funcs:count(Column#6)->Column#5", - "└─IndexReader_13 1.00 root index:HashAgg_6", - " └─HashAgg_6 1.00 cop[tikv] funcs:count(1)->Column#6", - " └─IndexRangeScan_11 99.90 cop[tikv] table:t1, index:idx2(c1, c2) range:[\"0xfff\" -inf,\"0xfff\" +inf], keep order:false, stats:pseudo")) + "StreamAgg_18 1.00 root funcs:count(Column#7)->Column#5", + "└─IndexReader_19 1.00 root index:StreamAgg_9", + " └─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#7", + " └─IndexRangeScan_17 99.90 cop[tikv] table:t1, index:idx2(c1, c2) range:[\"0xfff\" -inf,\"0xfff\" +inf], keep order:false, stats:pseudo")) } func TestAutoIncrementCheckWithCheckConstraint(t *testing.T) { diff --git a/planner/core/point_get_plan_test.go b/planner/core/point_get_plan_test.go index 7801631325f37..812151afc26ec 100644 --- a/planner/core/point_get_plan_test.go +++ b/planner/core/point_get_plan_test.go @@ -189,7 +189,7 @@ func TestGetExtraColumn(t *testing.T) { tk.MustQuery(`explain format='brief' select t.*, _tidb_rowid from t where a = 1`).Check(testkit.Rows(`Point_Get 1.00 root table:t, index:idx(a) `)) tk.MustExec(`commit`) tk.MustQuery(`explain format='brief' select count(_tidb_rowid) from t where a=1`).Check(testkit.Rows( - `HashAgg 1.00 root funcs:count(test.t._tidb_rowid)->Column#4`, + `StreamAgg 1.00 root funcs:count(test.t._tidb_rowid)->Column#4`, `└─Point_Get 1.00 root table:t, index:idx(a) `)) tk.MustQuery(`explain format='brief' select *, date_format(b, "") from t where a =1 for update`).Check(testkit.Rows( `Projection 1.00 root test.t.a, test.t.b, date_format(cast(test.t.b, datetime BINARY), )->Column#4`, diff --git a/planner/core/testdata/analyze_suite_out.json b/planner/core/testdata/analyze_suite_out.json index 4d902fec467a5..ea1e33b3ca0b8 100644 --- a/planner/core/testdata/analyze_suite_out.json +++ b/planner/core/testdata/analyze_suite_out.json @@ -383,7 +383,7 @@ "└─Apply 10.00 root CARTESIAN left outer semi join, other cond:eq(test.t.c, Column#21)", " ├─IndexReader(Build) 10.00 root index:IndexFullScan", " │ └─IndexFullScan 10.00 cop[tikv] table:t, index:idx(c, b, a) keep order:false", - " └─HashAgg(Probe) 10.00 root funcs:count(1)->Column#21", + " └─StreamAgg(Probe) 10.00 root funcs:count(1)->Column#21", " └─HashJoin 10.00 root inner join, equal:[eq(test.t.a, test.t.a)]", " ├─IndexReader(Build) 10.00 root index:Selection", " │ └─Selection 10.00 cop[tikv] eq(test.t.a, test.t.a), not(isnull(test.t.a))", @@ -411,7 +411,7 @@ { "SQL": "explain format = 'brief' select max(e) from t where a='T3382' and b='ECO' and c='TOPIC' and d='23660fa1ace9455cb7f3ee831e14a342'", "Plan": [ - "HashAgg 1.00 root funcs:max(test.t.e)->Column#7", + "StreamAgg 1.00 root funcs:max(test.t.e)->Column#7", "└─TopN 0.00 root test.t.e:desc, offset:0, count:1", " └─IndexLookUp 0.00 root ", " ├─IndexRangeScan(Build) 0.01 cop[tikv] table:t, index:idx1(d, a) range:[\"23660fa1ace9455cb7f3ee831e14a342\" \"T3382\",\"23660fa1ace9455cb7f3ee831e14a342\" \"T3382\"], keep order:false", @@ -435,7 +435,7 @@ "Cases": [ "IndexReader(Index(t.e)[[NULL,+inf]]->StreamAgg)->StreamAgg", "IndexReader(Index(t.e)[[-inf,10]]->StreamAgg)->StreamAgg", - "IndexReader(Index(t.e)[[-inf,50]]->HashAgg)->HashAgg", + "IndexReader(Index(t.e)[[-inf,50]]->StreamAgg)->StreamAgg", "IndexReader(Index(t.b_c)[[NULL,+inf]]->Sel([gt(test.t.c, 1)])->StreamAgg)->StreamAgg", "IndexLookUp(Index(t.e)[[1,1]], Table(t))->HashAgg", "TableReader(Table(t)->Sel([gt(test.t.e, 1)])->HashAgg)->HashAgg", diff --git a/planner/core/testdata/binary_plan_suite_out.json b/planner/core/testdata/binary_plan_suite_out.json index 203f11acf364f..a361c5ca0b23f 100644 --- a/planner/core/testdata/binary_plan_suite_out.json +++ b/planner/core/testdata/binary_plan_suite_out.json @@ -123,7 +123,7 @@ "operator_info": "data:TableFullScan_16" } ], - "cost": 975351.9825195674, + "cost": 976848.9825195674, "est_rows": 100000000, "act_rows": 8, "task_type": 1, @@ -131,7 +131,7 @@ "operator_info": "CARTESIAN inner join" } ], - "cost": 998975351.9825196, + "cost": 998976848.9825196, "est_rows": 100000000, "act_rows": 8, "task_type": 1, @@ -139,7 +139,7 @@ "operator_info": "cast(test.t.a, decimal(10,0) BINARY)->Column#8" } ], - "cost": 1996975363.5625196, + "cost": 1996978357.5625196, "est_rows": 1, "act_rows": 1, "task_type": 1, @@ -283,7 +283,7 @@ "operator_info": "data:Selection_33" } ], - "cost": 1798740.0717058014, + "cost": 1800237.0717058014, "est_rows": 12487.5, "task_type": 1, "store_type": 1, diff --git a/planner/core/testdata/enforce_mpp_suite_out.json b/planner/core/testdata/enforce_mpp_suite_out.json index e2034d2a536b4..12cde0ede133e 100644 --- a/planner/core/testdata/enforce_mpp_suite_out.json +++ b/planner/core/testdata/enforce_mpp_suite_out.json @@ -31,30 +31,30 @@ { "SQL": "explain format='verbose' select count(*) from t where a=1", "Plan": [ - "HashAgg_14 1.00 154.90 root funcs:count(Column#5)->Column#4", - "└─IndexReader_15 1.00 124.64 root index:HashAgg_6", - " └─HashAgg_6 1.00 1837.90 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_13 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_24 1.00 193.81 root funcs:count(Column#6)->Column#4", + "└─IndexReader_25 1.00 143.91 root index:StreamAgg_9", + " └─StreamAgg_9 1.00 2127.00 cop[tikv] funcs:count(1)->Column#6", + " └─IndexRangeScan_23 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": null }, { "SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_12 1.00 154.90 root funcs:count(Column#5)->Column#4", - "└─IndexReader_13 1.00 124.64 root index:HashAgg_6", - " └─HashAgg_6 1.00 1837.90 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_11 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_17 1.00 193.81 root funcs:count(Column#6)->Column#4", + "└─IndexReader_18 1.00 143.91 root index:StreamAgg_9", + " └─StreamAgg_9 1.00 2127.00 cop[tikv] funcs:count(1)->Column#6", + " └─IndexRangeScan_16 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": null }, { "SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_8 1.00 63718.81 root funcs:count(1)->Column#4", - "└─TableReader_17 10.00 63508.91 root data:Selection_16", - " └─Selection_16 10.00 952000.00 cop[tiflash] eq(test.t.a, 1)", - " └─TableFullScan_15 10000.00 928000.00 cop[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg_10 1.00 64007.91 root funcs:count(1)->Column#4", + "└─TableReader_24 10.00 63508.91 root data:Selection_23", + " └─Selection_23 10.00 952000.00 cop[tiflash] eq(test.t.a, 1)", + " └─TableFullScan_22 10000.00 928000.00 cop[tiflash] table:t keep order:false, stats:pseudo" ], "Warn": null }, @@ -71,32 +71,30 @@ { "SQL": "explain format='verbose' select count(*) from t where a=1", "Plan": [ - "HashAgg_16 1.00 154.90 root funcs:count(Column#5)->Column#4", - "└─IndexReader_17 1.00 124.64 root index:HashAgg_7", - " └─HashAgg_7 1.00 1837.90 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_15 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_31 1.00 193.81 root funcs:count(Column#7)->Column#4", + "└─IndexReader_32 1.00 143.91 root index:StreamAgg_11", + " └─StreamAgg_11 1.00 2127.00 cop[tikv] funcs:count(1)->Column#7", + " └─IndexRangeScan_30 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": null }, { "SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_14 1.00 154.90 root funcs:count(Column#5)->Column#4", - "└─IndexReader_15 1.00 124.64 root index:HashAgg_7", - " └─HashAgg_7 1.00 1837.90 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_13 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_19 1.00 193.81 root funcs:count(Column#6)->Column#4", + "└─IndexReader_20 1.00 143.91 root index:StreamAgg_11", + " └─StreamAgg_11 1.00 2127.00 cop[tikv] funcs:count(1)->Column#6", + " └─IndexRangeScan_18 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": null }, { "SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_22 1.00 63498.78 root funcs:count(Column#6)->Column#4", - "└─TableReader_24 1.00 63468.52 root data:ExchangeSender_23", - " └─ExchangeSender_23 1.00 952010.16 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg_10 1.00 952010.16 mpp[tiflash] funcs:count(1)->Column#6", - " └─Selection_21 10.00 952000.00 mpp[tiflash] eq(test.t.a, 1)", - " └─TableFullScan_20 10000.00 928000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg_12 1.00 64007.91 root funcs:count(1)->Column#4", + "└─TableReader_31 10.00 63508.91 root data:Selection_30", + " └─Selection_30 10.00 952000.00 cop[tiflash] eq(test.t.a, 1)", + " └─TableFullScan_29 10000.00 928000.00 cop[tiflash] table:t keep order:false, stats:pseudo" ], "Warn": null }, @@ -108,32 +106,30 @@ { "SQL": "explain format='verbose' select count(*) from t where a=1", "Plan": [ - "HashAgg_16 1.00 154.90 root funcs:count(Column#5)->Column#4", - "└─IndexReader_17 1.00 124.64 root index:HashAgg_7", - " └─HashAgg_7 1.00 1837.90 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_15 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_31 1.00 193.81 root funcs:count(Column#7)->Column#4", + "└─IndexReader_32 1.00 143.91 root index:StreamAgg_11", + " └─StreamAgg_11 1.00 2127.00 cop[tikv] funcs:count(1)->Column#7", + " └─IndexRangeScan_30 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": null }, { "SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_14 1.00 154.90 root funcs:count(Column#5)->Column#4", - "└─IndexReader_15 1.00 124.64 root index:HashAgg_7", - " └─HashAgg_7 1.00 1837.90 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_13 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_19 1.00 193.81 root funcs:count(Column#6)->Column#4", + "└─IndexReader_20 1.00 143.91 root index:StreamAgg_11", + " └─StreamAgg_11 1.00 2127.00 cop[tikv] funcs:count(1)->Column#6", + " └─IndexRangeScan_18 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": null }, { "SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_22 1.00 63498.78 root funcs:count(Column#6)->Column#4", - "└─TableReader_24 1.00 63468.52 root data:ExchangeSender_23", - " └─ExchangeSender_23 1.00 952010.16 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg_10 1.00 952010.16 mpp[tiflash] funcs:count(1)->Column#6", - " └─Selection_21 10.00 952000.00 mpp[tiflash] eq(test.t.a, 1)", - " └─TableFullScan_20 10000.00 928000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg_12 1.00 64007.91 root funcs:count(1)->Column#4", + "└─TableReader_31 10.00 63508.91 root data:Selection_30", + " └─Selection_30 10.00 952000.00 cop[tiflash] eq(test.t.a, 1)", + " └─TableFullScan_29 10000.00 928000.00 cop[tiflash] table:t keep order:false, stats:pseudo" ], "Warn": null }, @@ -145,22 +141,20 @@ { "SQL": "explain format='verbose' select count(*) from t where a=1", "Plan": [ - "HashAgg_25 1.00 30.26 root funcs:count(Column#6)->Column#4", - "└─TableReader_27 1.00 0.00 root data:ExchangeSender_26", - " └─ExchangeSender_26 1.00 952010.16 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg_10 1.00 952010.16 mpp[tiflash] funcs:count(1)->Column#6", - " └─Selection_24 10.00 952000.00 mpp[tiflash] eq(test.t.a, 1)", - " └─TableFullScan_23 10000.00 928000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg_31 1.00 193.81 root funcs:count(Column#7)->Column#4", + "└─IndexReader_32 1.00 143.91 root index:StreamAgg_11", + " └─StreamAgg_11 1.00 2127.00 cop[tikv] funcs:count(1)->Column#7", + " └─IndexRangeScan_30 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": null }, { "SQL": "explain format='verbose' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_14 1.00 154.90 root funcs:count(Column#5)->Column#4", - "└─IndexReader_15 1.00 124.64 root index:HashAgg_7", - " └─HashAgg_7 1.00 1837.90 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_13 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_19 1.00 193.81 root funcs:count(Column#6)->Column#4", + "└─IndexReader_20 1.00 143.91 root index:StreamAgg_11", + " └─StreamAgg_11 1.00 2127.00 cop[tikv] funcs:count(1)->Column#6", + " └─IndexRangeScan_18 10.00 1628.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": [ "MPP mode may be blocked because you have set a hint to read table `t` from TiKV." @@ -169,12 +163,11 @@ { "SQL": "explain format='verbose' select /*+ read_from_storage(tiflash[t]) */ count(*) from t where a=1", "Plan": [ - "HashAgg_22 1.00 30.26 root funcs:count(Column#6)->Column#4", - "└─TableReader_24 1.00 0.00 root data:ExchangeSender_23", - " └─ExchangeSender_23 1.00 952010.16 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg_10 1.00 952010.16 mpp[tiflash] funcs:count(1)->Column#6", - " └─Selection_21 10.00 952000.00 mpp[tiflash] eq(test.t.a, 1)", - " └─TableFullScan_20 10000.00 928000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg_27 1.00 49.90 root funcs:count(Column#7)->Column#4", + "└─TableReader_28 1.00 0.00 root data:StreamAgg_11", + " └─StreamAgg_11 1.00 1427024.00 batchCop[tiflash] funcs:count(1)->Column#7", + " └─Selection_26 10.00 1427000.00 batchCop[tiflash] eq(test.t.a, 1)", + " └─TableFullScan_25 10000.00 928000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ], "Warn": null } @@ -191,9 +184,9 @@ { "SQL": "explain format = 'brief' select count(*) from t where a=1 -- 1. no replica", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#7)->Column#6", - "└─IndexReader 1.00 root index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#7", + "StreamAgg 1.00 root funcs:count(Column#8)->Column#6", + "└─IndexReader 1.00 root index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#8", " └─IndexRangeScan 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": [ @@ -208,10 +201,10 @@ { "SQL": "explain select count(*) from t where a=1 -- 2. replica not ready", "Plan": [ - "HashAgg_12 1.00 root funcs:count(Column#7)->Column#6", - "└─IndexReader_13 1.00 root index:HashAgg_6", - " └─HashAgg_6 1.00 cop[tikv] funcs:count(1)->Column#7", - " └─IndexRangeScan_11 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6", + "└─IndexReader_18 1.00 root index:StreamAgg_9", + " └─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8", + " └─IndexRangeScan_16 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": [ "MPP mode may be blocked because tiflash replicas of table `t` not ready." @@ -230,10 +223,10 @@ { "SQL": "explain select count(*) from t where a=1 -- 3. isolation_engine not match", "Plan": [ - "HashAgg_12 1.00 root funcs:count(Column#7)->Column#6", - "└─IndexReader_13 1.00 root index:HashAgg_6", - " └─HashAgg_6 1.00 cop[tikv] funcs:count(1)->Column#7", - " └─IndexRangeScan_11 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" + "StreamAgg_17 1.00 root funcs:count(Column#8)->Column#6", + "└─IndexReader_18 1.00 root index:StreamAgg_9", + " └─StreamAgg_9 1.00 cop[tikv] funcs:count(1)->Column#8", + " └─IndexRangeScan_16 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": [ "MPP mode may be blocked because 'tidb_isolation_read_engines'(value: 'tikv') not match, need 'tiflash'." @@ -247,9 +240,9 @@ { "SQL": "explain format = 'brief' select /*+ read_from_storage(tikv[t]) */ count(*) from t where a=1 -- 4. hint use tikv", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#7)->Column#6", - "└─IndexReader 1.00 root index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#7", + "StreamAgg 1.00 root funcs:count(Column#8)->Column#6", + "└─IndexReader 1.00 root index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#8", " └─IndexRangeScan 10.00 cop[tikv] table:t, index:idx(a) range:[1,1], keep order:false, stats:pseudo" ], "Warn": [ @@ -287,7 +280,7 @@ { "SQL": "EXPLAIN format = 'brief' SELECT count(b) from t where a=1; -- 7. agg func has virtual column", "Plan": [ - "HashAgg 1.00 root funcs:count(test.t.b)->Column#6", + "StreamAgg 1.00 root funcs:count(test.t.b)->Column#6", "└─TableReader 10.00 root data:Selection", " └─Selection 10.00 cop[tiflash] eq(test.t.a, 1)", " └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo" @@ -334,7 +327,7 @@ { "SQL": "EXPLAIN format = 'brief' SELECT count(a) from t where c=1; -- 11. type not supported", "Plan": [ - "HashAgg 1.00 root funcs:count(test.t.a)->Column#6", + "StreamAgg 1.00 root funcs:count(test.t.a)->Column#6", "└─TableReader 10.00 root data:Selection", " └─Selection 10.00 cop[tikv] eq(test.t.c, 1)", " └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo" @@ -350,7 +343,7 @@ { "SQL": "EXPLAIN format = 'brief' SELECT count(a) from t where d=1; -- 11.1. type not supported", "Plan": [ - "HashAgg 1.00 root funcs:count(test.t.a)->Column#6", + "StreamAgg 1.00 root funcs:count(test.t.a)->Column#6", "└─TableReader 10.00 root data:Selection", " └─Selection 10.00 cop[tikv] eq(test.t.d, 1)", " └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo" @@ -381,11 +374,11 @@ { "SQL": "EXPLAIN SELECT count(*) from t where a=1; -- 1. static partition prune", "Plan": [ - "HashAgg_19 1.00 root funcs:count(Column#5)->Column#4", - "└─TableReader_20 1.00 root data:HashAgg_9", - " └─HashAgg_9 1.00 batchCop[tiflash] funcs:count(1)->Column#5", - " └─Selection_18 10.00 batchCop[tiflash] eq(test.t.a, 1)", - " └─TableFullScan_17 10000.00 batchCop[tiflash] table:t, partition:p0 keep order:false, stats:pseudo" + "StreamAgg_32 1.00 root funcs:count(Column#6)->Column#4", + "└─TableReader_33 1.00 root data:StreamAgg_13", + " └─StreamAgg_13 1.00 batchCop[tiflash] funcs:count(1)->Column#6", + " └─Selection_31 10.00 batchCop[tiflash] eq(test.t.a, 1)", + " └─TableFullScan_30 10000.00 batchCop[tiflash] table:t, partition:p0 keep order:false, stats:pseudo" ], "Warn": [ "MPP mode may be blocked because table `t`is a partition table which is not supported when `@@tidb_partition_prune_mode=static`." diff --git a/planner/core/testdata/expression_rewriter_suite_out.json b/planner/core/testdata/expression_rewriter_suite_out.json index b7f5a31f7a46a..72b86884a1412 100644 --- a/planner/core/testdata/expression_rewriter_suite_out.json +++ b/planner/core/testdata/expression_rewriter_suite_out.json @@ -7,10 +7,9 @@ "Plan": [ "HashJoin 2.25 root inner join, equal:[eq(test.t1.a, test.t2.a) eq(test.t1.b, test.t2.b)]", "├─HashAgg(Build) 1.69 root group by:test.t2.a, test.t2.b, funcs:firstrow(test.t2.a)->test.t2.a, funcs:firstrow(test.t2.b)->test.t2.b", - "│ └─TableReader 1.69 root data:HashAgg", - "│ └─HashAgg 1.69 cop[tikv] group by:test.t2.a, test.t2.b, ", - "│ └─Selection 2.25 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - "│ └─TableFullScan 4.00 cop[tikv] table:t2 keep order:false", + "│ └─TableReader 2.25 root data:Selection", + "│ └─Selection 2.25 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + "│ └─TableFullScan 4.00 cop[tikv] table:t2 keep order:false", "└─TableReader(Probe) 2.25 root data:Selection", " └─Selection 2.25 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", " └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false" @@ -37,15 +36,13 @@ "Plan": [ "HashJoin 1.69 root inner join, equal:[eq(test.t2.a, test.t1.a) eq(test.t2.b, Column#7)]", "├─HashAgg(Build) 1.69 root group by:test.t2.a, test.t2.b, funcs:firstrow(test.t2.a)->test.t2.a, funcs:firstrow(test.t2.b)->test.t2.b", - "│ └─TableReader 1.69 root data:HashAgg", - "│ └─HashAgg 1.69 cop[tikv] group by:test.t2.a, test.t2.b, ", - "│ └─Selection 2.25 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", - "│ └─TableFullScan 4.00 cop[tikv] table:t2 keep order:false", - "└─HashAgg(Probe) 2.25 root group by:test.t1.a, funcs:count(Column#14)->Column#7, funcs:firstrow(test.t1.a)->test.t1.a", - " └─TableReader 2.25 root data:HashAgg", - " └─HashAgg 2.25 cop[tikv] group by:test.t1.a, funcs:count(1)->Column#14", - " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", - " └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false" + "│ └─TableReader 2.25 root data:Selection", + "│ └─Selection 2.25 cop[tikv] not(isnull(test.t2.a)), not(isnull(test.t2.b))", + "│ └─TableFullScan 4.00 cop[tikv] table:t2 keep order:false", + "└─HashAgg(Probe) 2.25 root group by:test.t1.a, funcs:count(1)->Column#7, funcs:firstrow(test.t1.a)->test.t1.a", + " └─TableReader 3.00 root data:Selection", + " └─Selection 3.00 cop[tikv] not(isnull(test.t1.a))", + " └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false" ], "Res": [ "1" @@ -57,10 +54,9 @@ "HashJoin 2.40 root CARTESIAN anti semi join, other cond:eq(Column#7, test.t2.b), eq(test.t1.a, test.t2.a)", "├─TableReader(Build) 4.00 root data:TableFullScan", "│ └─TableFullScan 4.00 cop[tikv] table:t2 keep order:false", - "└─HashAgg(Probe) 3.00 root group by:test.t1.a, funcs:count(Column#12)->Column#7, funcs:firstrow(test.t1.a)->test.t1.a", - " └─TableReader 3.00 root data:HashAgg", - " └─HashAgg 3.00 cop[tikv] group by:test.t1.a, funcs:count(1)->Column#12", - " └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false" + "└─HashAgg(Probe) 3.00 root group by:test.t1.a, funcs:count(1)->Column#7, funcs:firstrow(test.t1.a)->test.t1.a", + " └─TableReader 4.00 root data:TableFullScan", + " └─TableFullScan 4.00 cop[tikv] table:t1 keep order:false" ], "Res": [ "4" @@ -73,9 +69,9 @@ "Cases": [ { "Plan": [ - "HashAgg 1.00 root funcs:bit_or(Column#5)->Column#4", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:bit_or(cast(mul(cast(test.t.a, double BINARY), cast(test.t.b, double BINARY)), bigint(20) BINARY))->Column#5", + "StreamAgg 1.00 root funcs:bit_or(Column#6)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:bit_or(cast(mul(cast(test.t.a, double BINARY), cast(test.t.b, double BINARY)), bigint(20) BINARY))->Column#6", " └─TableFullScan 1.00 cop[tikv] table:t keep order:false" ] } diff --git a/planner/core/testdata/integration_suite_out.json b/planner/core/testdata/integration_suite_out.json index 5b03e2774dd2a..5d04f16337883 100644 --- a/planner/core/testdata/integration_suite_out.json +++ b/planner/core/testdata/integration_suite_out.json @@ -175,12 +175,12 @@ "Plan": [ "HashAgg 2.00 root group by:Column#5, funcs:firstrow(Column#5)->Column#5", "└─Union 2.00 root ", - " ├─HashAgg 1.00 root funcs:max(test.t.a)->Column#2", + " ├─StreamAgg 1.00 root funcs:max(test.t.a)->Column#2", " │ └─Limit 1.00 root offset:0, count:1", " │ └─TableReader 1.00 root data:Limit", " │ └─Limit 1.00 cop[tikv] offset:0, count:1", " │ └─TableFullScan 1.00 cop[tikv] table:t keep order:true, desc, stats:pseudo", - " └─HashAgg 1.00 root funcs:min(test.t.a)->Column#4", + " └─StreamAgg 1.00 root funcs:min(test.t.a)->Column#4", " └─Limit 1.00 root offset:0, count:1", " └─TableReader 1.00 root data:Limit", " └─Limit 1.00 cop[tikv] offset:0, count:1", @@ -191,12 +191,12 @@ "SQL": "explain format = 'brief' select min(a), max(a) from cluster_index_t", "Plan": [ "HashJoin 1.00 root CARTESIAN inner join", - "├─HashAgg(Build) 1.00 root funcs:max(test.cluster_index_t.a)->Column#5", + "├─StreamAgg(Build) 1.00 root funcs:max(test.cluster_index_t.a)->Column#5", "│ └─Limit 1.00 root offset:0, count:1", "│ └─TableReader 1.00 root data:Limit", "│ └─Limit 1.00 cop[tikv] offset:0, count:1", "│ └─TableFullScan 1.00 cop[tikv] table:cluster_index_t keep order:true, desc, stats:pseudo", - "└─HashAgg(Probe) 1.00 root funcs:min(test.cluster_index_t.a)->Column#4", + "└─StreamAgg(Probe) 1.00 root funcs:min(test.cluster_index_t.a)->Column#4", " └─Limit 1.00 root offset:0, count:1", " └─TableReader 1.00 root data:Limit", " └─Limit 1.00 cop[tikv] offset:0, count:1", @@ -207,12 +207,12 @@ "SQL": "explain format = 'brief' select min(b), max(b) from cluster_index_t where a = 1", "Plan": [ "HashJoin 1.00 root CARTESIAN inner join", - "├─HashAgg(Build) 1.00 root funcs:max(test.cluster_index_t.b)->Column#5", + "├─StreamAgg(Build) 1.00 root funcs:max(test.cluster_index_t.b)->Column#5", "│ └─Limit 1.00 root offset:0, count:1", "│ └─TableReader 1.00 root data:Limit", "│ └─Limit 1.00 cop[tikv] offset:0, count:1", "│ └─TableRangeScan 1.00 cop[tikv] table:cluster_index_t range:[1,1], keep order:true, desc, stats:pseudo", - "└─HashAgg(Probe) 1.00 root funcs:min(test.cluster_index_t.b)->Column#4", + "└─StreamAgg(Probe) 1.00 root funcs:min(test.cluster_index_t.b)->Column#4", " └─Limit 1.00 root offset:0, count:1", " └─TableReader 1.00 root data:Limit", " └─Limit 1.00 cop[tikv] offset:0, count:1", @@ -222,9 +222,9 @@ { "SQL": "explain format = 'brief' select min(a), max(a) from cluster_index_t where b = 1", "Plan": [ - "HashAgg 1.00 root funcs:min(Column#6)->Column#4, funcs:max(Column#7)->Column#5", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:min(test.cluster_index_t.a)->Column#6, funcs:max(test.cluster_index_t.a)->Column#7", + "StreamAgg 1.00 root funcs:min(Column#8)->Column#4, funcs:max(Column#9)->Column#5", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:min(test.cluster_index_t.a)->Column#8, funcs:max(test.cluster_index_t.a)->Column#9", " └─Selection 10.00 cop[tikv] eq(test.cluster_index_t.b, 1)", " └─TableFullScan 10000.00 cop[tikv] table:cluster_index_t keep order:false, stats:pseudo" ] @@ -232,9 +232,9 @@ { "SQL": "explain format = 'brief' select min(b), max(b) from cluster_index_t where b = 1", "Plan": [ - "HashAgg 1.00 root funcs:min(Column#6)->Column#4, funcs:max(Column#7)->Column#5", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:min(test.cluster_index_t.b)->Column#6, funcs:max(test.cluster_index_t.b)->Column#7", + "StreamAgg 1.00 root funcs:min(Column#8)->Column#4, funcs:max(Column#9)->Column#5", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:min(test.cluster_index_t.b)->Column#8, funcs:max(test.cluster_index_t.b)->Column#9", " └─Selection 10.00 cop[tikv] eq(test.cluster_index_t.b, 1)", " └─TableFullScan 10000.00 cop[tikv] table:cluster_index_t keep order:false, stats:pseudo" ] @@ -1723,7 +1723,7 @@ { "SQL": "select count(*) from t join (select t.id, t.value v1 from t join t t1 on t.id = t1.id order by t.value limit 1) v on v.id = t.id and v.v1 = t.value;", "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#10", + "StreamAgg 1.00 root funcs:count(1)->Column#10", "└─HashJoin 1.00 root inner join, equal:[eq(test.t.id, test.t.id) eq(test.t.value, test.t.value)]", " ├─Selection(Build) 0.80 root not(isnull(test.t.id)), not(isnull(test.t.value))", " │ └─TopN 1.00 root test.t.value, offset:0, count:1", @@ -1754,21 +1754,21 @@ { "SQL": "select count(1) from s1", "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#1", + "StreamAgg 1.00 root funcs:count(1)->Column#1", "└─TableDual 1.00 root rows:1" ] }, { "SQL": "select count(*) from s1", "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#1", + "StreamAgg 1.00 root funcs:count(1)->Column#1", "└─TableDual 1.00 root rows:1" ] }, { "SQL": "select sum(1) from s1", "Plan": [ - "HashAgg 1.00 root funcs:sum(1)->Column#1", + "StreamAgg 1.00 root funcs:sum(1)->Column#1", "└─TableDual 1.00 root rows:1" ] }, @@ -1777,9 +1777,9 @@ "Plan": [ "HashAgg 2.00 root group by:Column#3, funcs:firstrow(Column#3)->Column#3", "└─Union 2.00 root ", - " ├─HashAgg 1.00 root funcs:count(1)->Column#1", + " ├─StreamAgg 1.00 root funcs:count(1)->Column#1", " │ └─TableDual 1.00 root rows:1", - " └─HashAgg 1.00 root funcs:count(1)->Column#2", + " └─StreamAgg 1.00 root funcs:count(1)->Column#2", " └─TableDual 1.00 root rows:1" ] } @@ -2051,22 +2051,21 @@ { "SQL": "explain format = 'verbose' select * from t where b = 6 order by a limit 1", "Plan": [ - "Limit_11 0.00 98.74 root offset:0, count:1", - "└─TableReader_24 0.00 98.74 root data:Limit_23", - " └─Limit_23 0.00 1386.04 cop[tikv] offset:0, count:1", - " └─Selection_22 0.00 1386.04 cop[tikv] eq(test.t.b, 6)", - " └─TableFullScan_21 5.00 1136.54 cop[tikv] table:t keep order:true" + "TopN_9 0.00 36.63 root test.t.a, offset:0, count:1", + "└─IndexLookUp_20 0.00 31.83 root ", + " ├─TopN_19(Build) 0.00 206.70 cop[tikv] test.t.a, offset:0, count:1", + " │ └─IndexRangeScan_17 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", + " └─TableRowIDScan_18(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" ], "Warnings": null }, { "SQL": "explain format = 'verbose' select * from t where b = 6 limit 1", "Plan": [ - "Limit_8 0.00 98.74 root offset:0, count:1", - "└─TableReader_13 0.00 98.74 root data:Limit_12", - " └─Limit_12 0.00 1386.04 cop[tikv] offset:0, count:1", - " └─Selection_11 0.00 1386.04 cop[tikv] eq(test.t.b, 6)", - " └─TableFullScan_10 5.00 1136.54 cop[tikv] table:t keep order:false" + "IndexLookUp_17 0.00 18.97 root limit embedded(offset:0, count:1)", + "├─Limit_16(Build) 0.00 203.50 cop[tikv] offset:0, count:1", + "│ └─IndexRangeScan_14 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", + "└─TableRowIDScan_15(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" ], "Warnings": null }, @@ -2089,8 +2088,8 @@ { "SQL": "explain format = 'verbose' select * from t where b = 6 order by a limit 1", "Plan": [ - "TopN_9 0.00 1956.63 root test.t.a, offset:0, count:1", - "└─IndexLookUp_16 0.00 1951.83 root ", + "TopN_9 0.00 36.63 root test.t.a, offset:0, count:1", + "└─IndexLookUp_16 0.00 31.83 root ", " ├─TopN_15(Build) 0.00 206.70 cop[tikv] test.t.a, offset:0, count:1", " │ └─IndexRangeScan_13 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", " └─TableRowIDScan_14(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" @@ -2102,7 +2101,7 @@ { "SQL": "explain format = 'verbose' select * from t where b = 6 limit 1", "Plan": [ - "IndexLookUp_13 0.00 1170.97 root limit embedded(offset:0, count:1)", + "IndexLookUp_13 0.00 18.97 root limit embedded(offset:0, count:1)", "├─Limit_12(Build) 0.00 203.50 cop[tikv] offset:0, count:1", "│ └─IndexRangeScan_10 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", "└─TableRowIDScan_11(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" @@ -2344,7 +2343,7 @@ " └─Apply 10000.00 root CARTESIAN inner join, other cond:or(and(lt(test.t2.c1, Column#8), if(ne(Column#9, 0), NULL, 1)), or(eq(Column#10, 0), if(isnull(test.t2.c1), NULL, 0)))", " ├─TableReader(Build) 10000.00 root data:TableFullScan", " │ └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo", - " └─HashAgg(Probe) 10000.00 root funcs:min(test.t1.c1)->Column#8, funcs:sum(0)->Column#9, funcs:count(1)->Column#10", + " └─StreamAgg(Probe) 10000.00 root funcs:min(test.t1.c1)->Column#8, funcs:sum(0)->Column#9, funcs:count(1)->Column#10", " └─IndexMerge 30263.46 root ", " ├─Selection(Build) 33333.33 cop[tikv] eq(test.t1.c1, test.t2.c3)", " │ └─TableRangeScan 33333333.33 cop[tikv] table:t1 range:[10,+inf], keep order:false, stats:pseudo", @@ -2413,9 +2412,9 @@ { "SQL": "explain format = 'brief' select count(*) from t31240;", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#5)->Column#4", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:count(test.t31240._tidb_rowid)->Column#5", + "StreamAgg 1.00 root funcs:count(Column#6)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(test.t31240._tidb_rowid)->Column#6", " └─TableFullScan 10000.00 batchCop[tiflash] table:t31240 keep order:false, stats:pseudo" ] }, @@ -2426,9 +2425,9 @@ { "SQL": "explain format = 'brief' select count(*) from t31240;", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#5)->Column#4", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:count(test.t31240._tidb_rowid)->Column#5", + "StreamAgg 1.00 root funcs:count(Column#6)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(test.t31240._tidb_rowid)->Column#6", " └─TableFullScan 10000.00 batchCop[tiflash] table:t31240 keep order:false, stats:pseudo" ] } @@ -2485,19 +2484,19 @@ { "SQL": "explain format = 'verbose' select count(*) from t3", "Plan": [ - "HashAgg_12 1.00 77.75 root funcs:count(Column#6)->Column#4", - "└─IndexReader_13 1.00 47.49 root index:HashAgg_5", - " └─HashAgg_5 1.00 680.68 cop[tikv] funcs:count(test.t3._tidb_rowid)->Column#6", - " └─IndexFullScan_11 3.00 610.50 cop[tikv] table:t3, index:c(b) keep order:false" + "StreamAgg_20 1.00 102.69 root funcs:count(Column#9)->Column#4", + "└─IndexReader_21 1.00 52.79 root index:StreamAgg_8", + " └─StreamAgg_8 1.00 760.20 cop[tikv] funcs:count(test.t3._tidb_rowid)->Column#9", + " └─IndexFullScan_19 3.00 610.50 cop[tikv] table:t3, index:c(b) keep order:false" ] }, { "SQL": "explain format = 'verbose' select count(*) from t2", "Plan": [ - "HashAgg_14 1.00 82.51 root funcs:count(Column#5)->Column#4", - "└─TableReader_15 1.00 52.25 root data:HashAgg_6", - " └─HashAgg_6 1.00 752.10 cop[tikv] funcs:count(test.t2._tidb_rowid)->Column#5", - " └─TableFullScan_12 3.00 681.92 cop[tikv] table:t2 keep order:false" + "StreamAgg_26 1.00 107.45 root funcs:count(Column#7)->Column#4", + "└─TableReader_27 1.00 57.55 root data:StreamAgg_10", + " └─StreamAgg_10 1.00 831.62 cop[tikv] funcs:count(test.t2._tidb_rowid)->Column#7", + " └─TableFullScan_24 3.00 681.92 cop[tikv] table:t2 keep order:false" ] }, { @@ -2528,16 +2527,18 @@ { "SQL": "explain format = 'verbose' select * from t3 order by b limit 1", "Plan": [ - "TopN_7 1.00 53.10 root test.t3.b, offset:0, count:1", - "└─TableReader_16 1.00 49.90 root data:TopN_15", - " └─TopN_15 1.00 685.12 cop[tikv] test.t3.b, offset:0, count:1", - " └─TableFullScan_14 3.00 681.92 cop[tikv] table:t3 keep order:false" + "Limit_12 1.00 19.17 root offset:0, count:1", + "└─Projection_23 1.00 19.17 root test.t3.a, test.t3.b", + " └─IndexLookUp_22 1.00 18.97 root ", + " ├─Limit_21(Build) 1.00 203.50 cop[tikv] offset:0, count:1", + " │ └─IndexFullScan_19 1.00 203.50 cop[tikv] table:t3, index:c(b) keep order:true", + " └─TableRowIDScan_20(Probe) 1.00 186.61 cop[tikv] table:t3 keep order:false" ] }, { "SQL": "explain format = 'verbose' select count(*) from t2 group by a", "Plan": [ - "HashAgg_8 3.00 209.09 root group by:test.t2.a, funcs:count(1)->Column#4", + "HashAgg_8 3.00 1706.09 root group by:test.t2.a, funcs:count(1)->Column#4", "└─TableReader_17 3.00 58.13 root data:TableFullScan_16", " └─TableFullScan_16 3.00 681.92 cop[tikv] table:t2 keep order:false" ] @@ -2545,37 +2546,34 @@ { "SQL": "explain format = 'verbose' select count(*) from t3 where b = 0", "Plan": [ - "HashAgg_12 1.00 45.24 root funcs:count(Column#5)->Column#4", - "└─IndexReader_13 1.00 14.98 root index:HashAgg_6", - " └─HashAgg_6 1.00 193.06 cop[tikv] funcs:count(1)->Column#5", - " └─IndexRangeScan_11 0.00 162.80 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false" + "StreamAgg_10 1.00 64.98 root funcs:count(1)->Column#4", + "└─IndexReader_15 0.00 15.08 root index:IndexRangeScan_14", + " └─IndexRangeScan_14 0.00 162.80 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false" ] }, { "SQL": "explain format = 'verbose' select /*+ use_index(t3, c) */ count(a) from t3 where b = 0", "Plan": [ - "HashAgg_13 1.00 1981.96 root funcs:count(Column#6)->Column#4", - "└─IndexLookUp_14 1.00 1951.70 root ", - " ├─IndexRangeScan_11(Build) 0.00 203.50 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false", - " └─HashAgg_7(Probe) 1.00 257.57 cop[tikv] funcs:count(test.t3.a)->Column#6", - " └─TableRowIDScan_12 0.00 227.31 cop[tikv] table:t3 keep order:false" + "StreamAgg_10 1.00 81.63 root funcs:count(test.t3.a)->Column#4", + "└─IndexLookUp_17 0.00 31.73 root ", + " ├─IndexRangeScan_15(Build) 0.00 203.50 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false", + " └─TableRowIDScan_16(Probe) 0.00 227.31 cop[tikv] table:t3 keep order:false" ] }, { "SQL": "explain format = 'verbose' select count(*) from t2 where a = 0", "Plan": [ - "HashAgg_17 1.00 89.83 root funcs:count(Column#5)->Column#4", - "└─TableReader_18 1.00 59.57 root data:HashAgg_7", - " └─HashAgg_7 1.00 861.88 cop[tikv] funcs:count(1)->Column#5", - " └─Selection_14 0.00 831.62 cop[tikv] eq(test.t2.a, 0)", - " └─TableFullScan_13 3.00 681.92 cop[tikv] table:t2 keep order:false" + "StreamAgg_12 1.00 109.57 root funcs:count(1)->Column#4", + "└─TableReader_21 0.00 59.67 root data:Selection_20", + " └─Selection_20 0.00 831.62 cop[tikv] eq(test.t2.a, 0)", + " └─TableFullScan_19 3.00 681.92 cop[tikv] table:t2 keep order:false" ] }, { "SQL": "explain format = 'verbose' select count(*) from t3 t join t3 on t.a = t3.b", "Plan": [ - "HashAgg_9 1.00 552.41 root funcs:count(1)->Column#7", - "└─HashJoin_22 3.00 482.23 root inner join, equal:[eq(test.t3.a, test.t3.b)]", + "StreamAgg_10 1.00 2128.93 root funcs:count(1)->Column#7", + "└─HashJoin_40 3.00 1979.23 root inner join, equal:[eq(test.t3.a, test.t3.b)]", " ├─IndexReader_28(Build) 3.00 45.23 root index:IndexFullScan_27", " │ └─IndexFullScan_27 3.00 488.40 cop[tikv] table:t3, index:c(b) keep order:false", " └─TableReader_26(Probe) 3.00 68.11 root data:Selection_25", @@ -2586,24 +2584,23 @@ { "SQL": "explain format = 'verbose' select /*+ read_from_storage(tiflash[t1, t2]) */ count(*) from t1 join t2 on t1.a = t2.a", "Plan": [ - "HashAgg_34 1.00 61928.14 root funcs:count(Column#8)->Column#7", - "└─TableReader_36 1.00 61897.88 root data:ExchangeSender_35", - " └─ExchangeSender_35 1.00 928450.64 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg_13 1.00 928450.64 mpp[tiflash] funcs:count(1)->Column#8", - " └─HashJoin_33 3.00 928447.20 mpp[tiflash] inner join, equal:[eq(test.t1.a, test.t2.a)]", - " ├─ExchangeReceiver_22(Build) 3.00 464290.40 mpp[tiflash] ", - " │ └─ExchangeSender_21 3.00 464146.40 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection_20 3.00 464146.40 mpp[tiflash] not(isnull(test.t1.a))", - " │ └─TableFullScan_19 3.00 464139.20 mpp[tiflash] table:t1 keep order:false", - " └─Selection_24(Probe) 3.00 464146.40 mpp[tiflash] not(isnull(test.t2.a))", - " └─TableFullScan_23 3.00 464139.20 mpp[tiflash] table:t2 keep order:false" + "StreamAgg_15 1.00 62053.22 root funcs:count(1)->Column#7", + "└─TableReader_41 3.00 61903.52 root data:ExchangeSender_40", + " └─ExchangeSender_40 3.00 928447.20 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin_37 3.00 928447.20 mpp[tiflash] inner join, equal:[eq(test.t1.a, test.t2.a)]", + " ├─ExchangeReceiver_22(Build) 3.00 464290.40 mpp[tiflash] ", + " │ └─ExchangeSender_21 3.00 464146.40 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection_20 3.00 464146.40 mpp[tiflash] not(isnull(test.t1.a))", + " │ └─TableFullScan_19 3.00 464139.20 mpp[tiflash] table:t1 keep order:false", + " └─Selection_24(Probe) 3.00 464146.40 mpp[tiflash] not(isnull(test.t2.a))", + " └─TableFullScan_23 3.00 464139.20 mpp[tiflash] table:t2 keep order:false" ] }, { "SQL": "explain format = 'verbose' select /*+ read_from_storage(tiflash[t1, t2]) */ count(*) from t1 join t2 on t1.a = t2.a join t3 on t1.b = t3.b", "Plan": [ - "HashAgg_14 1.00 70137.12 root funcs:count(1)->Column#10", - "└─HashJoin_27 3.00 70066.94 root inner join, equal:[eq(test.t1.b, test.t3.b)]", + "StreamAgg_15 1.00 71713.64 root funcs:count(1)->Column#10", + "└─HashJoin_59 3.00 71563.94 root inner join, equal:[eq(test.t1.b, test.t3.b)]", " ├─IndexReader_47(Build) 3.00 45.23 root index:IndexFullScan_46", " │ └─IndexFullScan_46 3.00 488.40 cop[tikv] table:t3, index:c(b) keep order:false", " └─TableReader_39(Probe) 3.00 69652.83 root data:ExchangeSender_38", @@ -2620,13 +2617,12 @@ { "SQL": "explain format = 'verbose' select (2) in (select /*+ read_from_storage(tiflash[t1]) */ count(*) from t1) from (select t.b < (select /*+ read_from_storage(tiflash[t2]) */ t.b from t2 limit 1 ) from t3 t) t", "Plan": [ - "HashJoin_19 3.00 160743.93 root CARTESIAN left outer semi join", - "├─Selection_38(Build) 0.80 31024.18 root eq(2, Column#18)", - "│ └─HashAgg_52 1.00 30974.28 root funcs:count(Column#31)->Column#18", - "│ └─TableReader_54 1.00 30944.02 root data:ExchangeSender_53", - "│ └─ExchangeSender_53 1.00 464142.64 mpp[tiflash] ExchangeType: PassThrough", - "│ └─HashAgg_43 1.00 464142.64 mpp[tiflash] funcs:count(test.t1._tidb_rowid)->Column#31", - "│ └─TableFullScan_51 3.00 464139.20 mpp[tiflash] table:t1 keep order:false", + "HashJoin_19 3.00 162261.76 root CARTESIAN left outer semi join", + "├─Selection_38(Build) 0.80 31045.01 root eq(2, Column#18)", + "│ └─StreamAgg_56 1.00 30995.11 root funcs:count(Column#32)->Column#18", + "│ └─TableReader_57 1.00 30945.21 root data:StreamAgg_44", + "│ └─StreamAgg_44 1.00 464146.40 batchCop[tiflash] funcs:count(test.t1._tidb_rowid)->Column#32", + "│ └─TableFullScan_55 3.00 464139.20 batchCop[tiflash] table:t1 keep order:false", "└─Projection_20(Probe) 3.00 129648.62 root 1->Column#28", " └─Apply_22 3.00 129648.32 root CARTESIAN left outer join", " ├─IndexReader_26(Build) 3.00 53.37 root index:IndexFullScan_25", @@ -2642,8 +2638,8 @@ { "SQL": "explain format = 'verbose' select /*+ merge_join(t1), read_from_storage(tiflash[t1, t2]) */ count(*) from t1 join t2 on t1.a = t2.a", "Plan": [ - "HashAgg_11 1.00 62478.44 root funcs:count(1)->Column#7", - "└─MergeJoin_16 3.00 62408.26 root inner join, left key:test.t1.a, right key:test.t2.a", + "StreamAgg_14 1.00 62557.96 root funcs:count(1)->Column#7", + "└─MergeJoin_26 3.00 62408.26 root inner join, left key:test.t1.a, right key:test.t2.a", " ├─Sort_24(Build) 3.00 31202.63 root test.t2.a", " │ └─TableReader_23 3.00 30955.77 root data:Selection_22", " │ └─Selection_22 3.00 464146.40 cop[tiflash] not(isnull(test.t2.a))", @@ -2903,7 +2899,7 @@ { "SQL": "explain format = 'brief' select max(a) from t", "Plan": [ - "HashAgg 1.00 root funcs:max(test.t.a)->Column#3", + "StreamAgg 1.00 root funcs:max(test.t.a)->Column#3", "└─TopN 1.00 root test.t.a:desc, offset:0, count:1", " └─TableReader 1.00 root data:TopN", " └─TopN 1.00 batchCop[tiflash] test.t.a:desc, offset:0, count:1", @@ -2913,7 +2909,7 @@ { "SQL": "explain format = 'brief' select min(a) from t", "Plan": [ - "HashAgg 1.00 root funcs:min(test.t.a)->Column#3", + "StreamAgg 1.00 root funcs:min(test.t.a)->Column#3", "└─Limit 1.00 root offset:0, count:1", " └─TableReader 1.00 root data:Limit", " └─Limit 1.00 cop[tiflash] offset:0, count:1", @@ -2928,7 +2924,7 @@ { "SQL": "explain format = 'brief' select max(a) from t", "Plan": [ - "HashAgg 1.00 root funcs:max(test.t.a)->Column#3", + "StreamAgg 1.00 root funcs:max(test.t.a)->Column#3", "└─TopN 1.00 root test.t.a:desc, offset:0, count:1", " └─TableReader 1.00 root data:TopN", " └─TopN 1.00 batchCop[tiflash] test.t.a:desc, offset:0, count:1", @@ -2938,7 +2934,7 @@ { "SQL": "explain format = 'brief' select min(a) from t", "Plan": [ - "HashAgg 1.00 root funcs:min(test.t.a)->Column#3", + "StreamAgg 1.00 root funcs:min(test.t.a)->Column#3", "└─TopN 1.00 root test.t.a, offset:0, count:1", " └─TableReader 1.00 root data:TopN", " └─TopN 1.00 batchCop[tiflash] test.t.a, offset:0, count:1", @@ -2953,322 +2949,301 @@ { "SQL": "explain format = 'brief' select count(*) from fact_t, d1_t where fact_t.d1_k = d1_t.d1_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t, d1_t, d2_t, d3_t where fact_t.d1_k = d1_t.d1_k and fact_t.d2_k = d2_t.d2_k and fact_t.d3_k = d3_t.d3_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#18)->Column#17", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#18", - " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.fact_t.d3_k, test.d3_t.d3_k)]", + "StreamAgg 1.00 root funcs:count(1)->Column#17", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.fact_t.d3_k, test.d3_t.d3_k)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d3_t.d3_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d3_t keep order:false", + " └─HashJoin(Probe) 8.00 mpp[tiflash] inner join, equal:[eq(test.fact_t.d2_k, test.d2_t.d2_k)]", " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d3_t.d3_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d3_t keep order:false", - " └─HashJoin(Probe) 8.00 mpp[tiflash] inner join, equal:[eq(test.fact_t.d2_k, test.d2_t.d2_k)]", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d2_t.d2_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d2_t keep order:false", + " └─HashJoin(Probe) 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d2_t.d2_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d2_t keep order:false", - " └─HashJoin(Probe) 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k)), not(isnull(test.fact_t.d2_k)), not(isnull(test.fact_t.d3_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k)), not(isnull(test.fact_t.d2_k)), not(isnull(test.fact_t.d3_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t, d1_t where fact_t.d1_k = d1_t.d1_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t left join d1_t on fact_t.d1_k = d1_t.d1_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t right join d1_t on fact_t.d1_k = d1_t.d1_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", - " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", - " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", - " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", + " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", + " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", + " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t join d1_t on fact_t.d1_k = d1_t.d1_k and fact_t.col1 > d1_t.value", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)], other cond:gt(test.fact_t.col1, test.d1_t.value)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)], other cond:gt(test.fact_t.col1, test.d1_t.value)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t left join d1_t on fact_t.d1_k = d1_t.d1_k and fact_t.col1 > 10", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], left cond:[gt(test.fact_t.col1, 10)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], left cond:[gt(test.fact_t.col1, 10)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t left join d1_t on fact_t.d1_k = d1_t.d1_k and fact_t.col2 > 10 and fact_t.col1 > d1_t.value", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], left cond:[gt(test.fact_t.col2, 10)], other cond:gt(test.fact_t.col1, test.d1_t.value)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], left cond:[gt(test.fact_t.col2, 10)], other cond:gt(test.fact_t.col1, test.d1_t.value)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t right join d1_t on fact_t.d1_k = d1_t.d1_k and d1_t.value > 10", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], right cond:gt(test.d1_t.value, 10)", - " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", - " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", - " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], right cond:gt(test.d1_t.value, 10)", + " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", + " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", + " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t right join d1_t on fact_t.d1_k = d1_t.d1_k and d1_t.value > 10 and fact_t.col1 > d1_t.value", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 8.00 mpp[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], right cond:gt(test.d1_t.value, 10), other cond:gt(test.fact_t.col1, test.d1_t.value)", - " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", - " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", - " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", - " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], right cond:gt(test.d1_t.value, 10), other cond:gt(test.fact_t.col1, test.d1_t.value)", + " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", + " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", + " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", + " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where exists (select 1 from d1_t where d1_k = fact_t.d1_k)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 6.40 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 6.40 root data:ExchangeSender", + " └─ExchangeSender 6.40 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 6.40 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where exists (select 1 from d1_t where d1_k = fact_t.d1_k and value > fact_t.col1)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 6.40 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 6.40 root data:ExchangeSender", + " └─ExchangeSender 6.40 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 6.40 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where exists (select /*+ SEMI_JOIN_REWRITE() */ 1 from d1_t where d1_k = fact_t.d1_k)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#17)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#17", - " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Projection 2.00 mpp[tiflash] test.d1_t.d1_k", - " │ └─HashAgg 2.00 mpp[tiflash] group by:test.d1_t.d1_k, funcs:firstrow(test.d1_t.d1_k)->test.d1_t.d1_k", - " │ └─ExchangeReceiver 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", - " │ └─HashAgg 2.00 mpp[tiflash] group by:test.d1_t.d1_k, ", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 8.00 root data:ExchangeSender", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 8.00 mpp[tiflash] inner join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Projection 2.00 mpp[tiflash] test.d1_t.d1_k", + " │ └─HashAgg 2.00 mpp[tiflash] group by:test.d1_t.d1_k, funcs:firstrow(test.d1_t.d1_k)->test.d1_t.d1_k", + " │ └─ExchangeReceiver 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where exists (select /*+ SEMI_JOIN_REWRITE() */ 1 from d1_t where d1_k = fact_t.d1_k and value > fact_t.col1)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 6.40 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 6.40 root data:ExchangeSender", + " └─ExchangeSender 6.40 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 6.40 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where not exists (select 1 from d1_t where d1_k = fact_t.d1_k)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 6.40 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 6.40 root data:ExchangeSender", + " └─ExchangeSender 6.40 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 6.40 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where not exists (select 1 from d1_t where d1_k = fact_t.d1_k and value > fact_t.col1)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 6.40 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 6.40 root data:ExchangeSender", + " └─ExchangeSender 6.40 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 6.40 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t join d1_t on fact_t.d1_k > d1_t.d1_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 16.00 mpp[tiflash] CARTESIAN inner join, other cond:gt(test.fact_t.d1_k, test.d1_t.d1_k)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 16.00 root data:ExchangeSender", + " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 16.00 mpp[tiflash] CARTESIAN inner join, other cond:gt(test.fact_t.d1_k, test.d1_t.d1_k)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─Selection(Probe) 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t left join d1_t on fact_t.d1_k > d1_t.d1_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 16.00 mpp[tiflash] CARTESIAN left outer join, other cond:gt(test.fact_t.d1_k, test.d1_t.d1_k)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 16.00 root data:ExchangeSender", + " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 16.00 mpp[tiflash] CARTESIAN left outer join, other cond:gt(test.fact_t.d1_k, test.d1_t.d1_k)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 2.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t right join d1_t on fact_t.d1_k > d1_t.d1_k", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 16.00 mpp[tiflash] CARTESIAN right outer join, other cond:gt(test.fact_t.d1_k, test.d1_t.d1_k)", - " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", - " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", - " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 16.00 root data:ExchangeSender", + " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 16.00 mpp[tiflash] CARTESIAN right outer join, other cond:gt(test.fact_t.d1_k, test.d1_t.d1_k)", + " ├─ExchangeReceiver(Build) 8.00 mpp[tiflash] ", + " │ └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 8.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " │ └─TableFullScan 8.00 mpp[tiflash] table:fact_t keep order:false", + " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:d1_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where d1_k not in (select d1_k from d1_t)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#12)->Column#11", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#12", - " └─HashJoin 6.40 mpp[tiflash] CARTESIAN anti semi join, other cond:eq(test.fact_t.d1_k, test.d1_t.d1_k)", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", - " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#11", + "└─TableReader 6.40 root data:ExchangeSender", + " └─ExchangeSender 6.40 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 6.40 mpp[tiflash] CARTESIAN anti semi join, other cond:eq(test.fact_t.d1_k, test.d1_t.d1_k)", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─TableFullScan 2.00 mpp[tiflash] table:d1_t keep order:false", + " └─TableFullScan(Probe) 8.00 mpp[tiflash] table:fact_t keep order:false" ] } ] @@ -3517,31 +3492,29 @@ { "SQL": "explain format = 'brief' select count(*) from a left join b on a.id = b.id", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#8)->Column#7", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#8", - " └─HashJoin 2.00 mpp[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", - " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", - " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", - " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", - " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:a keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#7", + "└─TableReader 2.00 root data:ExchangeSender", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 2.00 mpp[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", + " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", + " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", + " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", + " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:a keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from b right join a on a.id = b.id", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#8)->Column#7", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#8", - " └─HashJoin 2.00 mpp[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", - " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", - " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: Broadcast", - " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", - " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", - " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:a keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#7", + "└─TableReader 2.00 root data:ExchangeSender", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 2.00 mpp[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", + " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", + " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: Broadcast", + " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", + " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", + " └─TableFullScan(Probe) 2.00 mpp[tiflash] table:a keep order:false" ] } ] @@ -3552,35 +3525,33 @@ { "SQL": "explain format = 'brief' select count(*) from a left join b on a.id = b.id", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#8)->Column#7", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#8", - " └─HashJoin 2.00 mpp[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", - " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", - " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", - " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", - " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", - " └─ExchangeReceiver(Probe) 2.00 mpp[tiflash] ", - " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", - " └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#7", + "└─TableReader 2.00 root data:ExchangeSender", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 2.00 mpp[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", + " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", + " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", + " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", + " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", + " └─ExchangeReceiver(Probe) 2.00 mpp[tiflash] ", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", + " └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from b right join a on a.id = b.id", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#8)->Column#7", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#8", - " └─HashJoin 2.00 mpp[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", - " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", - " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", - " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", - " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", - " └─ExchangeReceiver(Probe) 2.00 mpp[tiflash] ", - " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", - " └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#7", + "└─TableReader 2.00 root data:ExchangeSender", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 2.00 mpp[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", + " ├─ExchangeReceiver(Build) 3.00 mpp[tiflash] ", + " │ └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", + " │ └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", + " │ └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false", + " └─ExchangeReceiver(Probe) 2.00 mpp[tiflash] ", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", + " └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false" ] } ] @@ -3591,35 +3562,33 @@ { "SQL": "explain format = 'brief' select count(*) from a left join b on a.id = b.id", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#8)->Column#7", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#8", - " └─HashJoin 2.00 mpp[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", - " │ └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false", - " └─ExchangeReceiver(Probe) 3.00 mpp[tiflash] ", - " └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", - " └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", - " └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#7", + "└─TableReader 2.00 root data:ExchangeSender", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 2.00 mpp[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", + " │ └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false", + " └─ExchangeReceiver(Probe) 3.00 mpp[tiflash] ", + " └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", + " └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", + " └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from b right join a on a.id = b.id", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#8)->Column#7", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#8", - " └─HashJoin 2.00 mpp[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", - " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", - " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", - " │ └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false", - " └─ExchangeReceiver(Probe) 3.00 mpp[tiflash] ", - " └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", - " └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", - " └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#7", + "└─TableReader 2.00 root data:ExchangeSender", + " └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 2.00 mpp[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", + " ├─ExchangeReceiver(Build) 2.00 mpp[tiflash] ", + " │ └─ExchangeSender 2.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", + " │ └─TableFullScan 2.00 mpp[tiflash] table:a keep order:false", + " └─ExchangeReceiver(Probe) 3.00 mpp[tiflash] ", + " └─ExchangeSender 3.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", + " └─Selection 3.00 mpp[tiflash] not(isnull(test.b.id))", + " └─TableFullScan 3.00 mpp[tiflash] table:b keep order:false" ] } ] @@ -3871,69 +3840,65 @@ { "SQL": "explain format = 'brief' select count(*) from fact_t where exists (select 1 from d1_t where d1_k = fact_t.d1_k)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 12.80 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", - " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", - " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", - " │ └─Selection 4.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", - " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", - " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", - " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", - " └─Selection 16.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 12.80 root data:ExchangeSender", + " └─ExchangeSender 12.80 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 12.80 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", + " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", + " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", + " │ └─Selection 4.00 mpp[tiflash] not(isnull(test.d1_t.d1_k))", + " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", + " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", + " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", + " └─Selection 16.00 mpp[tiflash] not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where exists (select 1 from d1_t where d1_k = fact_t.d1_k and value > fact_t.col1)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 12.80 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", - " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", - " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", - " │ └─Selection 4.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", - " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", - " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", - " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", - " └─Selection 16.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", - " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 12.80 root data:ExchangeSender", + " └─ExchangeSender 12.80 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 12.80 mpp[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", + " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", + " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", + " │ └─Selection 4.00 mpp[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", + " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", + " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", + " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", + " └─Selection 16.00 mpp[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", + " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where not exists (select 1 from d1_t where d1_k = fact_t.d1_k)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 12.80 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", - " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", - " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", - " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", - " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", - " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", - " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 12.80 root data:ExchangeSender", + " └─ExchangeSender 12.80 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 12.80 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", + " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", + " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", + " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", + " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", + " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", + " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" ] }, { "SQL": "explain format = 'brief' select count(*) from fact_t where not exists (select 1 from d1_t where d1_k = fact_t.d1_k and value > fact_t.col1)", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#13)->Column#12", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(1)->Column#13", - " └─HashJoin 12.80 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", - " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", - " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", - " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", - " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", - " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", - " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" + "StreamAgg 1.00 root funcs:count(1)->Column#12", + "└─TableReader 12.80 root data:ExchangeSender", + " └─ExchangeSender 12.80 mpp[tiflash] ExchangeType: PassThrough", + " └─HashJoin 12.80 mpp[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", + " ├─ExchangeReceiver(Build) 4.00 mpp[tiflash] ", + " │ └─ExchangeSender 4.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", + " │ └─TableFullScan 4.00 mpp[tiflash] table:d1_t keep order:false", + " └─ExchangeReceiver(Probe) 16.00 mpp[tiflash] ", + " └─ExchangeSender 16.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", + " └─TableFullScan 16.00 mpp[tiflash] table:fact_t keep order:false" ] } ] @@ -3992,18 +3957,17 @@ "TableReader 1.00 root data:ExchangeSender", "└─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", " └─Projection 1.00 mpp[tiflash] Column#9, test.t2.v1, test.t2.v2", - " └─HashAgg 1.00 mpp[tiflash] group by:test.t2.v1, test.t2.v2, funcs:sum(Column#16)->Column#9, funcs:firstrow(test.t2.v1)->test.t2.v1, funcs:firstrow(test.t2.v2)->test.t2.v2", + " └─HashAgg 1.00 mpp[tiflash] group by:test.t2.v1, test.t2.v2, funcs:count(1)->Column#9, funcs:firstrow(test.t2.v1)->test.t2.v1, funcs:firstrow(test.t2.v2)->test.t2.v2", " └─ExchangeReceiver 1.00 mpp[tiflash] ", " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: binary], [name: test.t2.v2, collate: binary]", - " └─HashAgg 1.00 mpp[tiflash] group by:test.t2.v1, test.t2.v2, funcs:count(1)->Column#16", - " └─HashJoin 1.00 mpp[tiflash] left outer join, equal:[eq(test.t3.v1, test.t2.v1) eq(test.t3.v2, test.t2.v2)]", - " ├─ExchangeReceiver(Build) 1.00 mpp[tiflash] ", - " │ └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t3.v1, collate: binary], [name: test.t3.v2, collate: binary]", - " │ └─TableFullScan 1.00 mpp[tiflash] table:t3 keep order:false", - " └─ExchangeReceiver(Probe) 8.00 mpp[tiflash] ", - " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: binary], [name: test.t2.v2, collate: binary]", - " └─Selection 8.00 mpp[tiflash] not(isnull(test.t2.v1)), not(isnull(test.t2.v2))", - " └─TableFullScan 8.00 mpp[tiflash] table:t2 keep order:false" + " └─HashJoin 1.00 mpp[tiflash] left outer join, equal:[eq(test.t3.v1, test.t2.v1) eq(test.t3.v2, test.t2.v2)]", + " ├─ExchangeReceiver(Build) 1.00 mpp[tiflash] ", + " │ └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t3.v1, collate: binary], [name: test.t3.v2, collate: binary]", + " │ └─TableFullScan 1.00 mpp[tiflash] table:t3 keep order:false", + " └─ExchangeReceiver(Probe) 8.00 mpp[tiflash] ", + " └─ExchangeSender 8.00 mpp[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: binary], [name: test.t2.v2, collate: binary]", + " └─Selection 8.00 mpp[tiflash] not(isnull(test.t2.v1)), not(isnull(test.t2.v2))", + " └─TableFullScan 8.00 mpp[tiflash] table:t2 keep order:false" ] } ] @@ -4236,9 +4200,9 @@ { "SQL": "desc format = 'brief' select /*+ read_from_storage(tiflash[t]) */ sum(a) from t", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#5)->Column#4", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#7)->Column#5", + "StreamAgg 1.00 root funcs:sum(Column#6)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(Column#7)->Column#6", " └─Projection 10000.00 batchCop[tiflash] cast(test.t.a, decimal(10,0) BINARY)->Column#7", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ], @@ -4247,9 +4211,9 @@ { "SQL": "desc format = 'brief' select /*+ read_from_storage(tiflash[t]) */ sum(a+1) from t", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#5)->Column#4", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#7)->Column#5", + "StreamAgg 1.00 root funcs:sum(Column#6)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(Column#7)->Column#6", " └─Projection 10000.00 batchCop[tiflash] cast(plus(test.t.a, 1), decimal(20,0) BINARY)->Column#7", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ], @@ -4258,9 +4222,9 @@ { "SQL": "desc format = 'brief' select /*+ read_from_storage(tiflash[t]) */ sum(isnull(a)) from t", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#5)->Column#4", - "└─TableReader 1.00 root data:HashAgg", - " └─HashAgg 1.00 batchCop[tiflash] funcs:sum(Column#7)->Column#5", + "StreamAgg 1.00 root funcs:sum(Column#6)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(Column#7)->Column#6", " └─Projection 10000.00 batchCop[tiflash] cast(isnull(test.t.a), decimal(20,0) BINARY)->Column#7", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ], @@ -6096,9 +6060,9 @@ " ├─TableReader(Build) 10000.00 root data:TableFullScan", " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", " └─MaxOneRow(Probe) 10000.00 root ", - " └─HashAgg 10000.00 root funcs:sum(Column#8)->Column#7", - " └─TableReader 10000.00 root data:HashAgg", - " └─HashAgg 10000.00 cop[tikv] funcs:sum(test.t2.a)->Column#8", + " └─StreamAgg 10000.00 root funcs:sum(Column#9)->Column#7", + " └─TableReader 10000.00 root data:StreamAgg", + " └─StreamAgg 10000.00 cop[tikv] funcs:sum(test.t2.a)->Column#9", " └─Selection 100000.00 cop[tikv] eq(test.t2.b, test.t1.b)", " └─TableFullScan 100000000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" ], @@ -6151,12 +6115,11 @@ { "SQL": "explain format = 'brief' select /*+ qb_name(qb_v9, v9), AGG_TO_COP(@qb_v9) */ * from v9;", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#6)->Column#4", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:sum(Column#9)->Column#6", - " └─Projection 10000.00 mpp[tiflash] cast(test.t.a, decimal(10,0) BINARY)->Column#9", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:sum(Column#7)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(Column#9)->Column#7", + " └─Projection 10000.00 batchCop[tiflash] cast(test.t.a, decimal(10,0) BINARY)->Column#9", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ], "Warn": null }, @@ -6710,33 +6673,30 @@ { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#18)->Column#14", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(Column#19)->Column#18", - " └─Projection 10000.00 mpp[tiflash] plus(test.t.id, 1)->Column#19", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:count(Column#16)->Column#14", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(Column#19)->Column#16", + " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#19", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(*) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#17)->Column#14", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(test.t._tidb_rowid)->Column#17", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:count(Column#15)->Column#14", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(test.t._tidb_rowid)->Column#15", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ sum(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#18)->Column#14", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:sum(Column#19)->Column#18", - " └─Projection 10000.00 mpp[tiflash] cast(plus(test.t.id, 1), decimal(20,0) BINARY)->Column#19", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:sum(Column#16)->Column#14", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(Column#19)->Column#16", + " └─Projection 10000.00 batchCop[tiflash] cast(plus(test.t.id, 1), decimal(20,0) BINARY)->Column#19", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -7046,33 +7006,30 @@ { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#10)->Column#6", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(Column#11)->Column#10", - " └─Projection 10000.00 mpp[tiflash] plus(test.t.id, 1)->Column#11", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:count(Column#8)->Column#6", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(Column#11)->Column#8", + " └─Projection 10000.00 batchCop[tiflash] plus(test.t.id, 1)->Column#11", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ count(*) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#9)->Column#6", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(test.t._tidb_rowid)->Column#9", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:count(Column#7)->Column#6", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(test.t._tidb_rowid)->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { "SQL": "desc format = 'brief' select /*+ stream_agg()*/ sum(b) from (select id + 1 as b from t)A", "Plan": [ - "HashAgg 1.00 root funcs:sum(Column#10)->Column#6", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:sum(Column#11)->Column#10", - " └─Projection 10000.00 mpp[tiflash] cast(plus(test.t.id, 1), decimal(20,0) BINARY)->Column#11", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:sum(Column#8)->Column#6", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:sum(Column#11)->Column#8", + " └─Projection 10000.00 batchCop[tiflash] cast(plus(test.t.id, 1), decimal(20,0) BINARY)->Column#11", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -7295,7 +7252,7 @@ { "SQL": "explain format = 'brief' select count(*) from (select a , b from t where false union all select a , c from t1 where false) tt", "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#11", + "StreamAgg 1.00 root funcs:count(1)->Column#11", "└─Union 0.00 root ", " ├─Projection 0.00 root test.t.a, cast(test.t.b, double BINARY)->Column#10", " │ └─TableDual 0.00 root rows:0", @@ -7545,11 +7502,10 @@ { "SQL": "desc format = 'brief' select count(*) from t", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#6)->Column#4", - "└─TableReader 1.00 root data:ExchangeSender", - " └─ExchangeSender 1.00 mpp[tiflash] ExchangeType: PassThrough", - " └─HashAgg 1.00 mpp[tiflash] funcs:count(test.t._tidb_rowid)->Column#6", - " └─TableFullScan 10000.00 mpp[tiflash] table:t keep order:false, stats:pseudo" + "StreamAgg 1.00 root funcs:count(Column#7)->Column#4", + "└─TableReader 1.00 root data:StreamAgg", + " └─StreamAgg 1.00 batchCop[tiflash] funcs:count(test.t._tidb_rowid)->Column#7", + " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] }, { @@ -8076,7 +8032,7 @@ { "SQL": "desc format = 'brief' select count(*) from (select t.id, t.value v1 from t join t t1 on t.id = t1.id order by t.value limit 20) v group by v.v1", "Plan": [ - "HashAgg 20.00 root group by:test.t.value, funcs:count(1)->Column#7", + "StreamAgg 20.00 root group by:test.t.value, funcs:count(1)->Column#7", "└─TopN 20.00 root test.t.value, offset:0, count:20", " └─TableReader 20.00 root data:ExchangeSender", " └─ExchangeSender 20.00 mpp[tiflash] ExchangeType: PassThrough", @@ -9527,9 +9483,9 @@ { "SQL": "select count(1) from t1 where c1 = '0xfff' and c2 is not null", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#6)->Column#5", - "└─IndexReader 1.00 root index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#6", + "StreamAgg 1.00 root funcs:count(Column#7)->Column#5", + "└─IndexReader 1.00 root index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#7", " └─IndexRangeScan 99.90 cop[tikv] table:t1, index:idx2(c1, c2) range:[\"0xfff\" -inf,\"0xfff\" +inf], keep order:false, stats:pseudo" ], "Result": [ @@ -9563,9 +9519,9 @@ { "SQL": "select count(1) from t1 where c1 >= '0xfff' and c2 is null", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#6)->Column#5", - "└─IndexReader 1.00 root index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#6", + "StreamAgg 1.00 root funcs:count(Column#7)->Column#5", + "└─IndexReader 1.00 root index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#7", " └─Selection 3.33 cop[tikv] isnull(test.t1.c2)", " └─IndexRangeScan 3333.33 cop[tikv] table:t1, index:idx2(c1, c2) range:[\"0xfff\",+inf], keep order:false, stats:pseudo" ], @@ -9576,12 +9532,11 @@ { "SQL": "select count(1) from t1 where c1 = '0xfff' and (c2 + 1) is not null", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#9)->Column#5", - "└─IndexLookUp 1.00 root ", + "StreamAgg 1.00 root funcs:count(1)->Column#5", + "└─IndexLookUp 8.00 root ", " ├─IndexRangeScan(Build) 10.00 cop[tikv] table:t1, index:idx1(c1) range:[\"0xfff\",\"0xfff\"], keep order:false, stats:pseudo", - " └─HashAgg(Probe) 1.00 cop[tikv] funcs:count(1)->Column#9", - " └─Selection 8.00 cop[tikv] not(isnull(plus(cast(test.t1.c2, double BINARY), 1)))", - " └─TableRowIDScan 10.00 cop[tikv] table:t1 keep order:false, stats:pseudo" + " └─Selection(Probe) 8.00 cop[tikv] not(isnull(plus(cast(test.t1.c2, double BINARY), 1)))", + " └─TableRowIDScan 10.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], "Result": [ "3" @@ -9590,12 +9545,11 @@ { "SQL": "select count(1) from t1 where c1 = '0xfff' and (c2 + 1) is null", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#9)->Column#5", - "└─IndexLookUp 1.00 root ", + "StreamAgg 1.00 root funcs:count(1)->Column#5", + "└─IndexLookUp 8.00 root ", " ├─IndexRangeScan(Build) 10.00 cop[tikv] table:t1, index:idx1(c1) range:[\"0xfff\",\"0xfff\"], keep order:false, stats:pseudo", - " └─HashAgg(Probe) 1.00 cop[tikv] funcs:count(1)->Column#9", - " └─Selection 8.00 cop[tikv] isnull(plus(cast(test.t1.c2, double BINARY), 1))", - " └─TableRowIDScan 10.00 cop[tikv] table:t1 keep order:false, stats:pseudo" + " └─Selection(Probe) 8.00 cop[tikv] isnull(plus(cast(test.t1.c2, double BINARY), 1))", + " └─TableRowIDScan 10.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], "Result": [ "1" @@ -9670,9 +9624,9 @@ { "SQL": "select count(1) from t2 use index(idx) where b is null", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#5)->Column#4", - "└─IndexReader 1.00 root index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#5", + "StreamAgg 1.00 root funcs:count(Column#6)->Column#4", + "└─IndexReader 1.00 root index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#6", " └─IndexRangeScan 10.00 cop[tikv] table:t2, index:idx(b) range:[NULL,NULL], keep order:false, stats:pseudo" ], "Result": [ diff --git a/planner/core/testdata/join_reorder_suite_out.json b/planner/core/testdata/join_reorder_suite_out.json index e9bdcc1010cb6..e2a6c562726d4 100644 --- a/planner/core/testdata/join_reorder_suite_out.json +++ b/planner/core/testdata/join_reorder_suite_out.json @@ -6296,7 +6296,7 @@ "Plan": [ "Projection 1.00 root test.t1.a, Column#14", "└─Apply 1.00 root CARTESIAN left outer join", - " ├─HashAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " ├─StreamAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", " │ └─IndexHashJoin 3.75 root inner join, inner:IndexReader, outer key:test.t3.a, inner key:test.t1.a, equal cond:eq(test.t3.a, test.t1.a)", " │ ├─IndexReader(Build) 3.00 root index:IndexFullScan", " │ │ └─IndexFullScan 3.00 cop[tikv] table:t3, index:a(a) keep order:false", @@ -6915,7 +6915,7 @@ "Plan": [ "Projection 1.00 root test.t1.a, Column#14", "└─Apply 1.00 root CARTESIAN left outer join", - " ├─HashAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " ├─StreamAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", " │ └─IndexHashJoin 3.75 root inner join, inner:IndexReader, outer key:test.t3.a, inner key:test.t1.a, equal cond:eq(test.t3.a, test.t1.a)", " │ ├─IndexReader(Build) 3.00 root index:IndexFullScan", " │ │ └─IndexFullScan 3.00 cop[tikv] table:t3, index:a(a) keep order:false", @@ -6935,7 +6935,7 @@ "Plan": [ "Projection 1.00 root test.t1.a, Column#14", "└─Apply 1.00 root CARTESIAN left outer join", - " ├─HashAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " ├─StreamAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", " │ └─IndexHashJoin 3.75 root inner join, inner:IndexReader, outer key:test.t3.a, inner key:test.t1.a, equal cond:eq(test.t3.a, test.t1.a)", " │ ├─IndexReader(Build) 3.00 root index:IndexFullScan", " │ │ └─IndexFullScan 3.00 cop[tikv] table:t3, index:a(a) keep order:false", @@ -6957,7 +6957,7 @@ "Plan": [ "Projection 1.00 root test.t1.a, Column#14", "└─Apply 1.00 root CARTESIAN left outer join", - " ├─HashAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " ├─StreamAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", " │ └─IndexHashJoin 3.75 root inner join, inner:IndexReader, outer key:test.t3.a, inner key:test.t1.a, equal cond:eq(test.t3.a, test.t1.a)", " │ ├─IndexReader(Build) 3.00 root index:IndexFullScan", " │ │ └─IndexFullScan 3.00 cop[tikv] table:t3, index:a(a) keep order:false", @@ -6979,7 +6979,7 @@ "Plan": [ "Projection 1.00 root test.t1.a, Column#14", "└─Apply 1.00 root CARTESIAN left outer join", - " ├─HashAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " ├─StreamAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", " │ └─IndexHashJoin 3.75 root inner join, inner:IndexReader, outer key:test.t3.a, inner key:test.t1.a, equal cond:eq(test.t3.a, test.t1.a)", " │ ├─IndexReader(Build) 3.00 root index:IndexFullScan", " │ │ └─IndexFullScan 3.00 cop[tikv] table:t3, index:a(a) keep order:false", @@ -7002,7 +7002,7 @@ "Plan": [ "Projection 1.00 root test.t1.a, Column#14", "└─Apply 1.00 root CARTESIAN left outer join", - " ├─HashAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " ├─StreamAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", " │ └─IndexHashJoin 3.75 root inner join, inner:IndexReader, outer key:test.t3.a, inner key:test.t1.a, equal cond:eq(test.t3.a, test.t1.a)", " │ ├─IndexReader(Build) 3.00 root index:IndexFullScan", " │ │ └─IndexFullScan 3.00 cop[tikv] table:t3, index:a(a) keep order:false", @@ -7024,7 +7024,7 @@ "Plan": [ "Projection 1.00 root test.t1.a, Column#14", "└─Apply 1.00 root CARTESIAN left outer join", - " ├─HashAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", + " ├─StreamAgg(Build) 1.00 root funcs:min(test.t1.a)->Column#10, funcs:firstrow(test.t1.a)->test.t1.a", " │ └─IndexHashJoin 3.75 root inner join, inner:IndexReader, outer key:test.t3.a, inner key:test.t1.a, equal cond:eq(test.t3.a, test.t1.a)", " │ ├─IndexReader(Build) 3.00 root index:IndexFullScan", " │ │ └─IndexFullScan 3.00 cop[tikv] table:t3, index:a(a) keep order:false", @@ -7049,11 +7049,10 @@ "├─IndexHashJoin(Build) 3.75 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", "│ ├─IndexHashJoin(Build) 3.00 root inner join, inner:IndexLookUp, outer key:Column#13, inner key:test.t1.a, equal cond:eq(Column#13, test.t1.a), eq(test.t3.b, test.t1.b)", "│ │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(Column#20)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - "│ │ │ └─TableReader 3.00 root data:HashAgg", - "│ │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:max(test.t3.a)->Column#20", - "│ │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - "│ │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + "│ │ │ └─TableReader 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", "│ │ └─IndexLookUp(Probe) 3.00 root ", "│ │ ├─Selection(Build) 3.00 cop[tikv] not(isnull(test.t1.a))", "│ │ │ └─IndexRangeScan 3.01 cop[tikv] table:t1, index:a(a) range: decided by [eq(test.t1.a, Column#13)], keep order:false, stats:pseudo", @@ -7079,11 +7078,10 @@ "└─IndexHashJoin 4.69 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", " ├─HashJoin(Build) 3.75 root inner join, equal:[eq(test.t1.b, test.t3.b) eq(test.t1.a, Column#13)]", " │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - " │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(Column#18)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - " │ │ └─TableReader 3.00 root data:HashAgg", - " │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:max(test.t3.a)->Column#18", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + " │ │ └─TableReader 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) 12475.01 root inner join, equal:[eq(test.t4.b, test.t1.b)]", " │ ├─TableReader(Build) 9980.01 root data:Selection", " │ │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", @@ -7105,11 +7103,10 @@ "├─IndexHashJoin(Build) 3.75 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", "│ ├─IndexHashJoin(Build) 3.00 root inner join, inner:IndexLookUp, outer key:Column#13, inner key:test.t1.a, equal cond:eq(Column#13, test.t1.a), eq(test.t3.b, test.t1.b)", "│ │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(Column#20)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - "│ │ │ └─TableReader 3.00 root data:HashAgg", - "│ │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:max(test.t3.a)->Column#20", - "│ │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - "│ │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + "│ │ │ └─TableReader 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", "│ │ └─IndexLookUp(Probe) 3.00 root ", "│ │ ├─Selection(Build) 3.00 cop[tikv] not(isnull(test.t1.a))", "│ │ │ └─IndexRangeScan 3.01 cop[tikv] table:t1, index:a(a) range: decided by [eq(test.t1.a, Column#13)], keep order:false, stats:pseudo", @@ -7134,11 +7131,10 @@ "├─IndexHashJoin(Build) 3.75 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", "│ ├─IndexHashJoin(Build) 3.00 root inner join, inner:IndexLookUp, outer key:Column#13, inner key:test.t1.a, equal cond:eq(Column#13, test.t1.a), eq(test.t3.b, test.t1.b)", "│ │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(Column#20)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - "│ │ │ └─TableReader 3.00 root data:HashAgg", - "│ │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:max(test.t3.a)->Column#20", - "│ │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - "│ │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:max(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + "│ │ │ └─TableReader 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", "│ │ └─IndexLookUp(Probe) 3.00 root ", "│ │ ├─Selection(Build) 3.00 cop[tikv] not(isnull(test.t1.a))", "│ │ │ └─IndexRangeScan 3.01 cop[tikv] table:t1, index:a(a) range: decided by [eq(test.t1.a, Column#13)], keep order:false, stats:pseudo", @@ -7164,11 +7160,10 @@ "├─IndexHashJoin(Build) 3.75 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", "│ ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t3.b, test.t1.b)], other cond:gt(test.t1.a, Column#13)", "│ │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(Column#17)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - "│ │ │ └─TableReader 3.00 root data:HashAgg", - "│ │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:min(test.t3.a)->Column#17", - "│ │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - "│ │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + "│ │ │ └─TableReader 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", "│ │ └─TableReader(Probe) 9980.01 root 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", @@ -7192,11 +7187,10 @@ "└─IndexHashJoin 4.69 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", " ├─HashJoin(Build) 3.75 root inner join, equal:[eq(test.t1.b, test.t3.b)], other cond:gt(test.t1.a, Column#13)", " │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - " │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(Column#18)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - " │ │ └─TableReader 3.00 root data:HashAgg", - " │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:min(test.t3.a)->Column#18", - " │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - " │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + " │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + " │ │ └─TableReader 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) 12475.01 root inner join, equal:[eq(test.t4.b, test.t1.b)]", " │ ├─TableReader(Build) 9980.01 root data:Selection", " │ │ └─Selection 9980.01 cop[tikv] not(isnull(test.t1.a)), not(isnull(test.t1.b))", @@ -7218,11 +7212,10 @@ "├─IndexHashJoin(Build) 3.75 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", "│ ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t3.b, test.t1.b)], other cond:gt(test.t1.a, Column#13)", "│ │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(Column#17)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - "│ │ │ └─TableReader 3.00 root data:HashAgg", - "│ │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:min(test.t3.a)->Column#17", - "│ │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - "│ │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + "│ │ │ └─TableReader 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", "│ │ └─TableReader(Probe) 9980.01 root 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", @@ -7245,11 +7238,10 @@ "├─IndexHashJoin(Build) 3.75 root inner join, inner:IndexLookUp, outer key:test.t1.a, inner key:test.t2.a, equal cond:eq(test.t1.a, test.t2.a)", "│ ├─HashJoin(Build) 3.00 root inner join, equal:[eq(test.t3.b, test.t1.b)], other cond:gt(test.t1.a, Column#13)", "│ │ ├─Selection(Build) 2.40 root not(isnull(Column#13))", - "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(Column#17)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", - "│ │ │ └─TableReader 3.00 root data:HashAgg", - "│ │ │ └─HashAgg 3.00 cop[tikv] group by:test.t3.b, funcs:min(test.t3.a)->Column#17", - "│ │ │ └─Selection 3.00 cop[tikv] not(isnull(test.t3.b))", - "│ │ │ └─TableFullScan 3.00 cop[tikv] table:t3 keep order:false", + "│ │ │ └─HashAgg 3.00 root group by:test.t3.b, funcs:min(test.t3.a)->Column#13, funcs:firstrow(test.t3.b)->test.t3.b", + "│ │ │ └─TableReader 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", "│ │ └─TableReader(Probe) 9980.01 root 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", diff --git a/planner/core/testdata/plan_suite_out.json b/planner/core/testdata/plan_suite_out.json index 8d246a2af2f1a..6b8612f70992d 100644 --- a/planner/core/testdata/plan_suite_out.json +++ b/planner/core/testdata/plan_suite_out.json @@ -963,7 +963,7 @@ }, { "SQL": "select sum(e), avg(e + c) from t where c = 1 group by e", - "Best": "IndexReader(Index(t.c_d_e)[[1,1]]->HashAgg)->HashAgg" + "Best": "IndexReader(Index(t.c_d_e)[[1,1]])->Projection->HashAgg" }, { "SQL": "select sum(e), avg(b + c) from t where c = 1 and e = 1 group by d", @@ -1257,15 +1257,15 @@ "Cases": [ { "SQL": "select max(a) from t;", - "Best": "TableReader(Table(t)->Limit)->Limit->HashAgg" + "Best": "TableReader(Table(t)->Limit)->Limit->StreamAgg" }, { "SQL": "select min(a) from t;", - "Best": "TableReader(Table(t)->Limit)->Limit->HashAgg" + "Best": "TableReader(Table(t)->Limit)->Limit->StreamAgg" }, { "SQL": "select min(c_str) from t;", - "Best": "IndexReader(Index(t.c_d_e_str)[[-inf,+inf]]->Limit)->Limit->HashAgg" + "Best": "IndexReader(Index(t.c_d_e_str)[[-inf,+inf]]->Limit)->Limit->StreamAgg" }, { "SQL": "select max(a), b from t;", @@ -1273,23 +1273,23 @@ }, { "SQL": "select max(a+1) from t;", - "Best": "IndexReader(Index(t.f)[[NULL,+inf]]->TopN([plus(test.t.a, 1) true],0,1))->Projection->TopN([Column#40 true],0,1)->Projection->Projection->HashAgg" + "Best": "IndexReader(Index(t.f)[[NULL,+inf]]->TopN([plus(test.t.a, 1) true],0,1))->Projection->TopN([Column#40 true],0,1)->Projection->Projection->StreamAgg" }, { "SQL": "select max(a), min(a) from t;", - "Best": "LeftHashJoin{TableReader(Table(t)->Limit)->Limit->HashAgg->TableReader(Table(t)->Limit)->Limit->HashAgg}" + "Best": "RightHashJoin{TableReader(Table(t)->Limit)->Limit->StreamAgg->TableReader(Table(t)->Limit)->Limit->StreamAgg}" }, { "SQL": "select max(a), min(a) from t where a > 10", - "Best": "LeftHashJoin{TableReader(Table(t)->Limit)->Limit->HashAgg->TableReader(Table(t)->Limit)->Limit->HashAgg}" + "Best": "RightHashJoin{TableReader(Table(t)->Limit)->Limit->StreamAgg->TableReader(Table(t)->Limit)->Limit->StreamAgg}" }, { "SQL": "select max(d), min(d) from t where c = 1 and d > 10", - "Best": "LeftHashJoin{IndexReader(Index(t.c_d_e)[(1 10,1 +inf]]->Limit)->Limit->HashAgg->IndexReader(Index(t.c_d_e)[(1 10,1 +inf]]->Limit)->Limit->HashAgg}" + "Best": "LeftHashJoin{IndexReader(Index(t.c_d_e)[(1 10,1 +inf]]->Limit)->Limit->StreamAgg->IndexReader(Index(t.c_d_e)[(1 10,1 +inf]]->Limit)->Limit->StreamAgg}" }, { "SQL": "select max(a), max(c), min(f) from t", - "Best": "LeftHashJoin{LeftHashJoin{TableReader(Table(t)->Limit)->Limit->HashAgg->IndexReader(Index(t.c_d_e)[[NULL,+inf]]->Limit)->Limit->HashAgg}->IndexReader(Index(t.f)[[NULL,+inf]]->Limit)->Limit->HashAgg}" + "Best": "LeftHashJoin{RightHashJoin{TableReader(Table(t)->Limit)->Limit->StreamAgg->IndexReader(Index(t.c_d_e)[[NULL,+inf]]->Limit)->Limit->StreamAgg}->IndexReader(Index(t.f)[[NULL,+inf]]->Limit)->Limit->StreamAgg}" }, { "SQL": "select max(a), max(b) from t", @@ -1309,7 +1309,7 @@ }, { "SQL": "select max(a) from (select t1.a from t t1 join t t2 on t1.a=t2.a) t", - "Best": "MergeInnerJoin{TableReader(Table(t))->TableReader(Table(t))}(test.t.a,test.t.a)->Limit->HashAgg" + "Best": "MergeInnerJoin{TableReader(Table(t))->TableReader(Table(t))}(test.t.a,test.t.a)->Limit->StreamAgg" } ] }, @@ -5935,7 +5935,7 @@ "└─Apply 10000.00 root CARTESIAN inner join", " ├─TableReader(Build) 10000.00 root data:TableFullScan", " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─HashAgg(Probe) 10000.00 root funcs:max(Column#14)->Column#8, funcs:count(distinct Column#15)->Column#9, funcs:sum(Column#16)->Column#10, funcs:count(1)->Column#11", + " └─StreamAgg(Probe) 10000.00 root funcs:max(Column#14)->Column#8, funcs:count(distinct Column#15)->Column#9, funcs:sum(Column#16)->Column#10, funcs:count(1)->Column#11", " └─Projection 10000.00 root test.t2.b, test.t2.b, cast(isnull(test.t2.b), decimal(20,0) BINARY)->Column#16", " └─TableReader 10000.00 root data:TableRangeScan", " └─TableRangeScan 10000.00 cop[tikv] table:t2 range: decided by [eq(test.t2.a, test.t1.b)], keep order:false, stats:pseudo" @@ -5953,7 +5953,7 @@ "└─Apply 10000.00 root CARTESIAN inner join", " ├─TableReader(Build) 10000.00 root data:TableFullScan", " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─HashAgg(Probe) 10000.00 root funcs:max(Column#14)->Column#8, funcs:count(distinct Column#15)->Column#9, funcs:sum(Column#16)->Column#10, funcs:count(1)->Column#11", + " └─StreamAgg(Probe) 10000.00 root funcs:max(Column#14)->Column#8, funcs:count(distinct Column#15)->Column#9, funcs:sum(Column#16)->Column#10, funcs:count(1)->Column#11", " └─Projection 10000.00 root test.t2.b, test.t2.b, cast(isnull(test.t2.b), decimal(20,0) BINARY)->Column#16", " └─TableReader 10000.00 root data:TableRangeScan", " └─TableRangeScan 10000.00 cop[tikv] table:t2 range: decided by [eq(test.t2.a, test.t1.b)], keep order:false, stats:pseudo" @@ -5971,7 +5971,7 @@ "└─Apply 10000.00 root CARTESIAN inner join", " ├─TableReader(Build) 10000.00 root data:TableFullScan", " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─HashAgg(Probe) 10000.00 root funcs:max(Column#19)->Column#8, funcs:sum(Column#20)->Column#9, funcs:count(1)->Column#10", + " └─StreamAgg(Probe) 10000.00 root funcs:max(Column#19)->Column#8, funcs:sum(Column#20)->Column#9, funcs:count(1)->Column#10", " └─Projection 10000.00 root test.t2.b, cast(isnull(test.t2.b), decimal(20,0) BINARY)->Column#20", " └─TableReader 10000.00 root data:TableRangeScan", " └─TableRangeScan 10000.00 cop[tikv] table:t2 range: decided by [eq(test.t2.a, test.t1.b)], keep order:false, stats:pseudo" @@ -5989,7 +5989,7 @@ "└─Apply 10000.00 root CARTESIAN inner join", " ├─TableReader(Build) 10000.00 root data:TableFullScan", " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", - " └─HashAgg(Probe) 10000.00 root funcs:max(Column#19)->Column#8, funcs:sum(Column#20)->Column#9, funcs:count(1)->Column#10", + " └─StreamAgg(Probe) 10000.00 root funcs:max(Column#19)->Column#8, funcs:sum(Column#20)->Column#9, funcs:count(1)->Column#10", " └─Projection 10000.00 root test.t2.b, cast(isnull(test.t2.b), decimal(20,0) BINARY)->Column#20", " └─TableReader 10000.00 root data:TableRangeScan", " └─TableRangeScan 10000.00 cop[tikv] table:t2 range: decided by [eq(test.t2.a, test.t1.b)], keep order:false, stats:pseudo" @@ -6159,9 +6159,9 @@ " ├─TableReader(Build) 10000.00 root data:TableFullScan", " │ └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo", " └─MaxOneRow(Probe) 10000.00 root ", - " └─HashAgg 10000.00 root funcs:count(Column#11)->Column#10", - " └─TableReader 10000.00 root data:HashAgg", - " └─HashAgg 10000.00 cop[tikv] funcs:count(test.t3.a)->Column#11", + " └─StreamAgg 10000.00 root funcs:count(Column#12)->Column#10", + " └─TableReader 10000.00 root data:StreamAgg", + " └─StreamAgg 10000.00 cop[tikv] funcs:count(test.t3.a)->Column#12", " └─Selection 100000.00 cop[tikv] eq(test.t3.b, test.t1.b)", " └─TableFullScan 100000000.00 cop[tikv] table:t3 keep order:false, stats:pseudo" ], @@ -6234,7 +6234,7 @@ " │ └─Selection 250.00 cop[tikv] like(test.ta.name, \"chad999%\", 92)", " │ └─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo", " └─MaxOneRow(Probe) 250.00 root ", - " └─HashAgg 250.00 root funcs:sum(Column#33)->Column#18", + " └─StreamAgg 250.00 root funcs:sum(Column#33)->Column#18", " └─Projection 1998.00 root cast(test.tb.code, decimal(10,0) BINARY)->Column#33", " └─IndexHashJoin 1998.00 root semi join, inner:IndexLookUp, outer key:test.tb.name, inner key:test.tc.name, equal cond:eq(test.tb.name, test.tc.name)", " ├─IndexLookUp(Build) 2497.50 root ", @@ -6280,7 +6280,7 @@ " │ └─Selection 250.00 cop[tikv] like(test.ta.name, \"chad999%\", 92)", " │ └─TableFullScan 10000.00 cop[tikv] table:ta keep order:false, stats:pseudo", " └─MaxOneRow(Probe) 250.00 root ", - " └─HashAgg 250.00 root funcs:sum(Column#22)->Column#18", + " └─StreamAgg 250.00 root funcs:sum(Column#22)->Column#18", " └─Projection 2500.00 root cast(test.tb.code, decimal(10,0) BINARY)->Column#22", " └─Apply 2500.00 root CARTESIAN semi join", " ├─IndexLookUp(Build) 2500.00 root ", @@ -6323,7 +6323,7 @@ " │ └─TableRowIDScan(Probe) 10.00 cop[tikv] table:ta keep order:false, stats:pseudo", " └─Selection(Probe) 8.00 root gt(Column#9, 900)", " └─MaxOneRow 10.00 root ", - " └─HashAgg 10.00 root funcs:max(test.tb.code)->Column#9", + " └─StreamAgg 10.00 root funcs:max(test.tb.code)->Column#9", " └─TopN 10.00 root test.tb.code:desc, offset:0, count:1", " └─IndexLookUp 10.00 root ", " ├─IndexRangeScan(Build) 100.00 cop[tikv] table:tb, index:idx_tb_id(id) range: decided by [eq(test.ta.id, test.tb.id)], keep order:false, stats:pseudo", diff --git a/session/testdata/clustered_index_suite_out.json b/session/testdata/clustered_index_suite_out.json index dd0f1f630b9fc..e7bc6f0cc52e7 100644 --- a/session/testdata/clustered_index_suite_out.json +++ b/session/testdata/clustered_index_suite_out.json @@ -15,9 +15,9 @@ { "SQL": "select count(1) from t1 use index(idx1) where c2 = 'cd'", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#5)->Column#4", - "└─IndexReader 1.00 root index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#5", + "StreamAgg 1.00 root funcs:count(Column#6)->Column#4", + "└─IndexReader 1.00 root index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#6", " └─Selection 10.00 cop[tikv] eq(test.t1.c2, \"cd\")", " └─IndexRangeScan 10.00 cop[tikv] table:t1, index:idx1(c2) range:[\"c\",\"c\"], keep order:false, stats:pseudo" ], @@ -38,9 +38,9 @@ { "SQL": "select count(1) from t2 use index(idx1) where c2 = 'cd'", "Plan": [ - "HashAgg 1.00 root funcs:count(Column#6)->Column#4", - "└─IndexReader 1.00 root index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#6", + "StreamAgg 1.00 root funcs:count(Column#9)->Column#4", + "└─IndexReader 1.00 root index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#9", " └─Selection 10.00 cop[tikv] eq(test.t2.c2, \"cd\")", " └─IndexFullScan 10000.00 cop[tikv] table:t2, index:idx1(c1, c2) keep order:false, stats:pseudo" ], diff --git a/statistics/testdata/stats_suite_out.json b/statistics/testdata/stats_suite_out.json index a78fafe87ade9..def2cf2f50c1b 100644 --- a/statistics/testdata/stats_suite_out.json +++ b/statistics/testdata/stats_suite_out.json @@ -155,244 +155,247 @@ "test ct2 PRIMARY 1 1 6 1 (6, 6) (8, 8) 0" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.a, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:singular(a) range:[1,1], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.a, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:singular(a) range:[4,4], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.a, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:singular(a) range:[8,8], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.a, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:singular(a) range:[1,1], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.a, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:singular(a) range:[4,4], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.a, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:singular(a) range:[8,8], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.a, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:singular(a) range:[1.00000000000000000000,1.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.a, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:singular(a) range:[4.00000000000000000000,4.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.a, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:singular(a) range:[8.00000000000000000000,8.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.a, \"1\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:singular(a) range:[\"1\",\"1\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.a, \"4\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:singular(a) range:[\"4\",\"4\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.a, \"8\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:singular(a) range:[\"8\",\"8\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.a, 2001-01-01 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:singular(a) range:[2001-01-01 00:00:00,2001-01-01 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.a, 2001-01-02 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:singular(a) range:[2001-01-02 00:00:00,2001-01-02 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.a, 2001-01-04 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:singular(a) range:[2001-01-04 00:00:00,2001-01-04 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tprefix.a, \"111\")", - " └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false" + "IndexLookUp_11 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tprefix, index:prefixa(a) range:[\"11\",\"11\"], keep order:false", + "└─Selection_10(Probe) 1.00 cop[tikv] eq(test.tprefix.a, \"111\")", + " └─TableRowIDScan_9 1.00 cop[tikv] table:tprefix keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tprefix.a, \"444\")", - " └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false" + "IndexLookUp_11 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tprefix, index:prefixa(a) range:[\"44\",\"44\"], keep order:false", + "└─Selection_10(Probe) 1.00 cop[tikv] eq(test.tprefix.a, \"444\")", + " └─TableRowIDScan_9 1.00 cop[tikv] table:tprefix keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tprefix.a, \"888\")", - " └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false" + "IndexLookUp_11 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tprefix, index:prefixa(a) range:[\"88\",\"88\"], keep order:false", + "└─Selection_10(Probe) 1.00 cop[tikv] eq(test.tprefix.a, \"888\")", + " └─TableRowIDScan_9 1.00 cop[tikv] table:tprefix keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 1), eq(test.tint.c, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[1 1,1 1], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 4), eq(test.tint.c, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[4 4,4 4], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 8), eq(test.tint.c, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[8 8,8 8], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 1), eq(test.tdouble.c, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[1 1,1 1], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 4), eq(test.tdouble.c, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[4 4,4 4], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 8), eq(test.tdouble.c, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[8 8,8 8], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 1), eq(test.tdecimal.c, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[1.00000000000000000000 1.00000000000000000000,1.00000000000000000000 1.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 4), eq(test.tdecimal.c, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[4.00000000000000000000 4.00000000000000000000,4.00000000000000000000 4.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 8), eq(test.tdecimal.c, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[8.00000000000000000000 8.00000000000000000000,8.00000000000000000000 8.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"1\"), eq(test.tstring.c, \"1\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"1\" \"1\",\"1\" \"1\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"4\"), eq(test.tstring.c, \"4\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"4\" \"4\",\"4\" \"4\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"8\"), eq(test.tstring.c, \"8\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"8\" \"8\",\"8\" \"8\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-01 00:00:00.000000), eq(test.tdatetime.c, 2001-01-01 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-01 00:00:00 2001-01-01 00:00:00,2001-01-01 00:00:00 2001-01-01 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-02 00:00:00.000000), eq(test.tdatetime.c, 2001-01-02 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-02 00:00:00 2001-01-02 00:00:00,2001-01-02 00:00:00 2001-01-02 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-04 00:00:00.000000), eq(test.tdatetime.c, 2001-01-04 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-04 00:00:00 2001-01-04 00:00:00,2001-01-04 00:00:00 2001-01-04 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[1,1], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[4,4], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[8,8], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[1,1], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[4,4], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[8,8], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 1)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[1.00000000000000000000,1.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 4)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[4.00000000000000000000,4.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 8)", - " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[8.00000000000000000000,8.00000000000000000000], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"1\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"1\",\"1\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"4\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"4\",\"4\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"8\")", - " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"8\",\"8\"], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-01 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-01 00:00:00,2001-01-01 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-02 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-02 00:00:00,2001-01-02 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ - "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-04 00:00:00.000000)", - " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" + "IndexLookUp_10 1.00 root ", + "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-04 00:00:00,2001-01-04 00:00:00], keep order:false", + "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" ], [ "TableReader_6 5.00 root data:TableRangeScan_5", diff --git a/util/ranger/testdata/ranger_suite_out.json b/util/ranger/testdata/ranger_suite_out.json index 3934ff2f7bad3..4a4f0c85e2682 100644 --- a/util/ranger/testdata/ranger_suite_out.json +++ b/util/ranger/testdata/ranger_suite_out.json @@ -9,7 +9,7 @@ "└─Apply 2.00 root CARTESIAN left outer semi join, other cond:eq(test.t.e, Column#26)", " ├─TableReader(Build) 2.00 root data:TableFullScan", " │ └─TableFullScan 2.00 cop[tikv] table:t keep order:false", - " └─HashAgg(Probe) 2.00 root funcs:count(1)->Column#26", + " └─StreamAgg(Probe) 2.00 root funcs:count(1)->Column#26", " └─HashJoin 4.00 root inner join, equal:[eq(test.t.a, test.t.a)]", " ├─IndexReader(Build) 4.00 root index:IndexFullScan", " │ └─IndexFullScan 4.00 cop[tikv] table:t1, index:idx(b, c, d) keep order:false", From a7150a002873296d39e879c8b658c859873f39dc Mon Sep 17 00:00:00 2001 From: qw4990 Date: Tue, 29 Nov 2022 13:28:10 +0800 Subject: [PATCH 3/6] fixup --- .../core/testdata/partition_pruner_out.json | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/planner/core/testdata/partition_pruner_out.json b/planner/core/testdata/partition_pruner_out.json index 3206c3dc5853d..40dd2677ab040 100644 --- a/planner/core/testdata/partition_pruner_out.json +++ b/planner/core/testdata/partition_pruner_out.json @@ -802,7 +802,7 @@ "1" ], "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─HashJoin 4.00 root inner join, equal:[eq(test_partition.t6.b, test_partition.t5.b)]", " ├─IndexReader(Build) 4.00 root partition:p0,p1 index:Selection", " │ └─Selection 4.00 cop[tikv] not(isnull(test_partition.t5.b))", @@ -818,7 +818,7 @@ "1" ], "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─IndexJoin 4.00 root inner join, inner:IndexReader, outer key:test_partition.t6.b, inner key:test_partition.t5.b, equal cond:eq(test_partition.t6.b, test_partition.t5.b)", " ├─IndexReader(Build) 4.00 root partition:p0 index:Selection", " │ └─Selection 4.00 cop[tikv] not(isnull(test_partition.t6.b))", @@ -834,7 +834,7 @@ "1" ], "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─IndexHashJoin 4.00 root inner join, inner:IndexReader, outer key:test_partition.t6.b, inner key:test_partition.t5.b, equal cond:eq(test_partition.t6.b, test_partition.t5.b)", " ├─IndexReader(Build) 4.00 root partition:p0 index:Selection", " │ └─Selection 4.00 cop[tikv] not(isnull(test_partition.t6.b))", @@ -934,16 +934,16 @@ "2" ], "Plan": [ - "HashAgg 1.00 root funcs:count(Column#6)->Column#5", - "└─TableReader 1.00 root partition:p0 data:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#6", + "StreamAgg 1.00 root funcs:count(Column#7)->Column#5", + "└─TableReader 1.00 root partition:p0 data:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#7", " └─Selection 19.99 cop[tikv] or(eq(test_partition.t1.a, 1), eq(test_partition.t1.b, 2))", " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], "IndexPlan": [ - "HashAgg 1.00 root funcs:count(Column#7)->Column#5", - "└─IndexReader 1.00 root partition:p0 index:HashAgg", - " └─HashAgg 1.00 cop[tikv] funcs:count(1)->Column#7", + "StreamAgg 1.00 root funcs:count(Column#10)->Column#5", + "└─IndexReader 1.00 root partition:p0 index:StreamAgg", + " └─StreamAgg 1.00 cop[tikv] funcs:count(1)->Column#10", " └─Selection 19.99 cop[tikv] or(eq(test_partition_1.t1.a, 1), eq(test_partition_1.t1.b, 2))", " └─IndexFullScan 10000.00 cop[tikv] table:t1, index:a(a, b, id) keep order:false, stats:pseudo" ] @@ -1877,7 +1877,7 @@ " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" ], "IndexPlan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─IndexHashJoin 0.41 root inner join, inner:IndexReader, outer key:test_partition_1.t2.b, inner key:test_partition_1.t1.b, equal cond:eq(test_partition_1.t2.b, test_partition_1.t1.b)", " ├─IndexReader(Build) 0.80 root partition:p0 index:Selection", " │ └─Selection 0.80 cop[tikv] not(isnull(test_partition_1.t2.b))", @@ -2789,7 +2789,7 @@ "2" ], "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─HashJoin 7.81 root inner join, equal:[eq(test_partition.t1.b, test_partition.t2.b)]", " ├─TableReader(Build) 6.25 root partition:p0,p1 data:Selection", " │ └─Selection 6.25 cop[tikv] ge(test_partition.t2.a, 1), ge(test_partition.t2.b, 1), le(test_partition.t2.a, 6), le(test_partition.t2.b, 6), not(isnull(test_partition.t2.b))", @@ -2799,7 +2799,7 @@ " └─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo" ], "IndexPlan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─HashJoin 7.81 root inner join, equal:[eq(test_partition_1.t1.b, test_partition_1.t2.b)]", " ├─IndexReader(Build) 6.25 root partition:p0,p1 index:Selection", " │ └─Selection 6.25 cop[tikv] ge(test_partition_1.t2.b, 1), le(test_partition_1.t2.b, 6), not(isnull(test_partition_1.t2.b))", @@ -2815,7 +2815,7 @@ "2" ], "Plan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─HashJoin 7.81 root inner join, equal:[eq(test_partition.t2.b, test_partition.t1.b)]", " ├─TableReader(Build) 6.25 root partition:p0,p1 data:Selection", " │ └─Selection 6.25 cop[tikv] ge(test_partition.t1.a, 1), ge(test_partition.t1.b, 1), le(test_partition.t1.a, 6), le(test_partition.t1.b, 6), not(isnull(test_partition.t1.b))", @@ -2825,7 +2825,7 @@ " └─TableFullScan 10000.00 cop[tikv] table:t2 keep order:false, stats:pseudo" ], "IndexPlan": [ - "HashAgg 1.00 root funcs:count(1)->Column#9", + "StreamAgg 1.00 root funcs:count(1)->Column#9", "└─HashJoin 7.81 root inner join, equal:[eq(test_partition_1.t2.b, test_partition_1.t1.b)]", " ├─IndexReader(Build) 6.25 root partition:p0,p1 index:Selection", " │ └─Selection 6.25 cop[tikv] ge(test_partition_1.t1.b, 1), le(test_partition_1.t1.b, 6), not(isnull(test_partition_1.t1.b))", From 3ed014f07b95677714c0e94371f5210811ed2404 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Tue, 29 Nov 2022 14:37:03 +0800 Subject: [PATCH 4/6] fixup --- executor/explain_test.go | 2 +- executor/explainfor_test.go | 4 ++-- executor/partition_table_test.go | 10 +++++----- planner/core/physical_plan_trace_test.go | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/executor/explain_test.go b/executor/explain_test.go index c67c61a67a909..8c1ec9bad03a6 100644 --- a/executor/explain_test.go +++ b/executor/explain_test.go @@ -364,7 +364,7 @@ func TestCheckActRowsWithUnistore(t *testing.T) { }, { sql: "select count(*) from t_unistore_act_rows group by b", - expected: []string{"2", "2", "2", "4"}, + expected: []string{"2", "4", "4"}, }, { sql: "with cte(a) as (select a from t_unistore_act_rows) select (select 1 from cte limit 1) from cte;", diff --git a/executor/explainfor_test.go b/executor/explainfor_test.go index 5a32a32eb040e..85652a5f04ddb 100644 --- a/executor/explainfor_test.go +++ b/executor/explainfor_test.go @@ -479,9 +479,9 @@ func TestPointGetUserVarPlanCache(t *testing.T) { tk.MustQuery(fmt.Sprintf("explain for connection %d", tkProcess.ID)).Check(testkit.Rows( // can use idx_a `Projection_9 1.00 root test.t1.a, test.t1.b, test.t2.a, test.t2.b`, `└─MergeJoin_10 1.00 root inner join, left key:test.t2.a, right key:test.t1.a`, - ` ├─Selection_42(Build) 10.00 root eq(test.t1.a, 1)`, + ` ├─Selection_42(Build) 10.00 root eq(test.t1.a, 2)`, ` │ └─TableReader_41 10.00 root data:TableRangeScan_40`, - ` │ └─TableRangeScan_40 10.00 cop[tikv] table:t1 range:[1,1], keep order:true, stats:pseudo`, + ` │ └─TableRangeScan_40 10.00 cop[tikv] table:t1 range:[2,2], keep order:true, stats:pseudo`, ` └─Selection_39(Probe) 0.80 root not(isnull(test.t2.a))`, ` └─Point_Get_38 1.00 root table:t2, index:idx_a(a) `)) tk.MustQuery("execute stmt using @a").Check(testkit.Rows( diff --git a/executor/partition_table_test.go b/executor/partition_table_test.go index 50bb68a7b5235..ade67495524d7 100644 --- a/executor/partition_table_test.go +++ b/executor/partition_table_test.go @@ -3531,11 +3531,11 @@ func TestPartitionTableExplain(t *testing.T) { " └─IndexFullScan 1.00 cop[tikv] table:t, partition:p1, index:b(b) keep order:false")) tk.MustQuery(`explain format = 'brief' select * from t,t2 where t2.a = 1 and t2.b = t.b and t.a = 1`).Check(testkit.Rows( "HashJoin 1.00 root inner join, equal:[eq(testpartitiontableexplain.t.b, testpartitiontableexplain.t2.b)]", - "├─TableReader(Build) 1.00 root data:Selection", - "│ └─Selection 1.00 cop[tikv] eq(testpartitiontableexplain.t2.a, 1), not(isnull(testpartitiontableexplain.t2.b))", - "│ └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false", - "└─Selection(Probe) 1.00 root not(isnull(testpartitiontableexplain.t.b))", - " └─Point_Get 1.00 root table:t, partition:p1 handle:1")) + `├─Selection(Build) 1.00 root not(isnull(testpartitiontableexplain.t.b))`, + `│ └─Point_Get 1.00 root table:t, partition:p1 handle:1`, + `└─TableReader(Probe) 1.00 root data:Selection`, + ` └─Selection 1.00 cop[tikv] eq(testpartitiontableexplain.t2.a, 1), not(isnull(testpartitiontableexplain.t2.b))`, + ` └─TableFullScan 3.00 cop[tikv] table:t2 keep order:false`)) tk.MustExec("set @@tidb_partition_prune_mode = 'dynamic'") tk.MustExec(`analyze table t`) diff --git a/planner/core/physical_plan_trace_test.go b/planner/core/physical_plan_trace_test.go index 1e2ad927e0c54..5390fc20af0bd 100644 --- a/planner/core/physical_plan_trace_test.go +++ b/planner/core/physical_plan_trace_test.go @@ -61,7 +61,7 @@ func TestPhysicalOptimizeWithTraceEnabled(t *testing.T) { "Limit_20", "IndexReader_21", "Limit_14", - "HashAgg_9", + "StreamAgg_10", "Projection_8", }, }, From 847a5d09175fa2d486c12167512a88c9d2bd2705 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Tue, 29 Nov 2022 17:56:21 +0800 Subject: [PATCH 5/6] fiuxp --- planner/core/plan_cost_ver2.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/planner/core/plan_cost_ver2.go b/planner/core/plan_cost_ver2.go index 1677b8ef52479..b53d53c845c45 100644 --- a/planner/core/plan_cost_ver2.go +++ b/planner/core/plan_cost_ver2.go @@ -263,10 +263,6 @@ func (p *PhysicalIndexLookUpReader) getPlanCostVer2(taskType property.TaskType, batchSize := float64(p.ctx.GetSessionVars().IndexLookupSize) taskPerBatch := 32.0 // TODO: remove this magic number doubleReadTasks := doubleReadRows / batchSize * taskPerBatch - if doubleReadRows <= 1 { - // prefer to use IndexLookup if double-read data-size is very small - doubleReadTasks = 0 - } doubleReadRequestCost := doubleReadCostVer2(option, doubleReadTasks, requestFactor) doubleReadCost := sumCostVer2(doubleReadCPUCost, doubleReadRequestCost) @@ -452,7 +448,7 @@ func (p *PhysicalHashAgg) getPlanCostVer2(taskType property.TaskType, option *Pl hashBuildCost := hashBuildCostVer2(option, outputRows, outputRowSize, float64(len(p.GroupByItems)), cpuFactor, memFactor) hashProbeCost := hashProbeCostVer2(option, inputRows, float64(len(p.GroupByItems)), cpuFactor) startCost := newCostVer2(option, cpuFactor, - 10*3*cpuFactor.Value, + 10*3*cpuFactor.Value, // 10rows * 3func * cpuFactor func() string { return fmt.Sprintf("cpu(10*3*%v)", cpuFactor) }) childCost, err := p.children[0].getPlanCostVer2(taskType, option) @@ -539,7 +535,7 @@ func (p *PhysicalHashJoin) getPlanCostVer2(taskType property.TaskType, option *P divCostVer2(sumCostVer2(buildHashCost, buildFilterCost, probeHashCost, probeFilterCost), mppConcurrency)) } else { // TiDB HashJoin startCost := newCostVer2(option, cpuFactor, - 10*3*cpuFactor.Value, + 10*3*cpuFactor.Value, // 10rows * 3func * cpuFactor func() string { return fmt.Sprintf("cpu(10*3*%v)", cpuFactor) }) p.planCostVer2 = sumCostVer2(startCost, buildChildCost, probeChildCost, buildHashCost, buildFilterCost, divCostVer2(sumCostVer2(probeFilterCost, probeHashCost), tidbConcurrency)) From 6dc1374fac47a14f59bd0b3bb2d5b37791df3362 Mon Sep 17 00:00:00 2001 From: qw4990 Date: Tue, 29 Nov 2022 22:38:13 +0800 Subject: [PATCH 6/6] fixup --- .../core/testdata/integration_suite_out.json | 39 ++- statistics/testdata/stats_suite_out.json | 291 +++++++++--------- 2 files changed, 163 insertions(+), 167 deletions(-) diff --git a/planner/core/testdata/integration_suite_out.json b/planner/core/testdata/integration_suite_out.json index 5d04f16337883..1ab77ccb7736f 100644 --- a/planner/core/testdata/integration_suite_out.json +++ b/planner/core/testdata/integration_suite_out.json @@ -2051,21 +2051,22 @@ { "SQL": "explain format = 'verbose' select * from t where b = 6 order by a limit 1", "Plan": [ - "TopN_9 0.00 36.63 root test.t.a, offset:0, count:1", - "└─IndexLookUp_20 0.00 31.83 root ", - " ├─TopN_19(Build) 0.00 206.70 cop[tikv] test.t.a, offset:0, count:1", - " │ └─IndexRangeScan_17 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", - " └─TableRowIDScan_18(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" + "Limit_11 0.00 98.74 root offset:0, count:1", + "└─TableReader_24 0.00 98.74 root data:Limit_23", + " └─Limit_23 0.00 1386.04 cop[tikv] offset:0, count:1", + " └─Selection_22 0.00 1386.04 cop[tikv] eq(test.t.b, 6)", + " └─TableFullScan_21 5.00 1136.54 cop[tikv] table:t keep order:true" ], "Warnings": null }, { "SQL": "explain format = 'verbose' select * from t where b = 6 limit 1", "Plan": [ - "IndexLookUp_17 0.00 18.97 root limit embedded(offset:0, count:1)", - "├─Limit_16(Build) 0.00 203.50 cop[tikv] offset:0, count:1", - "│ └─IndexRangeScan_14 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", - "└─TableRowIDScan_15(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" + "Limit_8 0.00 98.74 root offset:0, count:1", + "└─TableReader_13 0.00 98.74 root data:Limit_12", + " └─Limit_12 0.00 1386.04 cop[tikv] offset:0, count:1", + " └─Selection_11 0.00 1386.04 cop[tikv] eq(test.t.b, 6)", + " └─TableFullScan_10 5.00 1136.54 cop[tikv] table:t keep order:false" ], "Warnings": null }, @@ -2088,8 +2089,8 @@ { "SQL": "explain format = 'verbose' select * from t where b = 6 order by a limit 1", "Plan": [ - "TopN_9 0.00 36.63 root test.t.a, offset:0, count:1", - "└─IndexLookUp_16 0.00 31.83 root ", + "TopN_9 0.00 1956.63 root test.t.a, offset:0, count:1", + "└─IndexLookUp_16 0.00 1951.83 root ", " ├─TopN_15(Build) 0.00 206.70 cop[tikv] test.t.a, offset:0, count:1", " │ └─IndexRangeScan_13 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", " └─TableRowIDScan_14(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" @@ -2101,7 +2102,7 @@ { "SQL": "explain format = 'verbose' select * from t where b = 6 limit 1", "Plan": [ - "IndexLookUp_13 0.00 18.97 root limit embedded(offset:0, count:1)", + "IndexLookUp_13 0.00 1170.97 root limit embedded(offset:0, count:1)", "├─Limit_12(Build) 0.00 203.50 cop[tikv] offset:0, count:1", "│ └─IndexRangeScan_10 0.00 203.50 cop[tikv] table:t, index:idx_b(b) range:[6,6], keep order:false", "└─TableRowIDScan_11(Probe) 0.00 186.61 cop[tikv] table:t keep order:false" @@ -2527,12 +2528,10 @@ { "SQL": "explain format = 'verbose' select * from t3 order by b limit 1", "Plan": [ - "Limit_12 1.00 19.17 root offset:0, count:1", - "└─Projection_23 1.00 19.17 root test.t3.a, test.t3.b", - " └─IndexLookUp_22 1.00 18.97 root ", - " ├─Limit_21(Build) 1.00 203.50 cop[tikv] offset:0, count:1", - " │ └─IndexFullScan_19 1.00 203.50 cop[tikv] table:t3, index:c(b) keep order:true", - " └─TableRowIDScan_20(Probe) 1.00 186.61 cop[tikv] table:t3 keep order:false" + "TopN_7 1.00 53.10 root test.t3.b, offset:0, count:1", + "└─TableReader_16 1.00 49.90 root data:TopN_15", + " └─TopN_15 1.00 685.12 cop[tikv] test.t3.b, offset:0, count:1", + " └─TableFullScan_14 3.00 681.92 cop[tikv] table:t3 keep order:false" ] }, { @@ -2554,8 +2553,8 @@ { "SQL": "explain format = 'verbose' select /*+ use_index(t3, c) */ count(a) from t3 where b = 0", "Plan": [ - "StreamAgg_10 1.00 81.63 root funcs:count(test.t3.a)->Column#4", - "└─IndexLookUp_17 0.00 31.73 root ", + "StreamAgg_10 1.00 2001.63 root funcs:count(test.t3.a)->Column#4", + "└─IndexLookUp_17 0.00 1951.73 root ", " ├─IndexRangeScan_15(Build) 0.00 203.50 cop[tikv] table:t3, index:c(b) range:[0,0], keep order:false", " └─TableRowIDScan_16(Probe) 0.00 227.31 cop[tikv] table:t3 keep order:false" ] diff --git a/statistics/testdata/stats_suite_out.json b/statistics/testdata/stats_suite_out.json index def2cf2f50c1b..a78fafe87ade9 100644 --- a/statistics/testdata/stats_suite_out.json +++ b/statistics/testdata/stats_suite_out.json @@ -155,247 +155,244 @@ "test ct2 PRIMARY 1 1 6 1 (6, 6) (8, 8) 0" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:singular(a) range:[1,1], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.a, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:singular(a) range:[4,4], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.a, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:singular(a) range:[8,8], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.a, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:singular(a) range:[1,1], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.a, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:singular(a) range:[4,4], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.a, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:singular(a) range:[8,8], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.a, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:singular(a) range:[1.00000000000000000000,1.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.a, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:singular(a) range:[4.00000000000000000000,4.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.a, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:singular(a) range:[8.00000000000000000000,8.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.a, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:singular(a) range:[\"1\",\"1\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.a, \"1\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:singular(a) range:[\"4\",\"4\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.a, \"4\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:singular(a) range:[\"8\",\"8\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.a, \"8\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:singular(a) range:[2001-01-01 00:00:00,2001-01-01 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.a, 2001-01-01 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:singular(a) range:[2001-01-02 00:00:00,2001-01-02 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.a, 2001-01-02 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:singular(a) range:[2001-01-04 00:00:00,2001-01-04 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.a, 2001-01-04 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_11 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tprefix, index:prefixa(a) range:[\"11\",\"11\"], keep order:false", - "└─Selection_10(Probe) 1.00 cop[tikv] eq(test.tprefix.a, \"111\")", - " └─TableRowIDScan_9 1.00 cop[tikv] table:tprefix keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tprefix.a, \"111\")", + " └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false" ], [ - "IndexLookUp_11 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tprefix, index:prefixa(a) range:[\"44\",\"44\"], keep order:false", - "└─Selection_10(Probe) 1.00 cop[tikv] eq(test.tprefix.a, \"444\")", - " └─TableRowIDScan_9 1.00 cop[tikv] table:tprefix keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tprefix.a, \"444\")", + " └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false" ], [ - "IndexLookUp_11 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tprefix, index:prefixa(a) range:[\"88\",\"88\"], keep order:false", - "└─Selection_10(Probe) 1.00 cop[tikv] eq(test.tprefix.a, \"888\")", - " └─TableRowIDScan_9 1.00 cop[tikv] table:tprefix keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tprefix.a, \"888\")", + " └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[1 1,1 1], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 1), eq(test.tint.c, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[4 4,4 4], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 4), eq(test.tint.c, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[8 8,8 8], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 8), eq(test.tint.c, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[1 1,1 1], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 1), eq(test.tdouble.c, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[4 4,4 4], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 4), eq(test.tdouble.c, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[8 8,8 8], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 8), eq(test.tdouble.c, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[1.00000000000000000000 1.00000000000000000000,1.00000000000000000000 1.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 1), eq(test.tdecimal.c, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[4.00000000000000000000 4.00000000000000000000,4.00000000000000000000 4.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 4), eq(test.tdecimal.c, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[8.00000000000000000000 8.00000000000000000000,8.00000000000000000000 8.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 8), eq(test.tdecimal.c, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"1\" \"1\",\"1\" \"1\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"1\"), eq(test.tstring.c, \"1\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"4\" \"4\",\"4\" \"4\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"4\"), eq(test.tstring.c, \"4\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"8\" \"8\",\"8\" \"8\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"8\"), eq(test.tstring.c, \"8\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-01 00:00:00 2001-01-01 00:00:00,2001-01-01 00:00:00 2001-01-01 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-01 00:00:00.000000), eq(test.tdatetime.c, 2001-01-01 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-02 00:00:00 2001-01-02 00:00:00,2001-01-02 00:00:00 2001-01-02 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-02 00:00:00.000000), eq(test.tdatetime.c, 2001-01-02 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-04 00:00:00 2001-01-04 00:00:00,2001-01-04 00:00:00 2001-01-04 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-04 00:00:00.000000), eq(test.tdatetime.c, 2001-01-04 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[1,1], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[4,4], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tint, index:multi(b, c) range:[8,8], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tint keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tint.b, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[1,1], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[4,4], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdouble, index:multi(b, c) range:[8,8], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdouble keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdouble.b, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[1.00000000000000000000,1.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 1)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[4.00000000000000000000,4.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 4)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdecimal, index:multi(b, c) range:[8.00000000000000000000,8.00000000000000000000], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdecimal keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdecimal.b, 8)", + " └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"1\",\"1\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"1\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"4\",\"4\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"4\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tstring, index:multi(b, c) range:[\"8\",\"8\"], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tstring keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tstring.b, \"8\")", + " └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-01 00:00:00,2001-01-01 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-01 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-02 00:00:00,2001-01-02 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-02 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ - "IndexLookUp_10 1.00 root ", - "├─IndexRangeScan_8(Build) 1.00 cop[tikv] table:tdatetime, index:multi(b, c) range:[2001-01-04 00:00:00,2001-01-04 00:00:00], keep order:false", - "└─TableRowIDScan_9(Probe) 1.00 cop[tikv] table:tdatetime keep order:false" + "TableReader_7 1.00 root data:Selection_6", + "└─Selection_6 1.00 cop[tikv] eq(test.tdatetime.b, 2001-01-04 00:00:00.000000)", + " └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false" ], [ "TableReader_6 5.00 root data:TableRangeScan_5",