From 46baaae20c220314bb5d6e03f4d53f0676a50594 Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Sun, 29 Sep 2019 17:45:16 +0800 Subject: [PATCH 1/9] support a hint to read from tiflash in planner --- bindinfo/bind_test.go | 56 ++++---- .../r/access_path_selection.result | 24 ++-- cmd/explaintest/r/black_list.result | 22 +-- .../r/explain-non-select-stmt.result | 12 +- cmd/explaintest/r/explain.result | 4 +- cmd/explaintest/r/explain_complex.result | 90 ++++++------- .../r/explain_complex_stats.result | 68 +++++----- executor/aggregate_test.go | 6 +- executor/analyze_test.go | 6 +- executor/explainfor_test.go | 2 +- executor/join_test.go | 12 +- executor/merge_join_test.go | 8 +- executor/seqtest/seq_executor_test.go | 2 +- expression/aggregation/aggregation.go | 9 ++ expression/constant_fold_test.go | 2 +- expression/constant_propagation_test.go | 126 +++++++++--------- expression/expression.go | 26 ++++ expression/integration_test.go | 6 +- planner/cascades/integration_test.go | 4 +- planner/core/cbo_test.go | 86 ++++++------ planner/core/common_plans.go | 24 +++- planner/core/exhaust_physical_plans.go | 2 +- planner/core/find_best_task.go | 11 ++ planner/core/logical_plan_builder.go | 27 +++- planner/core/logical_plans.go | 4 + planner/core/physical_plans.go | 2 + planner/core/planbuilder.go | 5 + planner/core/rule_predicate_push_down.go | 4 + planner/core/task.go | 41 +++++- planner/core/testdata/analyze_suite_out.json | 60 ++++----- .../core/testdata/integration_suite_out.json | 28 ++-- statistics/selectivity_test.go | 38 +++--- util/ranger/ranger_test.go | 4 +- util/ranger/testdata/ranger_suite_out.json | 6 +- 34 files changed, 477 insertions(+), 350 deletions(-) diff --git a/bindinfo/bind_test.go b/bindinfo/bind_test.go index 7cf81d31907eb..01405ab2eaa3c 100644 --- a/bindinfo/bind_test.go +++ b/bindinfo/bind_test.go @@ -330,23 +330,23 @@ func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) { tk.MustQuery("explain SELECT * from t1,t2 where t1.id = t2.id").Check(testkit.Rows( "HashLeftJoin_8 12487.50 root inner join, inner:TableReader_15, equal:[eq(Column#1, Column#3)]", "├─TableReader_12 9990.00 root data:Selection_11", - "│ └─Selection_11 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_11 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_15 9990.00 root data:Selection_14", - " └─Selection_14 9990.00 cop not(isnull(Column#3))", - " └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_14 9990.00 cop[tikv] not(isnull(Column#3))", + " └─TableScan_13 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain SELECT /*+ TIDB_SMJ(t1, t2) */ * from t1,t2 where t1.id = t2.id").Check(testkit.Rows( "MergeJoin_7 12487.50 root inner join, left key:Column#1, right key:Column#3", "├─Sort_11 9990.00 root Column#1:asc", "│ └─TableReader_10 9990.00 root data:Selection_9", - "│ └─Selection_9 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─Sort_15 9990.00 root Column#3:asc", " └─TableReader_14 9990.00 root data:Selection_13", - " └─Selection_13 9990.00 cop not(isnull(Column#3))", - " └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_13 9990.00 cop[tikv] not(isnull(Column#3))", + " └─TableScan_12 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustExec("create global binding for SELECT * from t1,t2 where t1.id = t2.id using SELECT /*+ TIDB_SMJ(t1, t2) */ * from t1,t2 where t1.id = t2.id") @@ -356,12 +356,12 @@ func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) { "MergeJoin_7 12487.50 root inner join, left key:Column#1, right key:Column#3", "├─Sort_11 9990.00 root Column#1:asc", "│ └─TableReader_10 9990.00 root data:Selection_9", - "│ └─Selection_9 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─Sort_15 9990.00 root Column#3:asc", " └─TableReader_14 9990.00 root data:Selection_13", - " └─Selection_13 9990.00 cop not(isnull(Column#3))", - " └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_13 9990.00 cop[tikv] not(isnull(Column#3))", + " └─TableScan_12 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) pb := &dto.Metric{} metrics.BindUsageCounter.WithLabelValues(metrics.ScopeGlobal).Write(pb) @@ -372,11 +372,11 @@ func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) { tk.MustQuery("explain SELECT * from t1,t2 where t1.id = t2.id").Check(testkit.Rows( "HashLeftJoin_8 12487.50 root inner join, inner:TableReader_15, equal:[eq(Column#1, Column#3)]", "├─TableReader_12 9990.00 root data:Selection_11", - "│ └─Selection_11 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_11 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_15 9990.00 root data:Selection_14", - " └─Selection_14 9990.00 cop not(isnull(Column#3))", - " └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_14 9990.00 cop[tikv] not(isnull(Column#3))", + " └─TableScan_13 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) } @@ -392,23 +392,23 @@ func (s *testSuite) TestExplain(c *C) { tk.MustQuery("explain SELECT * from t1,t2 where t1.id = t2.id").Check(testkit.Rows( "HashLeftJoin_8 12487.50 root inner join, inner:TableReader_15, equal:[eq(Column#1, Column#3)]", "├─TableReader_12 9990.00 root data:Selection_11", - "│ └─Selection_11 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_11 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_15 9990.00 root data:Selection_14", - " └─Selection_14 9990.00 cop not(isnull(Column#3))", - " └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_14 9990.00 cop[tikv] not(isnull(Column#3))", + " └─TableScan_13 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain SELECT /*+ TIDB_SMJ(t1, t2) */ * from t1,t2 where t1.id = t2.id").Check(testkit.Rows( "MergeJoin_7 12487.50 root inner join, left key:Column#1, right key:Column#3", "├─Sort_11 9990.00 root Column#1:asc", "│ └─TableReader_10 9990.00 root data:Selection_9", - "│ └─Selection_9 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─Sort_15 9990.00 root Column#3:asc", " └─TableReader_14 9990.00 root data:Selection_13", - " └─Selection_13 9990.00 cop not(isnull(Column#3))", - " └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_13 9990.00 cop[tikv] not(isnull(Column#3))", + " └─TableScan_12 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustExec("create global binding for SELECT * from t1,t2 where t1.id = t2.id using SELECT /*+ TIDB_SMJ(t1, t2) */ * from t1,t2 where t1.id = t2.id") @@ -417,12 +417,12 @@ func (s *testSuite) TestExplain(c *C) { "MergeJoin_7 12487.50 root inner join, left key:Column#1, right key:Column#3", "├─Sort_11 9990.00 root Column#1:asc", "│ └─TableReader_10 9990.00 root data:Selection_9", - "│ └─Selection_9 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─Sort_15 9990.00 root Column#3:asc", " └─TableReader_14 9990.00 root data:Selection_13", - " └─Selection_13 9990.00 cop not(isnull(Column#3))", - " └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_13 9990.00 cop[tikv] not(isnull(Column#3))", + " └─TableScan_12 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustExec("drop global binding for SELECT * from t1,t2 where t1.id = t2.id") diff --git a/cmd/explaintest/r/access_path_selection.result b/cmd/explaintest/r/access_path_selection.result index f0ebbfd030ea9..4db0a3d73adc8 100644 --- a/cmd/explaintest/r/access_path_selection.result +++ b/cmd/explaintest/r/access_path_selection.result @@ -8,37 +8,37 @@ KEY `IDX_ab` (`a`, `b`) explain select a from access_path_selection where a < 3; id count task operator info IndexReader_6 3323.33 root index:IndexScan_5 -└─IndexScan_5 3323.33 cop table:access_path_selection, index:a, range:[-inf,3), keep order:false, stats:pseudo +└─IndexScan_5 3323.33 cop[tikv] table:access_path_selection, index:a, range:[-inf,3), keep order:false, stats:pseudo explain select a, b from access_path_selection where a < 3; id count task operator info IndexReader_6 3323.33 root index:IndexScan_5 -└─IndexScan_5 3323.33 cop table:access_path_selection, index:a, b, range:[-inf,3), keep order:false, stats:pseudo +└─IndexScan_5 3323.33 cop[tikv] table:access_path_selection, index:a, b, range:[-inf,3), keep order:false, stats:pseudo explain select a, b from access_path_selection where b < 3; id count task operator info IndexReader_13 3323.33 root index:Selection_12 -└─Selection_12 3323.33 cop lt(Column#2, 3) - └─IndexScan_11 10000.00 cop table:access_path_selection, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_12 3323.33 cop[tikv] lt(Column#2, 3) + └─IndexScan_11 10000.00 cop[tikv] table:access_path_selection, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo explain select a, b from access_path_selection where a < 3 and b < 3; id count task operator info IndexReader_11 1104.45 root index:Selection_10 -└─Selection_10 1104.45 cop lt(Column#2, 3) - └─IndexScan_9 3323.33 cop table:access_path_selection, index:a, b, range:[-inf,3), keep order:false, stats:pseudo +└─Selection_10 1104.45 cop[tikv] lt(Column#2, 3) + └─IndexScan_9 3323.33 cop[tikv] table:access_path_selection, index:a, b, range:[-inf,3), keep order:false, stats:pseudo explain select a, b from access_path_selection where a > 10 order by _tidb_rowid; id count task operator info Projection_6 3333.33 root Column#1, Column#2 └─TableReader_13 3333.33 root data:Selection_12 - └─Selection_12 3333.33 cop gt(Column#1, 10) - └─TableScan_11 10000.00 cop table:access_path_selection, range:[-inf,+inf], keep order:true, stats:pseudo + └─Selection_12 3333.33 cop[tikv] gt(Column#1, 10) + └─TableScan_11 10000.00 cop[tikv] table:access_path_selection, range:[-inf,+inf], keep order:true, stats:pseudo explain select max(_tidb_rowid) from access_path_selection; id count task operator info StreamAgg_13 1.00 root funcs:max(Column#3) └─Limit_17 1.00 root offset:0, count:1 └─TableReader_27 1.00 root data:Limit_26 - └─Limit_26 1.00 cop offset:0, count:1 - └─TableScan_25 1.25 cop table:access_path_selection, range:[-inf,+inf], keep order:true, desc, stats:pseudo + └─Limit_26 1.00 cop[tikv] offset:0, count:1 + └─TableScan_25 1.25 cop[tikv] table:access_path_selection, range:[-inf,+inf], keep order:true, desc, stats:pseudo explain select count(1) from access_path_selection; id count task operator info StreamAgg_28 1.00 root funcs:count(Column#7) └─IndexReader_29 1.00 root index:StreamAgg_8 - └─StreamAgg_8 1.00 cop funcs:count(1) - └─IndexScan_25 10000.00 cop table:access_path_selection, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + └─StreamAgg_8 1.00 cop[tikv] funcs:count(1) + └─IndexScan_25 10000.00 cop[tikv] table:access_path_selection, index:a, range:[NULL,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/black_list.result b/cmd/explaintest/r/black_list.result index 17b11a02c8bab..991e6c2af5fab 100644 --- a/cmd/explaintest/r/black_list.result +++ b/cmd/explaintest/r/black_list.result @@ -4,8 +4,8 @@ create table t (a int); explain select * from t where a < 1; id count task operator info TableReader_7 3323.33 root data:Selection_6 -└─Selection_6 3323.33 cop lt(Column#1, 1) - └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_6 3323.33 cop[tikv] lt(Column#1, 1) + └─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo insert into mysql.opt_rule_blacklist values('predicate_push_down'); admin reload opt_rule_blacklist; @@ -13,15 +13,15 @@ explain select * from t where a < 1; id count task operator info Selection_5 8000.00 root lt(Column#1, 1) └─TableReader_7 10000.00 root data:TableScan_6 - └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo delete from mysql.opt_rule_blacklist where name='predicate_push_down'; admin reload opt_rule_blacklist; explain select * from t where a < 1; id count task operator info TableReader_7 3323.33 root data:Selection_6 -└─Selection_6 3323.33 cop lt(Column#1, 1) - └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_6 3323.33 cop[tikv] lt(Column#1, 1) + └─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo insert into mysql.expr_pushdown_blacklist values('<'); admin reload expr_pushdown_blacklist; @@ -29,15 +29,15 @@ explain select * from t where a < 1; id count task operator info Selection_5 8000.00 root lt(Column#1, 1) └─TableReader_7 10000.00 root data:TableScan_6 - └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo delete from mysql.expr_pushdown_blacklist where name='<'; admin reload expr_pushdown_blacklist; explain select * from t where a < 1; id count task operator info TableReader_7 3323.33 root data:Selection_6 -└─Selection_6 3323.33 cop lt(Column#1, 1) - └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_6 3323.33 cop[tikv] lt(Column#1, 1) + └─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo insert into mysql.expr_pushdown_blacklist values('lt'); admin reload expr_pushdown_blacklist; @@ -45,12 +45,12 @@ explain select * from t where a < 1; id count task operator info Selection_5 8000.00 root lt(Column#1, 1) └─TableReader_7 10000.00 root data:TableScan_6 - └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo delete from mysql.expr_pushdown_blacklist where name='lt'; admin reload expr_pushdown_blacklist; explain select * from t where a < 1; id count task operator info TableReader_7 3323.33 root data:Selection_6 -└─Selection_6 3323.33 cop lt(Column#1, 1) - └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_6 3323.33 cop[tikv] lt(Column#1, 1) + └─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/explain-non-select-stmt.result b/cmd/explaintest/r/explain-non-select-stmt.result index 746250bf2d319..b2a5eee57d0b7 100644 --- a/cmd/explaintest/r/explain-non-select-stmt.result +++ b/cmd/explaintest/r/explain-non-select-stmt.result @@ -8,22 +8,22 @@ explain insert into t select * from t; id count task operator info Insert_1 N/A root N/A └─TableReader_7 10000.00 root data:TableScan_6 - └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain delete from t where a > 100; id count task operator info Delete_3 N/A root N/A └─TableReader_6 3333.33 root data:Selection_5 - └─Selection_5 3333.33 cop gt(Column#1, 100) - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_5 3333.33 cop[tikv] gt(Column#1, 100) + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain update t set b = 100 where a = 200; id count task operator info Update_3 N/A root N/A └─TableReader_6 10.00 root data:Selection_5 - └─Selection_5 10.00 cop eq(Column#1, 200) - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_5 10.00 cop[tikv] eq(Column#1, 200) + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain replace into t select a, 100 from t; id count task operator info Insert_1 N/A root N/A └─Projection_5 10000.00 root Column#3, 100 └─TableReader_7 10000.00 root data:TableScan_6 - └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/explain.result b/cmd/explaintest/r/explain.result index 84ba2af91f948..201b0de780ed4 100644 --- a/cmd/explaintest/r/explain.result +++ b/cmd/explaintest/r/explain.result @@ -31,11 +31,11 @@ id count task operator info StreamAgg_8 8000.00 root group by:Column#6, funcs:group_concat(Column#0, ",") └─Projection_18 10000.00 root cast(Column#2), Column#1 └─TableReader_15 10000.00 root data:TableScan_14 - └─TableScan_14 10000.00 cop table:t, range:[-inf,+inf], keep order:true, stats:pseudo + └─TableScan_14 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:true, stats:pseudo explain select group_concat(a, b) from t group by id; id count task operator info StreamAgg_8 8000.00 root group by:Column#6, funcs:group_concat(Column#0, Column#0, ",") └─Projection_18 10000.00 root cast(Column#2), cast(Column#3), Column#1 └─TableReader_15 10000.00 root data:TableScan_14 - └─TableScan_14 10000.00 cop table:t, range:[-inf,+inf], keep order:true, stats:pseudo + └─TableScan_14 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:true, stats:pseudo drop table t; diff --git a/cmd/explaintest/r/explain_complex.result b/cmd/explaintest/r/explain_complex.result index 5be5f623f3cd5..a9548910328a2 100644 --- a/cmd/explaintest/r/explain_complex.result +++ b/cmd/explaintest/r/explain_complex.result @@ -109,10 +109,10 @@ Projection_7 53.00 root Column#7, Column#11, Column#12, Column#13, Column#14, Co └─Sort_8 53.00 root Column#8:desc └─HashAgg_16 53.00 root group by:Column#52, Column#53, Column#54, Column#55, Column#56, Column#57, Column#58, Column#59, funcs:count(Column#42), firstrow(Column#52), firstrow(Column#44), firstrow(Column#53), firstrow(Column#54), firstrow(Column#55), firstrow(Column#56), firstrow(Column#57), firstrow(Column#58), firstrow(Column#59) └─IndexLookUp_17 53.00 root - ├─IndexScan_13 2650.00 cop table:dt, index:cm, range:[1062,1062], [1086,1086], [1423,1423], [1424,1424], [1425,1425], [1426,1426], [1427,1427], [1428,1428], [1429,1429], [1430,1430], [1431,1431], [1432,1432], [1433,1433], [1434,1434], [1435,1435], [1436,1436], [1437,1437], [1438,1438], [1439,1439], [1440,1440], [1441,1441], [1442,1442], [1443,1443], [1444,1444], [1445,1445], [1446,1446], [1447,1447], [1448,1448], [1449,1449], [1450,1450], [1451,1451], [1452,1452], [1488,1488], [1489,1489], [1490,1490], [1491,1491], [1492,1492], [1493,1493], [1494,1494], [1495,1495], [1496,1496], [1497,1497], [1550,1550], [1551,1551], [1552,1552], [1553,1553], [1554,1554], [1555,1555], [1556,1556], [1557,1557], [1558,1558], [1559,1559], [1597,1597], [1598,1598], [1599,1599], [1600,1600], [1601,1601], [1602,1602], [1603,1603], [1604,1604], [1605,1605], [1606,1606], [1607,1607], [1608,1608], [1609,1609], [1610,1610], [1611,1611], [1612,1612], [1613,1613], [1614,1614], [1615,1615], [1616,1616], [1623,1623], [1624,1624], [1625,1625], [1626,1626], [1627,1627], [1628,1628], [1629,1629], [1630,1630], [1631,1631], [1632,1632], [1709,1709], [1719,1719], [1720,1720], [1843,1843], [2813,2813], [2814,2814], [2815,2815], [2816,2816], [2817,2817], [2818,2818], [2819,2819], [2820,2820], [2821,2821], [2822,2822], [2823,2823], [2824,2824], [2825,2825], [2826,2826], [2827,2827], [2828,2828], [2829,2829], [2830,2830], [2831,2831], [2832,2832], [2833,2833], [2834,2834], [2835,2835], [2836,2836], [2837,2837], [2838,2838], [2839,2839], [2840,2840], [2841,2841], [2842,2842], [2843,2843], [2844,2844], [2845,2845], [2846,2846], [2847,2847], [2848,2848], [2849,2849], [2850,2850], [2851,2851], [2852,2852], [2853,2853], [2854,2854], [2855,2855], [2856,2856], [2857,2857], [2858,2858], [2859,2859], [2860,2860], [2861,2861], [2862,2862], [2863,2863], [2864,2864], [2865,2865], [2866,2866], [2867,2867], [2868,2868], [2869,2869], [2870,2870], [2871,2871], [2872,2872], [3139,3139], [3140,3140], [3141,3141], [3142,3142], [3143,3143], [3144,3144], [3145,3145], [3146,3146], [3147,3147], [3148,3148], [3149,3149], [3150,3150], [3151,3151], [3152,3152], [3153,3153], [3154,3154], [3155,3155], [3156,3156], [3157,3157], [3158,3158], [3386,3386], [3387,3387], [3388,3388], [3389,3389], [3390,3390], [3391,3391], [3392,3392], [3393,3393], [3394,3394], [3395,3395], [3664,3664], [3665,3665], [3666,3666], [3667,3667], [3668,3668], [3670,3670], [3671,3671], [3672,3672], [3673,3673], [3674,3674], [3676,3676], [3677,3677], [3678,3678], [3679,3679], [3680,3680], [3681,3681], [3682,3682], [3683,3683], [3684,3684], [3685,3685], [3686,3686], [3687,3687], [3688,3688], [3689,3689], [3690,3690], [3691,3691], [3692,3692], [3693,3693], [3694,3694], [3695,3695], [3696,3696], [3697,3697], [3698,3698], [3699,3699], [3700,3700], [3701,3701], [3702,3702], [3703,3703], [3704,3704], [3705,3705], [3706,3706], [3707,3707], [3708,3708], [3709,3709], [3710,3710], [3711,3711], [3712,3712], [3713,3713], [3714,3714], [3715,3715], [3960,3960], [3961,3961], [3962,3962], [3963,3963], [3964,3964], [3965,3965], [3966,3966], [3967,3967], [3968,3968], [3978,3978], [3979,3979], [3980,3980], [3981,3981], [3982,3982], [3983,3983], [3984,3984], [3985,3985], [3986,3986], [3987,3987], [4208,4208], [4209,4209], [4210,4210], [4211,4211], [4212,4212], [4304,4304], [4305,4305], [4306,4306], [4307,4307], [4308,4308], [4866,4866], [4867,4867], [4868,4868], [4869,4869], [4870,4870], [4871,4871], [4872,4872], [4873,4873], [4874,4874], [4875,4875], keep order:false, stats:pseudo - └─HashAgg_11 53.00 cop group by:Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17, Column#7, funcs:count(Column#5), firstrow(Column#8) - └─Selection_15 66.25 cop ge(Column#7, 2016-09-01 00:00:00.000000), le(Column#7, 2016-11-03 00:00:00.000000) - └─TableScan_14 2650.00 cop table:dt, keep order:false, stats:pseudo + ├─IndexScan_13 2650.00 cop[tikv] table:dt, index:cm, range:[1062,1062], [1086,1086], [1423,1423], [1424,1424], [1425,1425], [1426,1426], [1427,1427], [1428,1428], [1429,1429], [1430,1430], [1431,1431], [1432,1432], [1433,1433], [1434,1434], [1435,1435], [1436,1436], [1437,1437], [1438,1438], [1439,1439], [1440,1440], [1441,1441], [1442,1442], [1443,1443], [1444,1444], [1445,1445], [1446,1446], [1447,1447], [1448,1448], [1449,1449], [1450,1450], [1451,1451], [1452,1452], [1488,1488], [1489,1489], [1490,1490], [1491,1491], [1492,1492], [1493,1493], [1494,1494], [1495,1495], [1496,1496], [1497,1497], [1550,1550], [1551,1551], [1552,1552], [1553,1553], [1554,1554], [1555,1555], [1556,1556], [1557,1557], [1558,1558], [1559,1559], [1597,1597], [1598,1598], [1599,1599], [1600,1600], [1601,1601], [1602,1602], [1603,1603], [1604,1604], [1605,1605], [1606,1606], [1607,1607], [1608,1608], [1609,1609], [1610,1610], [1611,1611], [1612,1612], [1613,1613], [1614,1614], [1615,1615], [1616,1616], [1623,1623], [1624,1624], [1625,1625], [1626,1626], [1627,1627], [1628,1628], [1629,1629], [1630,1630], [1631,1631], [1632,1632], [1709,1709], [1719,1719], [1720,1720], [1843,1843], [2813,2813], [2814,2814], [2815,2815], [2816,2816], [2817,2817], [2818,2818], [2819,2819], [2820,2820], [2821,2821], [2822,2822], [2823,2823], [2824,2824], [2825,2825], [2826,2826], [2827,2827], [2828,2828], [2829,2829], [2830,2830], [2831,2831], [2832,2832], [2833,2833], [2834,2834], [2835,2835], [2836,2836], [2837,2837], [2838,2838], [2839,2839], [2840,2840], [2841,2841], [2842,2842], [2843,2843], [2844,2844], [2845,2845], [2846,2846], [2847,2847], [2848,2848], [2849,2849], [2850,2850], [2851,2851], [2852,2852], [2853,2853], [2854,2854], [2855,2855], [2856,2856], [2857,2857], [2858,2858], [2859,2859], [2860,2860], [2861,2861], [2862,2862], [2863,2863], [2864,2864], [2865,2865], [2866,2866], [2867,2867], [2868,2868], [2869,2869], [2870,2870], [2871,2871], [2872,2872], [3139,3139], [3140,3140], [3141,3141], [3142,3142], [3143,3143], [3144,3144], [3145,3145], [3146,3146], [3147,3147], [3148,3148], [3149,3149], [3150,3150], [3151,3151], [3152,3152], [3153,3153], [3154,3154], [3155,3155], [3156,3156], [3157,3157], [3158,3158], [3386,3386], [3387,3387], [3388,3388], [3389,3389], [3390,3390], [3391,3391], [3392,3392], [3393,3393], [3394,3394], [3395,3395], [3664,3664], [3665,3665], [3666,3666], [3667,3667], [3668,3668], [3670,3670], [3671,3671], [3672,3672], [3673,3673], [3674,3674], [3676,3676], [3677,3677], [3678,3678], [3679,3679], [3680,3680], [3681,3681], [3682,3682], [3683,3683], [3684,3684], [3685,3685], [3686,3686], [3687,3687], [3688,3688], [3689,3689], [3690,3690], [3691,3691], [3692,3692], [3693,3693], [3694,3694], [3695,3695], [3696,3696], [3697,3697], [3698,3698], [3699,3699], [3700,3700], [3701,3701], [3702,3702], [3703,3703], [3704,3704], [3705,3705], [3706,3706], [3707,3707], [3708,3708], [3709,3709], [3710,3710], [3711,3711], [3712,3712], [3713,3713], [3714,3714], [3715,3715], [3960,3960], [3961,3961], [3962,3962], [3963,3963], [3964,3964], [3965,3965], [3966,3966], [3967,3967], [3968,3968], [3978,3978], [3979,3979], [3980,3980], [3981,3981], [3982,3982], [3983,3983], [3984,3984], [3985,3985], [3986,3986], [3987,3987], [4208,4208], [4209,4209], [4210,4210], [4211,4211], [4212,4212], [4304,4304], [4305,4305], [4306,4306], [4307,4307], [4308,4308], [4866,4866], [4867,4867], [4868,4868], [4869,4869], [4870,4870], [4871,4871], [4872,4872], [4873,4873], [4874,4874], [4875,4875], keep order:false, stats:pseudo + └─HashAgg_11 53.00 cop[tikv] group by:Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17, Column#7, funcs:count(Column#5), firstrow(Column#8) + └─Selection_15 66.25 cop[tikv] ge(Column#7, 2016-09-01 00:00:00.000000), le(Column#7, 2016-11-03 00:00:00.000000) + └─TableScan_14 2650.00 cop[tikv] table:dt, keep order:false, stats:pseudo explain select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext, gad.t as gtime from st gad join (select id, aid, pt, dic, ip, t from dd where pt = 'android' and bm = 0 and t > 1478143908) sdk on gad.aid = sdk.aid and gad.ip = sdk.ip and sdk.t > gad.t where gad.t > 1478143908 and gad.pt = 'android' group by gad.aid, sdk.dic limit 2500; id count task operator info Projection_13 1.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Column#26, Column#27, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#15, Column#19 @@ -120,54 +120,54 @@ Projection_13 1.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Colu └─HashAgg_19 1.00 root group by:Column#23, Column#3, funcs:firstrow(Column#1), firstrow(Column#3), firstrow(Column#4), firstrow(Column#8), firstrow(Column#9), firstrow(Column#10), firstrow(Column#11), firstrow(Column#12), firstrow(Column#13), firstrow(Column#14), firstrow(Column#15), firstrow(Column#19), firstrow(Column#20), firstrow(Column#23), firstrow(Column#26), firstrow(Column#27) └─IndexMergeJoin_30 0.00 root inner join, inner:IndexLookUp_28, outer key:Column#3, inner key:Column#21, other cond:eq(Column#26, Column#5), gt(Column#27, Column#19) ├─IndexLookUp_28 0.00 root - │ ├─IndexScan_25 0.00 cop table:dd, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true, stats:pseudo - │ └─Selection_27 0.00 cop eq(Column#22, "android"), eq(Column#28, 0), gt(Column#27, 1478143908), not(isnull(Column#26)), not(isnull(Column#27)) - │ └─TableScan_26 0.00 cop table:dd, keep order:false, stats:pseudo + │ ├─IndexScan_25 0.00 cop[tikv] table:dd, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true, stats:pseudo + │ └─Selection_27 0.00 cop[tikv] eq(Column#22, "android"), eq(Column#28, 0), gt(Column#27, 1478143908), not(isnull(Column#26)), not(isnull(Column#27)) + │ └─TableScan_26 0.00 cop[tikv] table:dd, keep order:false, stats:pseudo └─IndexLookUp_41 3.33 root - ├─IndexScan_38 3333.33 cop table:gad, index:t, range:(1478143908,+inf], keep order:false, stats:pseudo - └─Selection_40 3.33 cop eq(Column#2, "android"), not(isnull(Column#5)) - └─TableScan_39 3333.33 cop table:gad, keep order:false, stats:pseudo + ├─IndexScan_38 3333.33 cop[tikv] table:gad, index:t, range:(1478143908,+inf], keep order:false, stats:pseudo + └─Selection_40 3.33 cop[tikv] eq(Column#2, "android"), not(isnull(Column#5)) + └─TableScan_39 3333.33 cop[tikv] table:gad, keep order:false, stats:pseudo explain select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext from st gad join dd sdk on gad.aid = sdk.aid and gad.dic = sdk.mac and gad.t < sdk.t where gad.t > 1477971479 and gad.bm = 0 and gad.pt = 'ios' and gad.dit = 'mac' and sdk.t > 1477971479 and sdk.bm = 0 and sdk.pt = 'ios' limit 3000; id count task operator info Projection_10 0.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Column#26, Column#27, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#15 └─Limit_13 0.00 root offset:0, count:3000 └─IndexMergeJoin_24 0.00 root inner join, inner:IndexLookUp_22, outer key:Column#3, inner key:Column#21, other cond:eq(Column#6, Column#25), lt(Column#19, Column#27) ├─IndexLookUp_35 0.00 root - │ ├─IndexScan_32 3333.33 cop table:gad, index:t, range:(1477971479,+inf], keep order:false, stats:pseudo - │ └─Selection_34 0.00 cop eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), not(isnull(Column#6)) - │ └─TableScan_33 3333.33 cop table:gad, keep order:false, stats:pseudo + │ ├─IndexScan_32 3333.33 cop[tikv] table:gad, index:t, range:(1477971479,+inf], keep order:false, stats:pseudo + │ └─Selection_34 0.00 cop[tikv] eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), not(isnull(Column#6)) + │ └─TableScan_33 3333.33 cop[tikv] table:gad, keep order:false, stats:pseudo └─IndexLookUp_22 0.00 root - ├─IndexScan_19 0.00 cop table:sdk, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true, stats:pseudo - └─Selection_21 0.00 cop eq(Column#22, "ios"), eq(Column#28, 0), gt(Column#27, 1477971479), not(isnull(Column#25)), not(isnull(Column#27)) - └─TableScan_20 0.00 cop table:sdk, keep order:false, stats:pseudo + ├─IndexScan_19 0.00 cop[tikv] table:sdk, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true, stats:pseudo + └─Selection_21 0.00 cop[tikv] eq(Column#22, "ios"), eq(Column#28, 0), gt(Column#27, 1477971479), not(isnull(Column#25)), not(isnull(Column#27)) + └─TableScan_20 0.00 cop[tikv] table:sdk, keep order:false, stats:pseudo explain SELECT cm, p1, p2, p3, p4, p5, p6_md5, p7_md5, count(1) as click_pv, count(DISTINCT ip) as click_ip FROM st WHERE (t between 1478188800 and 1478275200) and aid='cn.sbkcq' and pt='android' GROUP BY cm, p1, p2, p3, p4, p5, p6_md5, p7_md5; id count task operator info Projection_5 1.00 root Column#4, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#20, Column#21 └─HashAgg_7 1.00 root group by:Column#10, Column#11, Column#12, Column#13, Column#14, Column#4, Column#8, Column#9, funcs:count(1), count(distinct Column#5), firstrow(Column#4), firstrow(Column#8), firstrow(Column#9), firstrow(Column#10), firstrow(Column#11), firstrow(Column#12), firstrow(Column#13), firstrow(Column#14) └─IndexLookUp_15 0.00 root - ├─IndexScan_12 250.00 cop table:st, index:t, range:[1478188800,1478275200], keep order:false, stats:pseudo - └─Selection_14 0.00 cop eq(Column#2, "android"), eq(Column#3, "cn.sbkcq") - └─TableScan_13 250.00 cop table:st, keep order:false, stats:pseudo + ├─IndexScan_12 250.00 cop[tikv] table:st, index:t, range:[1478188800,1478275200], keep order:false, stats:pseudo + └─Selection_14 0.00 cop[tikv] eq(Column#2, "android"), eq(Column#3, "cn.sbkcq") + └─TableScan_13 250.00 cop[tikv] table:st, keep order:false, stats:pseudo explain select dt.id as id, dt.aid as aid, dt.pt as pt, dt.dic as dic, dt.cm as cm, rr.gid as gid, rr.acd as acd, rr.t as t,dt.p1 as p1, dt.p2 as p2, dt.p3 as p3, dt.p4 as p4, dt.p5 as p5, dt.p6_md5 as p6, dt.p7_md5 as p7 from dt dt join rr rr on (rr.pt = 'ios' and rr.t > 1478185592 and dt.aid = rr.aid and dt.dic = rr.dic) where dt.pt = 'ios' and dt.t > 1478185592 and dt.bm = 0 limit 2000; id count task operator info Projection_10 0.00 root Column#1, Column#2, Column#4, Column#5, Column#3, Column#24, Column#25, Column#26, Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17 └─Limit_13 0.00 root offset:0, count:2000 └─IndexMergeJoin_25 0.00 root inner join, inner:IndexLookUp_23, outer key:Column#2, Column#5, inner key:Column#21, Column#23 ├─TableReader_42 0.00 root data:Selection_41 - │ └─Selection_41 0.00 cop eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5)) - │ └─TableScan_40 10000.00 cop table:dt, range:[0,+inf], keep order:false, stats:pseudo + │ └─Selection_41 0.00 cop[tikv] eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5)) + │ └─TableScan_40 10000.00 cop[tikv] table:dt, range:[0,+inf], keep order:false, stats:pseudo └─IndexLookUp_23 0.00 root - ├─IndexScan_20 1.25 cop table:rr, index:aid, dic, range: decided by [eq(Column#21, Column#2) eq(Column#23, Column#5)], keep order:true, stats:pseudo - └─Selection_22 0.00 cop eq(Column#22, "ios"), gt(Column#26, 1478185592) - └─TableScan_21 1.25 cop table:rr, keep order:false, stats:pseudo + ├─IndexScan_20 1.25 cop[tikv] table:rr, index:aid, dic, range: decided by [eq(Column#21, Column#2) eq(Column#23, Column#5)], keep order:true, stats:pseudo + └─Selection_22 0.00 cop[tikv] eq(Column#22, "ios"), gt(Column#26, 1478185592) + └─TableScan_21 1.25 cop[tikv] table:rr, keep order:false, stats:pseudo explain select pc,cr,count(DISTINCT uid) as pay_users,count(oid) as pay_times,sum(am) as am from pp where ps=2 and ppt>=1478188800 and ppt<1478275200 and pi in ('510017','520017') and uid in ('18089709','18090780') group by pc,cr; id count task operator info Projection_5 1.00 root Column#14, Column#16, Column#22, Column#23, Column#24 └─HashAgg_7 1.00 root group by:Column#14, Column#16, funcs:count(distinct Column#2), count(Column#1), sum(Column#6), firstrow(Column#14), firstrow(Column#16) └─IndexLookUp_21 0.00 root - ├─IndexScan_18 0.40 cop table:pp, index:uid, pi, range:[18089709 510017,18089709 510017], [18089709 520017,18089709 520017], [18090780 510017,18090780 510017], [18090780 520017,18090780 520017], keep order:false, stats:pseudo - └─Selection_20 0.00 cop eq(Column#8, 2), ge(Column#4, 1478188800), lt(Column#4, 1478275200) - └─TableScan_19 0.40 cop table:pp, keep order:false, stats:pseudo + ├─IndexScan_18 0.40 cop[tikv] table:pp, index:uid, pi, range:[18089709 510017,18089709 510017], [18089709 520017,18089709 520017], [18090780 510017,18090780 510017], [18090780 520017,18090780 520017], keep order:false, stats:pseudo + └─Selection_20 0.00 cop[tikv] eq(Column#8, 2), ge(Column#4, 1478188800), lt(Column#4, 1478275200) + └─TableScan_19 0.40 cop[tikv] table:pp, keep order:false, stats:pseudo CREATE TABLE `tbl_001` (`a` int, `b` int); CREATE TABLE `tbl_002` (`a` int, `b` int); CREATE TABLE `tbl_003` (`a` int, `b` int); @@ -183,23 +183,23 @@ HashAgg_34 72000.00 root group by:Column#50, funcs:sum(Column#0) └─Projection_63 90000.00 root cast(Column#46), Column#47 └─Union_35 90000.00 root ├─TableReader_38 10000.00 root data:TableScan_37 - │ └─TableScan_37 10000.00 cop table:tbl_001, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_37 10000.00 cop[tikv] table:tbl_001, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_41 10000.00 root data:TableScan_40 - │ └─TableScan_40 10000.00 cop table:tbl_002, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_40 10000.00 cop[tikv] table:tbl_002, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_44 10000.00 root data:TableScan_43 - │ └─TableScan_43 10000.00 cop table:tbl_003, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_43 10000.00 cop[tikv] table:tbl_003, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_47 10000.00 root data:TableScan_46 - │ └─TableScan_46 10000.00 cop table:tbl_004, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_46 10000.00 cop[tikv] table:tbl_004, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_50 10000.00 root data:TableScan_49 - │ └─TableScan_49 10000.00 cop table:tbl_005, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_49 10000.00 cop[tikv] table:tbl_005, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_53 10000.00 root data:TableScan_52 - │ └─TableScan_52 10000.00 cop table:tbl_006, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_52 10000.00 cop[tikv] table:tbl_006, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_56 10000.00 root data:TableScan_55 - │ └─TableScan_55 10000.00 cop table:tbl_007, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_55 10000.00 cop[tikv] table:tbl_007, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_59 10000.00 root data:TableScan_58 - │ └─TableScan_58 10000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_58 10000.00 cop[tikv] table:tbl_008, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_62 10000.00 root data:TableScan_61 - └─TableScan_61 10000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_61 10000.00 cop[tikv] table:tbl_009, range:[-inf,+inf], keep order:false, stats:pseudo CREATE TABLE org_department ( id int(11) NOT NULL AUTO_INCREMENT, ctx int(11) DEFAULT '0' COMMENT 'organization id', @@ -248,14 +248,14 @@ Sort_10 1.00 root Column#31:asc └─HashLeftJoin_23 0.02 root left outer join, inner:TableReader_70, equal:[eq(Column#11, Column#23)] ├─IndexMergeJoin_39 0.01 root left outer join, inner:IndexLookUp_37, outer key:Column#1, inner key:Column#17 │ ├─IndexLookUp_60 0.01 root - │ │ ├─IndexScan_57 10.00 cop table:d, index:ctx, range:[1,1], keep order:false, stats:pseudo - │ │ └─Selection_59 0.01 cop eq(Column#8, 1000) - │ │ └─TableScan_58 10.00 cop table:d, keep order:false, stats:pseudo + │ │ ├─IndexScan_57 10.00 cop[tikv] table:d, index:ctx, range:[1,1], keep order:false, stats:pseudo + │ │ └─Selection_59 0.01 cop[tikv] eq(Column#8, 1000) + │ │ └─TableScan_58 10.00 cop[tikv] table:d, keep order:false, stats:pseudo │ └─IndexLookUp_37 0.00 root - │ ├─Selection_35 1.25 cop not(isnull(Column#17)) - │ │ └─IndexScan_33 1.25 cop table:p, index:department_id, range: decided by [eq(Column#17, Column#1)], keep order:true, stats:pseudo - │ └─Selection_36 0.00 cop eq(Column#18, 1000) - │ └─TableScan_34 1.25 cop table:p, keep order:false, stats:pseudo + │ ├─Selection_35 1.25 cop[tikv] not(isnull(Column#17)) + │ │ └─IndexScan_33 1.25 cop[tikv] table:p, index:department_id, range: decided by [eq(Column#17, Column#1)], keep order:true, stats:pseudo + │ └─Selection_36 0.00 cop[tikv] eq(Column#18, 1000) + │ └─TableScan_34 1.25 cop[tikv] table:p, keep order:false, stats:pseudo └─TableReader_70 9.99 root data:Selection_69 - └─Selection_69 9.99 cop eq(Column#24, 1000), not(isnull(Column#23)) - └─TableScan_68 10000.00 cop table:ep, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_69 9.99 cop[tikv] eq(Column#24, 1000), not(isnull(Column#23)) + └─TableScan_68 10000.00 cop[tikv] table:ep, range:[-inf,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/explain_complex_stats.result b/cmd/explaintest/r/explain_complex_stats.result index 5302fd0c20a9d..13552eb41247e 100644 --- a/cmd/explaintest/r/explain_complex_stats.result +++ b/cmd/explaintest/r/explain_complex_stats.result @@ -119,10 +119,10 @@ Projection_7 21.53 root Column#7, Column#11, Column#12, Column#13, Column#14, Co └─Sort_8 21.53 root Column#8:desc └─HashAgg_16 21.53 root group by:Column#52, Column#53, Column#54, Column#55, Column#56, Column#57, Column#58, Column#59, funcs:count(Column#42), firstrow(Column#52), firstrow(Column#44), firstrow(Column#53), firstrow(Column#54), firstrow(Column#55), firstrow(Column#56), firstrow(Column#57), firstrow(Column#58), firstrow(Column#59) └─IndexLookUp_17 21.53 root - ├─IndexScan_13 128.32 cop table:dt, index:cm, range:[1062,1062], [1086,1086], [1423,1423], [1424,1424], [1425,1425], [1426,1426], [1427,1427], [1428,1428], [1429,1429], [1430,1430], [1431,1431], [1432,1432], [1433,1433], [1434,1434], [1435,1435], [1436,1436], [1437,1437], [1438,1438], [1439,1439], [1440,1440], [1441,1441], [1442,1442], [1443,1443], [1444,1444], [1445,1445], [1446,1446], [1447,1447], [1448,1448], [1449,1449], [1450,1450], [1451,1451], [1452,1452], [1488,1488], [1489,1489], [1490,1490], [1491,1491], [1492,1492], [1493,1493], [1494,1494], [1495,1495], [1496,1496], [1497,1497], [1550,1550], [1551,1551], [1552,1552], [1553,1553], [1554,1554], [1555,1555], [1556,1556], [1557,1557], [1558,1558], [1559,1559], [1597,1597], [1598,1598], [1599,1599], [1600,1600], [1601,1601], [1602,1602], [1603,1603], [1604,1604], [1605,1605], [1606,1606], [1607,1607], [1608,1608], [1609,1609], [1610,1610], [1611,1611], [1612,1612], [1613,1613], [1614,1614], [1615,1615], [1616,1616], [1623,1623], [1624,1624], [1625,1625], [1626,1626], [1627,1627], [1628,1628], [1629,1629], [1630,1630], [1631,1631], [1632,1632], [1709,1709], [1719,1719], [1720,1720], [1843,1843], [2813,2813], [2814,2814], [2815,2815], [2816,2816], [2817,2817], [2818,2818], [2819,2819], [2820,2820], [2821,2821], [2822,2822], [2823,2823], [2824,2824], [2825,2825], [2826,2826], [2827,2827], [2828,2828], [2829,2829], [2830,2830], [2831,2831], [2832,2832], [2833,2833], [2834,2834], [2835,2835], [2836,2836], [2837,2837], [2838,2838], [2839,2839], [2840,2840], [2841,2841], [2842,2842], [2843,2843], [2844,2844], [2845,2845], [2846,2846], [2847,2847], [2848,2848], [2849,2849], [2850,2850], [2851,2851], [2852,2852], [2853,2853], [2854,2854], [2855,2855], [2856,2856], [2857,2857], [2858,2858], [2859,2859], [2860,2860], [2861,2861], [2862,2862], [2863,2863], [2864,2864], [2865,2865], [2866,2866], [2867,2867], [2868,2868], [2869,2869], [2870,2870], [2871,2871], [2872,2872], [3139,3139], [3140,3140], [3141,3141], [3142,3142], [3143,3143], [3144,3144], [3145,3145], [3146,3146], [3147,3147], [3148,3148], [3149,3149], [3150,3150], [3151,3151], [3152,3152], [3153,3153], [3154,3154], [3155,3155], [3156,3156], [3157,3157], [3158,3158], [3386,3386], [3387,3387], [3388,3388], [3389,3389], [3390,3390], [3391,3391], [3392,3392], [3393,3393], [3394,3394], [3395,3395], [3664,3664], [3665,3665], [3666,3666], [3667,3667], [3668,3668], [3670,3670], [3671,3671], [3672,3672], [3673,3673], [3674,3674], [3676,3676], [3677,3677], [3678,3678], [3679,3679], [3680,3680], [3681,3681], [3682,3682], [3683,3683], [3684,3684], [3685,3685], [3686,3686], [3687,3687], [3688,3688], [3689,3689], [3690,3690], [3691,3691], [3692,3692], [3693,3693], [3694,3694], [3695,3695], [3696,3696], [3697,3697], [3698,3698], [3699,3699], [3700,3700], [3701,3701], [3702,3702], [3703,3703], [3704,3704], [3705,3705], [3706,3706], [3707,3707], [3708,3708], [3709,3709], [3710,3710], [3711,3711], [3712,3712], [3713,3713], [3714,3714], [3715,3715], [3960,3960], [3961,3961], [3962,3962], [3963,3963], [3964,3964], [3965,3965], [3966,3966], [3967,3967], [3968,3968], [3978,3978], [3979,3979], [3980,3980], [3981,3981], [3982,3982], [3983,3983], [3984,3984], [3985,3985], [3986,3986], [3987,3987], [4208,4208], [4209,4209], [4210,4210], [4211,4211], [4212,4212], [4304,4304], [4305,4305], [4306,4306], [4307,4307], [4308,4308], [4866,4866], [4867,4867], [4868,4868], [4869,4869], [4870,4870], [4871,4871], [4872,4872], [4873,4873], [4874,4874], [4875,4875], keep order:false - └─HashAgg_11 21.53 cop group by:Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17, Column#7, funcs:count(Column#5), firstrow(Column#8) - └─Selection_15 21.56 cop ge(Column#7, 2016-09-01 00:00:00.000000), le(Column#7, 2016-11-03 00:00:00.000000) - └─TableScan_14 128.32 cop table:dt, keep order:false + ├─IndexScan_13 128.32 cop[tikv] table:dt, index:cm, range:[1062,1062], [1086,1086], [1423,1423], [1424,1424], [1425,1425], [1426,1426], [1427,1427], [1428,1428], [1429,1429], [1430,1430], [1431,1431], [1432,1432], [1433,1433], [1434,1434], [1435,1435], [1436,1436], [1437,1437], [1438,1438], [1439,1439], [1440,1440], [1441,1441], [1442,1442], [1443,1443], [1444,1444], [1445,1445], [1446,1446], [1447,1447], [1448,1448], [1449,1449], [1450,1450], [1451,1451], [1452,1452], [1488,1488], [1489,1489], [1490,1490], [1491,1491], [1492,1492], [1493,1493], [1494,1494], [1495,1495], [1496,1496], [1497,1497], [1550,1550], [1551,1551], [1552,1552], [1553,1553], [1554,1554], [1555,1555], [1556,1556], [1557,1557], [1558,1558], [1559,1559], [1597,1597], [1598,1598], [1599,1599], [1600,1600], [1601,1601], [1602,1602], [1603,1603], [1604,1604], [1605,1605], [1606,1606], [1607,1607], [1608,1608], [1609,1609], [1610,1610], [1611,1611], [1612,1612], [1613,1613], [1614,1614], [1615,1615], [1616,1616], [1623,1623], [1624,1624], [1625,1625], [1626,1626], [1627,1627], [1628,1628], [1629,1629], [1630,1630], [1631,1631], [1632,1632], [1709,1709], [1719,1719], [1720,1720], [1843,1843], [2813,2813], [2814,2814], [2815,2815], [2816,2816], [2817,2817], [2818,2818], [2819,2819], [2820,2820], [2821,2821], [2822,2822], [2823,2823], [2824,2824], [2825,2825], [2826,2826], [2827,2827], [2828,2828], [2829,2829], [2830,2830], [2831,2831], [2832,2832], [2833,2833], [2834,2834], [2835,2835], [2836,2836], [2837,2837], [2838,2838], [2839,2839], [2840,2840], [2841,2841], [2842,2842], [2843,2843], [2844,2844], [2845,2845], [2846,2846], [2847,2847], [2848,2848], [2849,2849], [2850,2850], [2851,2851], [2852,2852], [2853,2853], [2854,2854], [2855,2855], [2856,2856], [2857,2857], [2858,2858], [2859,2859], [2860,2860], [2861,2861], [2862,2862], [2863,2863], [2864,2864], [2865,2865], [2866,2866], [2867,2867], [2868,2868], [2869,2869], [2870,2870], [2871,2871], [2872,2872], [3139,3139], [3140,3140], [3141,3141], [3142,3142], [3143,3143], [3144,3144], [3145,3145], [3146,3146], [3147,3147], [3148,3148], [3149,3149], [3150,3150], [3151,3151], [3152,3152], [3153,3153], [3154,3154], [3155,3155], [3156,3156], [3157,3157], [3158,3158], [3386,3386], [3387,3387], [3388,3388], [3389,3389], [3390,3390], [3391,3391], [3392,3392], [3393,3393], [3394,3394], [3395,3395], [3664,3664], [3665,3665], [3666,3666], [3667,3667], [3668,3668], [3670,3670], [3671,3671], [3672,3672], [3673,3673], [3674,3674], [3676,3676], [3677,3677], [3678,3678], [3679,3679], [3680,3680], [3681,3681], [3682,3682], [3683,3683], [3684,3684], [3685,3685], [3686,3686], [3687,3687], [3688,3688], [3689,3689], [3690,3690], [3691,3691], [3692,3692], [3693,3693], [3694,3694], [3695,3695], [3696,3696], [3697,3697], [3698,3698], [3699,3699], [3700,3700], [3701,3701], [3702,3702], [3703,3703], [3704,3704], [3705,3705], [3706,3706], [3707,3707], [3708,3708], [3709,3709], [3710,3710], [3711,3711], [3712,3712], [3713,3713], [3714,3714], [3715,3715], [3960,3960], [3961,3961], [3962,3962], [3963,3963], [3964,3964], [3965,3965], [3966,3966], [3967,3967], [3968,3968], [3978,3978], [3979,3979], [3980,3980], [3981,3981], [3982,3982], [3983,3983], [3984,3984], [3985,3985], [3986,3986], [3987,3987], [4208,4208], [4209,4209], [4210,4210], [4211,4211], [4212,4212], [4304,4304], [4305,4305], [4306,4306], [4307,4307], [4308,4308], [4866,4866], [4867,4867], [4868,4868], [4869,4869], [4870,4870], [4871,4871], [4872,4872], [4873,4873], [4874,4874], [4875,4875], keep order:false + └─HashAgg_11 21.53 cop[tikv] group by:Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17, Column#7, funcs:count(Column#5), firstrow(Column#8) + └─Selection_15 21.56 cop[tikv] ge(Column#7, 2016-09-01 00:00:00.000000), le(Column#7, 2016-11-03 00:00:00.000000) + └─TableScan_14 128.32 cop[tikv] table:dt, keep order:false explain select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext, gad.t as gtime from st gad join (select id, aid, pt, dic, ip, t from dd where pt = 'android' and bm = 0 and t > 1478143908) sdk on gad.aid = sdk.aid and gad.ip = sdk.ip and sdk.t > gad.t where gad.t > 1478143908 and gad.bm = 0 and gad.pt = 'android' group by gad.aid, sdk.dic limit 2500; id count task operator info Projection_13 424.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Column#26, Column#27, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#15, Column#19 @@ -130,52 +130,52 @@ Projection_13 424.00 root Column#1, Column#20, Column#3, Column#4, Column#23, Co └─HashAgg_19 424.00 root group by:Column#23, Column#3, funcs:firstrow(Column#1), firstrow(Column#3), firstrow(Column#4), firstrow(Column#8), firstrow(Column#9), firstrow(Column#10), firstrow(Column#11), firstrow(Column#12), firstrow(Column#13), firstrow(Column#14), firstrow(Column#15), firstrow(Column#19), firstrow(Column#20), firstrow(Column#23), firstrow(Column#26), firstrow(Column#27) └─IndexMergeJoin_30 424.00 root inner join, inner:IndexLookUp_28, outer key:Column#3, inner key:Column#21, other cond:eq(Column#5, Column#26), gt(Column#27, Column#19) ├─TableReader_37 424.00 root data:Selection_36 - │ └─Selection_36 424.00 cop eq(Column#16, 0), eq(Column#2, "android"), gt(Column#19, 1478143908), not(isnull(Column#5)) - │ └─TableScan_35 1999.00 cop table:gad, range:[0,+inf], keep order:false + │ └─Selection_36 424.00 cop[tikv] eq(Column#16, 0), eq(Column#2, "android"), gt(Column#19, 1478143908), not(isnull(Column#5)) + │ └─TableScan_35 1999.00 cop[tikv] table:gad, range:[0,+inf], keep order:false └─IndexLookUp_28 0.23 root - ├─IndexScan_25 1.00 cop table:dd, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true - └─Selection_27 0.23 cop eq(Column#22, "android"), eq(Column#28, 0), gt(Column#27, 1478143908), not(isnull(Column#26)), not(isnull(Column#27)) - └─TableScan_26 1.00 cop table:dd, keep order:false + ├─IndexScan_25 1.00 cop[tikv] table:dd, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true + └─Selection_27 0.23 cop[tikv] eq(Column#22, "android"), eq(Column#28, 0), gt(Column#27, 1478143908), not(isnull(Column#26)), not(isnull(Column#27)) + └─TableScan_26 1.00 cop[tikv] table:dd, keep order:false explain select gad.id as gid,sdk.id as sid,gad.aid as aid,gad.cm as cm,sdk.dic as dic,sdk.ip as ip, sdk.t as t, gad.p1 as p1, gad.p2 as p2, gad.p3 as p3, gad.p4 as p4, gad.p5 as p5, gad.p6_md5 as p6, gad.p7_md5 as p7, gad.ext as ext from st gad join dd sdk on gad.aid = sdk.aid and gad.dic = sdk.mac and gad.t < sdk.t where gad.t > 1477971479 and gad.bm = 0 and gad.pt = 'ios' and gad.dit = 'mac' and sdk.t > 1477971479 and sdk.bm = 0 and sdk.pt = 'ios' limit 3000; id count task operator info Projection_10 170.34 root Column#1, Column#20, Column#3, Column#4, Column#23, Column#26, Column#27, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#15 └─Limit_13 170.34 root offset:0, count:3000 └─IndexMergeJoin_24 170.34 root inner join, inner:IndexLookUp_22, outer key:Column#3, inner key:Column#21, other cond:eq(Column#6, Column#25), lt(Column#19, Column#27) ├─TableReader_31 170.34 root data:Selection_30 - │ └─Selection_30 170.34 cop eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), gt(Column#19, 1477971479), not(isnull(Column#6)) - │ └─TableScan_29 1999.00 cop table:gad, range:[0,+inf], keep order:false + │ └─Selection_30 170.34 cop[tikv] eq(Column#16, 0), eq(Column#2, "ios"), eq(Column#7, "mac"), gt(Column#19, 1477971479), not(isnull(Column#6)) + │ └─TableScan_29 1999.00 cop[tikv] table:gad, range:[0,+inf], keep order:false └─IndexLookUp_22 0.25 root - ├─IndexScan_19 1.00 cop table:sdk, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true - └─Selection_21 0.25 cop eq(Column#22, "ios"), eq(Column#28, 0), gt(Column#27, 1477971479), not(isnull(Column#25)), not(isnull(Column#27)) - └─TableScan_20 1.00 cop table:sdk, keep order:false + ├─IndexScan_19 1.00 cop[tikv] table:sdk, index:aid, dic, range: decided by [eq(Column#21, Column#3)], keep order:true + └─Selection_21 0.25 cop[tikv] eq(Column#22, "ios"), eq(Column#28, 0), gt(Column#27, 1477971479), not(isnull(Column#25)), not(isnull(Column#27)) + └─TableScan_20 1.00 cop[tikv] table:sdk, keep order:false explain SELECT cm, p1, p2, p3, p4, p5, p6_md5, p7_md5, count(1) as click_pv, count(DISTINCT ip) as click_ip FROM st WHERE (t between 1478188800 and 1478275200) and aid='cn.sbkcq' and pt='android' GROUP BY cm, p1, p2, p3, p4, p5, p6_md5, p7_md5; id count task operator info Projection_5 39.28 root Column#4, Column#8, Column#9, Column#10, Column#11, Column#12, Column#13, Column#14, Column#20, Column#21 └─HashAgg_7 39.28 root group by:Column#10, Column#11, Column#12, Column#13, Column#14, Column#4, Column#8, Column#9, funcs:count(1), count(distinct Column#5), firstrow(Column#4), firstrow(Column#8), firstrow(Column#9), firstrow(Column#10), firstrow(Column#11), firstrow(Column#12), firstrow(Column#13), firstrow(Column#14) └─IndexLookUp_15 39.38 root - ├─IndexScan_12 160.23 cop table:st, index:t, range:[1478188800,1478275200], keep order:false - └─Selection_14 39.38 cop eq(Column#2, "android"), eq(Column#3, "cn.sbkcq") - └─TableScan_13 160.23 cop table:st, keep order:false + ├─IndexScan_12 160.23 cop[tikv] table:st, index:t, range:[1478188800,1478275200], keep order:false + └─Selection_14 39.38 cop[tikv] eq(Column#2, "android"), eq(Column#3, "cn.sbkcq") + └─TableScan_13 160.23 cop[tikv] table:st, keep order:false explain select dt.id as id, dt.aid as aid, dt.pt as pt, dt.dic as dic, dt.cm as cm, rr.gid as gid, rr.acd as acd, rr.t as t,dt.p1 as p1, dt.p2 as p2, dt.p3 as p3, dt.p4 as p4, dt.p5 as p5, dt.p6_md5 as p6, dt.p7_md5 as p7 from dt dt join rr rr on (rr.pt = 'ios' and rr.t > 1478185592 and dt.aid = rr.aid and dt.dic = rr.dic) where dt.pt = 'ios' and dt.t > 1478185592 and dt.bm = 0 limit 2000; id count task operator info Projection_10 428.32 root Column#1, Column#2, Column#4, Column#5, Column#3, Column#24, Column#25, Column#26, Column#11, Column#12, Column#13, Column#14, Column#15, Column#16, Column#17 └─Limit_13 428.32 root offset:0, count:2000 └─IndexMergeJoin_25 428.32 root inner join, inner:IndexLookUp_23, outer key:Column#2, Column#5, inner key:Column#21, Column#23 ├─TableReader_42 428.32 root data:Selection_41 - │ └─Selection_41 428.32 cop eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5)) - │ └─TableScan_40 2000.00 cop table:dt, range:[0,+inf], keep order:false + │ └─Selection_41 428.32 cop[tikv] eq(Column#18, 0), eq(Column#4, "ios"), gt(Column#9, 1478185592), not(isnull(Column#5)) + │ └─TableScan_40 2000.00 cop[tikv] table:dt, range:[0,+inf], keep order:false └─IndexLookUp_23 0.48 root - ├─IndexScan_20 1.00 cop table:rr, index:aid, dic, range: decided by [eq(Column#21, Column#2) eq(Column#23, Column#5)], keep order:true - └─Selection_22 0.48 cop eq(Column#22, "ios"), gt(Column#26, 1478185592) - └─TableScan_21 1.00 cop table:rr, keep order:false + ├─IndexScan_20 1.00 cop[tikv] table:rr, index:aid, dic, range: decided by [eq(Column#21, Column#2) eq(Column#23, Column#5)], keep order:true + └─Selection_22 0.48 cop[tikv] eq(Column#22, "ios"), gt(Column#26, 1478185592) + └─TableScan_21 1.00 cop[tikv] table:rr, keep order:false explain select pc,cr,count(DISTINCT uid) as pay_users,count(oid) as pay_times,sum(am) as am from pp where ps=2 and ppt>=1478188800 and ppt<1478275200 and pi in ('510017','520017') and uid in ('18089709','18090780') group by pc,cr; id count task operator info Projection_5 207.86 root Column#14, Column#16, Column#22, Column#23, Column#24 └─HashAgg_7 207.86 root group by:Column#14, Column#16, funcs:count(distinct Column#2), count(Column#1), sum(Column#6), firstrow(Column#14), firstrow(Column#16) └─IndexLookUp_21 207.86 root - ├─IndexScan_15 627.00 cop table:pp, index:ps, range:[2,2], keep order:false - └─Selection_17 207.86 cop ge(Column#4, 1478188800), in(Column#17, 510017, 520017), in(Column#2, 18089709, 18090780), lt(Column#4, 1478275200) - └─TableScan_16 627.00 cop table:pp, keep order:false + ├─IndexScan_15 627.00 cop[tikv] table:pp, index:ps, range:[2,2], keep order:false + └─Selection_17 207.86 cop[tikv] ge(Column#4, 1478188800), in(Column#17, 510017, 520017), in(Column#2, 18089709, 18090780), lt(Column#4, 1478275200) + └─TableScan_16 627.00 cop[tikv] table:pp, keep order:false drop table if exists tbl_001; CREATE TABLE tbl_001 (a int, b int); load stats 's/explain_complex_stats_tbl_001.json'; @@ -209,20 +209,20 @@ HashAgg_34 18000.00 root group by:Column#50, funcs:sum(Column#0) └─Projection_63 18000.00 root cast(Column#46), Column#47 └─Union_35 18000.00 root ├─TableReader_38 2000.00 root data:TableScan_37 - │ └─TableScan_37 2000.00 cop table:tbl_001, range:[-inf,+inf], keep order:false + │ └─TableScan_37 2000.00 cop[tikv] table:tbl_001, range:[-inf,+inf], keep order:false ├─TableReader_41 2000.00 root data:TableScan_40 - │ └─TableScan_40 2000.00 cop table:tbl_002, range:[-inf,+inf], keep order:false + │ └─TableScan_40 2000.00 cop[tikv] table:tbl_002, range:[-inf,+inf], keep order:false ├─TableReader_44 2000.00 root data:TableScan_43 - │ └─TableScan_43 2000.00 cop table:tbl_003, range:[-inf,+inf], keep order:false + │ └─TableScan_43 2000.00 cop[tikv] table:tbl_003, range:[-inf,+inf], keep order:false ├─TableReader_47 2000.00 root data:TableScan_46 - │ └─TableScan_46 2000.00 cop table:tbl_004, range:[-inf,+inf], keep order:false + │ └─TableScan_46 2000.00 cop[tikv] table:tbl_004, range:[-inf,+inf], keep order:false ├─TableReader_50 2000.00 root data:TableScan_49 - │ └─TableScan_49 2000.00 cop table:tbl_005, range:[-inf,+inf], keep order:false + │ └─TableScan_49 2000.00 cop[tikv] table:tbl_005, range:[-inf,+inf], keep order:false ├─TableReader_53 2000.00 root data:TableScan_52 - │ └─TableScan_52 2000.00 cop table:tbl_006, range:[-inf,+inf], keep order:false + │ └─TableScan_52 2000.00 cop[tikv] table:tbl_006, range:[-inf,+inf], keep order:false ├─TableReader_56 2000.00 root data:TableScan_55 - │ └─TableScan_55 2000.00 cop table:tbl_007, range:[-inf,+inf], keep order:false + │ └─TableScan_55 2000.00 cop[tikv] table:tbl_007, range:[-inf,+inf], keep order:false ├─TableReader_59 2000.00 root data:TableScan_58 - │ └─TableScan_58 2000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false + │ └─TableScan_58 2000.00 cop[tikv] table:tbl_008, range:[-inf,+inf], keep order:false └─TableReader_62 2000.00 root data:TableScan_61 - └─TableScan_61 2000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false + └─TableScan_61 2000.00 cop[tikv] table:tbl_009, range:[-inf,+inf], keep order:false diff --git a/executor/aggregate_test.go b/executor/aggregate_test.go index 5bd1f9857de87..584db4c4a2fc9 100644 --- a/executor/aggregate_test.go +++ b/executor/aggregate_test.go @@ -632,7 +632,7 @@ func (s *testSuite1) TestInjectProjBelowTopN(c *C) { "└─Sort_4 10000.00 root Column#4:asc", " └─Projection_9 10000.00 root Column#3, plus(Column#3, 1)", " └─TableReader_7 10000.00 root data:TableScan_6", - " └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo")) + " └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo")) rs := tk.MustQuery("select * from t order by i + 1 ") rs.Check(testkit.Rows( "1", "1", "1", "2", "2", "2", "3", "3", "3")) @@ -641,8 +641,8 @@ func (s *testSuite1) TestInjectProjBelowTopN(c *C) { "└─TopN_7 2.00 root Column#4:asc, offset:0, count:2", " └─Projection_16 2.00 root Column#3, plus(Column#1, 1)", " └─TableReader_12 2.00 root data:TopN_11", - " └─TopN_11 2.00 cop plus(Column#1, 1):asc, offset:0, count:2", - " └─TableScan_10 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo")) + " └─TopN_11 2.00 cop[tikv] plus(Column#1, 1):asc, offset:0, count:2", + " └─TableScan_10 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo")) rs = tk.MustQuery("select * from t order by i + 1 limit 2") rs.Check(testkit.Rows("1", "1")) tk.MustQuery("select i, i, i from t order by i + 1").Check(testkit.Rows("1 1 1", "1 1 1", "1 1 1", "2 2 2", "2 2 2", "2 2 2", "3 3 3", "3 3 3", "3 3 3")) diff --git a/executor/analyze_test.go b/executor/analyze_test.go index 71b3ecb47c1d1..0f68cf20017d4 100644 --- a/executor/analyze_test.go +++ b/executor/analyze_test.go @@ -311,13 +311,13 @@ func (s *testSuite1) TestFastAnalyze(c *C) { tk.MustExec("analyze table t1") tk.MustQuery("explain select a from t1 where a = 1").Check(testkit.Rows( "IndexReader_6 4.00 root index:IndexScan_5", - "└─IndexScan_5 4.00 cop table:t1, index:a, b, range:[1,1], keep order:false")) + "└─IndexScan_5 4.00 cop[tikv] table:t1, index:a, b, range:[1,1], keep order:false")) tk.MustQuery("explain select a, b from t1 where a = 1 and b = 1").Check(testkit.Rows( "IndexReader_6 2.00 root index:IndexScan_5", - "└─IndexScan_5 2.00 cop table:t1, index:a, b, range:[1 1,1 1], keep order:false")) + "└─IndexScan_5 2.00 cop[tikv] table:t1, index:a, b, range:[1 1,1 1], keep order:false")) tk.MustQuery("explain select a, b from t1 where a = 1 and b = 2").Check(testkit.Rows( "IndexReader_6 2.00 root index:IndexScan_5", - "└─IndexScan_5 2.00 cop table:t1, index:a, b, range:[1 2,1 2], keep order:false")) + "└─IndexScan_5 2.00 cop[tikv] table:t1, index:a, b, range:[1 2,1 2], keep order:false")) tk.MustExec("create table t2 (a bigint unsigned, primary key(a))") tk.MustExec("insert into t2 values (0), (18446744073709551615)") diff --git a/executor/explainfor_test.go b/executor/explainfor_test.go index 632874180495b..acd97668c550f 100644 --- a/executor/explainfor_test.go +++ b/executor/explainfor_test.go @@ -67,7 +67,7 @@ func (s *testSuite) TestExplainFor(c *C) { tkUser.Se.SetSessionManager(&mockSessionManager1{PS: ps}) tkRoot.MustQuery(fmt.Sprintf("explain for connection %d", tkRootProcess.ID)).Check(testkit.Rows( "TableReader_5 10000.00 root data:TableScan_4", - "└─TableScan_4 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "└─TableScan_4 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", )) err := tkUser.ExecToErr(fmt.Sprintf("explain for connection %d", tkRootProcess.ID)) c.Check(core.ErrAccessDenied.Equal(err), IsTrue) diff --git a/executor/join_test.go b/executor/join_test.go index 6dbbeb4edf56f..785ff67dff607 100644 --- a/executor/join_test.go +++ b/executor/join_test.go @@ -1030,9 +1030,9 @@ func (s *testSuite2) TestMergejoinOrder(c *C) { tk.MustQuery("explain select /*+ TIDB_SMJ(t2) */ * from t1 left outer join t2 on t1.a=t2.a and t1.a!=3 order by t1.a;").Check(testkit.Rows( "MergeJoin_20 10000.00 root left outer join, left key:Column#1, right key:Column#3, left cond:[ne(Column#1, 3)]", "├─TableReader_12 10000.00 root data:TableScan_11", - "│ └─TableScan_11 10000.00 cop table:t1, range:[-inf,+inf], keep order:true, stats:pseudo", + "│ └─TableScan_11 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:true, stats:pseudo", "└─TableReader_14 6666.67 root data:TableScan_13", - " └─TableScan_13 6666.67 cop table:t2, range:[-inf,3), (3,+inf], keep order:true, stats:pseudo", + " └─TableScan_13 6666.67 cop[tikv] table:t2, range:[-inf,3), (3,+inf], keep order:true, stats:pseudo", )) tk.MustExec("set @@tidb_init_chunk_size=1") @@ -1087,11 +1087,11 @@ func (s *testSuite2) TestHashJoin(c *C) { result := tk.MustQuery("explain analyze select /*+ TIDB_HJ(t1, t2) */ * from t1 where exists (select a from t2 where t1.a = t2.a);") // HashLeftJoin_9 7992.00 root semi join, inner:TableReader_15, equal:[eq(test.t1.a, test.t2.a)] time:219.863µs, loops:1, rows:0 // ├─TableReader_12 9990.00 root data:Selection_11 time:9.129µs, loops:1, rows:1 - // │ └─Selection_11 9990.00 cop not(isnull(test.t1.a)) - // │ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo time:0s, loops:0, rows:5 + // │ └─Selection_11 9990.00 cop[tikv] not(isnull(test.t1.a)) + // │ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo time:0s, loops:0, rows:5 // └─TableReader_15 9990.00 root data:Selection_14 time:12.983µs, loops:1, rows:0 - // └─Selection_14 9990.00 cop not(isnull(test.t2.a)) - // └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo time:0s, loops:0, rows:0 + // └─Selection_14 9990.00 cop[tikv] not(isnull(test.t2.a)) + // └─TableScan_13 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo time:0s, loops:0, rows:0 row := result.Rows() c.Assert(len(row), Equals, 7) outerExecInfo := row[1][4].(string) diff --git a/executor/merge_join_test.go b/executor/merge_join_test.go index 0efff008863cf..8267466bbb980 100644 --- a/executor/merge_join_test.go +++ b/executor/merge_join_test.go @@ -331,9 +331,9 @@ func (s *testSuite1) TestMergeJoin(c *C) { "Sort_6 100000000.00 root Column#5:asc, Column#6:asc", "└─MergeJoin_9 100000000.00 root inner join", " ├─TableReader_11 10000.00 root data:TableScan_10", - " │ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + " │ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", " └─TableReader_13 10000.00 root data:TableScan_12", - " └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_12 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("select /*+ TIDB_SMJ(t1, t2) */ * from t t1 join t t2 order by t1.a, t2.a").Check(testkit.Rows( "1 1", @@ -352,9 +352,9 @@ func (s *testSuite1) TestMergeJoin(c *C) { "Projection_7 10000.00 root Column#8", "└─MergeJoin_8 10000.00 root left outer semi join, other cond:eq(Column#1, Column#4), ge(Column#5, Column#2)", " ├─TableReader_10 10000.00 root data:TableScan_9", - " │ └─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo", + " │ └─TableScan_9 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo", " └─TableReader_12 10000.00 root data:TableScan_11", - " └─TableScan_11 10000.00 cop table:s, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_11 10000.00 cop[tikv] table:s, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("select /*+ TIDB_SMJ(t, s) */ a in (select a from s where s.b >= t.b) from t").Check(testkit.Rows( "1", diff --git a/executor/seqtest/seq_executor_test.go b/executor/seqtest/seq_executor_test.go index b3cbb6d7bb460..483195b616eda 100644 --- a/executor/seqtest/seq_executor_test.go +++ b/executor/seqtest/seq_executor_test.go @@ -663,7 +663,7 @@ func (s *seqTestSuite) TestParallelHashAggClose(c *C) { // HashAgg_8 | 2.40 | root | group by:t.b, funcs:sum(t.a) // └─Projection_9 | 3.00 | root | cast(test.t.a), test.t.b // └─TableReader_11 | 3.00 | root | data:TableScan_10 - // └─TableScan_10 | 3.00 | cop | table:t, range:[-inf,+inf], keep order:fa$se, stats:pseudo | + // └─TableScan_10 | 3.00 | cop[tikv] | table:t, range:[-inf,+inf], keep order:fa$se, stats:pseudo | // Goroutine should not leak when error happen. c.Assert(failpoint.Enable("github.com/pingcap/tidb/executor/parallelHashAggError", `return(true)`), IsNil) diff --git a/expression/aggregation/aggregation.go b/expression/aggregation/aggregation.go index d9ca66365467c..099b702a139fa 100644 --- a/expression/aggregation/aggregation.go +++ b/expression/aggregation/aggregation.go @@ -186,3 +186,12 @@ func IsAllFirstRow(aggFuncs []*AggFuncDesc) bool { } return true } + +// CheckAggPushFlash checks whether an agg function can be pushed to flash storage. +func CheckAggPushFlash(aggFunc *AggFuncDesc) bool { + switch aggFunc.Name { + case ast.AggFuncSum, ast.AggFuncCount, ast.AggFuncMin, ast.AggFuncMax, ast.AggFuncAvg, ast.AggFuncFirstRow: + return true + } + return false +} diff --git a/expression/constant_fold_test.go b/expression/constant_fold_test.go index 3ea8e972cfe00..741bd7b83975c 100644 --- a/expression/constant_fold_test.go +++ b/expression/constant_fold_test.go @@ -27,7 +27,7 @@ func (s *testIntegrationSuite) TestFoldIfNull(c *C) { tk.MustQuery(`desc select ifnull("aaaa", a) from t;`).Check(testkit.Rows( `Projection_3 10000.00 root "aaaa"`, `└─TableReader_5 10000.00 root data:TableScan_4`, - ` └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo`, + ` └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo`, )) tk.MustQuery(`show warnings;`).Check(testkit.Rows()) tk.MustQuery(`select ifnull("aaaa", a) from t;`).Check(testkit.Rows("aaaa")) diff --git a/expression/constant_propagation_test.go b/expression/constant_propagation_test.go index f030f1e3a4170..bbe9200ec6614 100644 --- a/expression/constant_propagation_test.go +++ b/expression/constant_propagation_test.go @@ -68,118 +68,118 @@ func (s *testSuite) TestOuterJoinPropConst(c *C) { tk.MustQuery("explain select * from t1 left join t2 on t1.a > t2.a and t1.a = 1;").Check(testkit.Rows( "HashLeftJoin_6 33233333.33 root CARTESIAN left outer join, inner:TableReader_11, left cond:[eq(Column#2, 1)]", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 3323.33 root data:Selection_10", - " └─Selection_10 3323.33 cop gt(1, Column#5)", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_10 3323.33 cop[tikv] gt(1, Column#5)", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on t1.a > t2.a where t1.a = 1;").Check(testkit.Rows( "HashLeftJoin_7 33233.33 root CARTESIAN left outer join, inner:TableReader_13", "├─TableReader_10 10.00 root data:Selection_9", - "│ └─Selection_9 10.00 cop eq(Column#2, 1)", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 10.00 cop[tikv] eq(Column#2, 1)", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_13 3323.33 root data:Selection_12", - " └─Selection_12 3323.33 cop gt(1, Column#5)", - " └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_12 3323.33 cop[tikv] gt(1, Column#5)", + " └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on t1.a = t2.a and t1.a > 1;").Check(testkit.Rows( "HashLeftJoin_6 10000.00 root left outer join, inner:TableReader_11, equal:[eq(Column#2, Column#5)], left cond:[gt(Column#2, 1)]", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 3333.33 root data:Selection_10", - " └─Selection_10 3333.33 cop gt(Column#5, 1), not(isnull(Column#5))", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_10 3333.33 cop[tikv] gt(Column#5, 1), not(isnull(Column#5))", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on t1.a = t2.a where t1.a > 1;").Check(testkit.Rows( "HashLeftJoin_7 4166.67 root left outer join, inner:TableReader_13, equal:[eq(Column#2, Column#5)]", "├─TableReader_10 3333.33 root data:Selection_9", - "│ └─Selection_9 3333.33 cop gt(Column#2, 1)", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 3333.33 cop[tikv] gt(Column#2, 1)", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_13 3333.33 root data:Selection_12", - " └─Selection_12 3333.33 cop gt(Column#5, 1), not(isnull(Column#5))", - " └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_12 3333.33 cop[tikv] gt(Column#5, 1), not(isnull(Column#5))", + " └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 right join t2 on t1.a > t2.a where t2.a = 1;").Check(testkit.Rows( "HashRightJoin_7 33333.33 root CARTESIAN right outer join, inner:TableReader_10", "├─TableReader_10 3333.33 root data:Selection_9", - "│ └─Selection_9 3333.33 cop gt(Column#2, 1)", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 3333.33 cop[tikv] gt(Column#2, 1)", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_13 10.00 root data:Selection_12", - " └─Selection_12 10.00 cop eq(Column#5, 1)", - " └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_12 10.00 cop[tikv] eq(Column#5, 1)", + " └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 right join t2 on t1.a = t2.a where t2.a > 1;").Check(testkit.Rows( "HashRightJoin_7 4166.67 root right outer join, inner:TableReader_10, equal:[eq(Column#2, Column#5)]", "├─TableReader_10 3333.33 root data:Selection_9", - "│ └─Selection_9 3333.33 cop gt(Column#2, 1), not(isnull(Column#2))", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 3333.33 cop[tikv] gt(Column#2, 1), not(isnull(Column#2))", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_13 3333.33 root data:Selection_12", - " └─Selection_12 3333.33 cop gt(Column#5, 1)", - " └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_12 3333.33 cop[tikv] gt(Column#5, 1)", + " └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 right join t2 on t1.a = t2.a and t2.a > 1;").Check(testkit.Rows( "HashRightJoin_6 10000.00 root right outer join, inner:TableReader_9, equal:[eq(Column#2, Column#5)], right cond:gt(Column#5, 1)", "├─TableReader_9 3333.33 root data:Selection_8", - "│ └─Selection_8 3333.33 cop gt(Column#2, 1), not(isnull(Column#2))", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_8 3333.33 cop[tikv] gt(Column#2, 1), not(isnull(Column#2))", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 10000.00 root data:TableScan_10", - " └─TableScan_10 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_10 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 right join t2 on t1.a > t2.a and t2.a = 1;").Check(testkit.Rows( "HashRightJoin_6 33333333.33 root CARTESIAN right outer join, inner:TableReader_9, right cond:eq(Column#5, 1)", "├─TableReader_9 3333.33 root data:Selection_8", - "│ └─Selection_8 3333.33 cop gt(Column#2, 1)", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_8 3333.33 cop[tikv] gt(Column#2, 1)", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 10000.00 root data:TableScan_10", - " └─TableScan_10 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_10 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) // Negative tests. tk.MustQuery("explain select * from t1 left join t2 on t1.a = t2.a and t2.a > 1;").Check(testkit.Rows( "HashLeftJoin_6 10000.00 root left outer join, inner:TableReader_11, equal:[eq(Column#2, Column#5)]", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 3333.33 root data:Selection_10", - " └─Selection_10 3333.33 cop gt(Column#5, 1), not(isnull(Column#5))", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_10 3333.33 cop[tikv] gt(Column#5, 1), not(isnull(Column#5))", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on t1.a > t2.a and t2.a = 1;").Check(testkit.Rows( "HashLeftJoin_6 100000.00 root CARTESIAN left outer join, inner:TableReader_11, other cond:gt(Column#2, Column#5)", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 10.00 root data:Selection_10", - " └─Selection_10 10.00 cop eq(Column#5, 1), not(isnull(Column#5))", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_10 10.00 cop[tikv] eq(Column#5, 1), not(isnull(Column#5))", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 right join t2 on t1.a > t2.a and t1.a = 1;").Check(testkit.Rows( "HashRightJoin_6 100000.00 root CARTESIAN right outer join, inner:TableReader_9, other cond:gt(Column#2, Column#5)", "├─TableReader_9 10.00 root data:Selection_8", - "│ └─Selection_8 10.00 cop eq(Column#2, 1), not(isnull(Column#2))", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_8 10.00 cop[tikv] eq(Column#2, 1), not(isnull(Column#2))", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 10000.00 root data:TableScan_10", - " └─TableScan_10 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_10 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 right join t2 on t1.a = t2.a and t1.a > 1;").Check(testkit.Rows( "HashRightJoin_6 10000.00 root right outer join, inner:TableReader_9, equal:[eq(Column#2, Column#5)]", "├─TableReader_9 3333.33 root data:Selection_8", - "│ └─Selection_8 3333.33 cop gt(Column#2, 1), not(isnull(Column#2))", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_8 3333.33 cop[tikv] gt(Column#2, 1), not(isnull(Column#2))", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 10000.00 root data:TableScan_10", - " └─TableScan_10 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_10 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on t1.a = t1.b and t1.a > 1;").Check(testkit.Rows( "HashLeftJoin_6 100000000.00 root CARTESIAN left outer join, inner:TableReader_10, left cond:[eq(Column#2, Column#3) gt(Column#2, 1)]", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_10 10000.00 root data:TableScan_9", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on t2.a = t2.b and t2.a > 1;").Check(testkit.Rows( "HashLeftJoin_6 26666666.67 root CARTESIAN left outer join, inner:TableReader_11", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 2666.67 root data:Selection_10", - " └─Selection_10 2666.67 cop eq(Column#5, Column#6), gt(Column#5, 1)", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_10 2666.67 cop[tikv] eq(Column#5, Column#6), gt(Column#5, 1)", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) // Constant equal condition merge in outer join. tk.MustQuery("explain select * from t1 left join t2 on true where t1.a = 1 and false;").Check(testkit.Rows( @@ -197,59 +197,59 @@ func (s *testSuite) TestOuterJoinPropConst(c *C) { tk.MustQuery("explain select * from t1 left join t2 on true where t1.a = 1 and t1.a = 1;").Check(testkit.Rows( "HashLeftJoin_7 80000.00 root CARTESIAN left outer join, inner:TableReader_12", "├─TableReader_10 10.00 root data:Selection_9", - "│ └─Selection_9 10.00 cop eq(Column#2, 1)", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 10.00 cop[tikv] eq(Column#2, 1)", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_12 10000.00 root data:TableScan_11", - " └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on false;").Check(testkit.Rows( "HashLeftJoin_6 80000000.00 root CARTESIAN left outer join, inner:TableDual_9", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableDual_9 8000.00 root rows:0", )) tk.MustQuery("explain select * from t1 right join t2 on false;").Check(testkit.Rows( "HashRightJoin_6 80000000.00 root CARTESIAN right outer join, inner:TableDual_7", "├─TableDual_7 8000.00 root rows:0", "└─TableReader_9 10000.00 root data:TableScan_8", - " └─TableScan_8 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_8 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on t1.a = 1 and t1.a = 2;").Check(testkit.Rows( "HashLeftJoin_6 80000000.00 root CARTESIAN left outer join, inner:TableDual_9", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableDual_9 8000.00 root rows:0", )) tk.MustQuery("explain select * from t1 left join t2 on t1.a =1 where t1.a = 2;").Check(testkit.Rows( "HashLeftJoin_7 80000.00 root CARTESIAN left outer join, inner:TableDual_11", "├─TableReader_10 10.00 root data:Selection_9", - "│ └─Selection_9 10.00 cop eq(Column#2, 2)", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 10.00 cop[tikv] eq(Column#2, 2)", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableDual_11 8000.00 root rows:0", )) tk.MustQuery("explain select * from t1 left join t2 on t2.a = 1 and t2.a = 2;").Check(testkit.Rows( "HashLeftJoin_6 10000.00 root CARTESIAN left outer join, inner:TableReader_11", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_11 0.00 root data:Selection_10", - " └─Selection_10 0.00 cop eq(Column#5, 1), eq(Column#5, 2)", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_10 0.00 cop[tikv] eq(Column#5, 1), eq(Column#5, 2)", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) // Constant propagation for DNF in outer join. tk.MustQuery("explain select * from t1 left join t2 on t1.a = 1 or (t1.a = 2 and t1.a = 3);").Check(testkit.Rows( "HashLeftJoin_6 100000000.00 root CARTESIAN left outer join, inner:TableReader_10, left cond:[or(eq(Column#2, 1), 0)]", "├─TableReader_8 10000.00 root data:TableScan_7", - "│ └─TableScan_7 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_7 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_10 10000.00 root data:TableScan_9", - " └─TableScan_9 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_9 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("explain select * from t1 left join t2 on true where t1.a = 1 or (t1.a = 2 and t1.a = 3);").Check(testkit.Rows( "HashLeftJoin_7 80000.00 root CARTESIAN left outer join, inner:TableReader_12", "├─TableReader_10 10.00 root data:Selection_9", - "│ └─Selection_9 10.00 cop or(eq(Column#2, 1), 0)", - "│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_9 10.00 cop[tikv] or(eq(Column#2, 1), 0)", + "│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_12 10000.00 root data:TableScan_11", - " └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) // Constant propagation over left outer semi join, filter with aux column should not be derived. tk.MustQuery("explain select * from t1 where t1.b > 1 or t1.b in (select b from t2);").Check(testkit.Rows( @@ -257,8 +257,8 @@ func (s *testSuite) TestOuterJoinPropConst(c *C) { "└─Selection_8 8000.00 root or(gt(Column#3, 1), Column#8)", " └─HashLeftJoin_9 10000.00 root CARTESIAN left outer semi join, inner:TableReader_13, other cond:eq(Column#3, Column#6)", " ├─TableReader_11 10000.00 root data:TableScan_10", - " │ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + " │ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", " └─TableReader_13 10000.00 root data:TableScan_12", - " └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_12 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) } diff --git a/expression/expression.go b/expression/expression.go index 1a302a635ed06..f2228ac03769b 100644 --- a/expression/expression.go +++ b/expression/expression.go @@ -533,3 +533,29 @@ func IsBinaryLiteral(expr Expression) bool { con, ok := expr.(*Constant) return ok && con.Value.Kind() == types.KindBinaryLiteral } + +// CheckExprPushFlash checks a expr list whether each expr can be pushed to flash storage. +func CheckExprPushFlash(exprs []Expression) (exprPush, remain []Expression) { + for _, expr := range exprs { + switch x := expr.(type) { + case *Constant, *CorrelatedColumn, *Column: + exprPush = append(exprPush, expr) + case *ScalarFunction: + switch x.FuncName.L { + case ast.Plus, ast.Minus, ast.Div, ast.Mul, + ast.NullEQ, ast.GE, ast.LE, ast.EQ, ast.NE, + ast.LT, ast.GT, ast.Ifnull, ast.IsNull, ast.Or, + ast.In, ast.Mod, ast.And, ast.LogicOr, ast.LogicAnd, + ast.Like, ast.UnaryNot: + if _, r := CheckExprPushFlash(x.GetArgs()); len(r) > 0 { + remain = append(remain, expr) + } else { + exprPush = append(exprPush, expr) + } + default: + remain = append(remain, expr) + } + } + } + return +} diff --git a/expression/integration_test.go b/expression/integration_test.go index 8d7f2be02788f..bfec4aa7366c4 100755 --- a/expression/integration_test.go +++ b/expression/integration_test.go @@ -3302,7 +3302,7 @@ func (s *testIntegrationSuite) TestCompareBuiltin(c *C) { result.Check(testkit.Rows( "Projection_3 10000.00 root eq(Column#1, Column#1)", "└─TableReader_5 10000.00 root data:TableScan_4", - " └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo", )) // for interval @@ -4612,8 +4612,8 @@ func (s *testIntegrationSuite) TestTimestampDatumEncode(c *C) { tk.MustExec(`insert into t values (1, "2019-04-29 11:56:12")`) tk.MustQuery(`explain select * from t where b = (select max(b) from t)`).Check(testkit.Rows( "TableReader_43 10.00 root data:Selection_42", - "└─Selection_42 10.00 cop eq(Column#2, 2019-04-29 11:56:12)", - " └─TableScan_41 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo", + "└─Selection_42 10.00 cop[tikv] eq(Column#2, 2019-04-29 11:56:12)", + " └─TableScan_41 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo", )) tk.MustQuery(`select * from t where b = (select max(b) from t)`).Check(testkit.Rows(`1 2019-04-29 11:56:12`)) } diff --git a/planner/cascades/integration_test.go b/planner/cascades/integration_test.go index 212c3b2d76118..ce935f48a6e07 100644 --- a/planner/cascades/integration_test.go +++ b/planner/cascades/integration_test.go @@ -67,7 +67,7 @@ func (s *testIntegrationSuite) TestPKIsHandleRangeScan(c *C) { tk.MustQuery("explain select b from t where a > 1").Check(testkit.Rows( "Projection_8 3333.33 root Column#2", "└─TableReader_9 3333.33 root data:TableScan_10", - " └─TableScan_10 3333.33 cop table:t, range:(1,+inf], keep order:false, stats:pseudo", + " └─TableScan_10 3333.33 cop[tikv] table:t, range:(1,+inf], keep order:false, stats:pseudo", )) tk.MustQuery("select b from t where a > 1").Check(testkit.Rows( "4", @@ -75,7 +75,7 @@ func (s *testIntegrationSuite) TestPKIsHandleRangeScan(c *C) { tk.MustQuery("explain select b from t where a > 1 and a < 3").Check(testkit.Rows( "Projection_8 2.00 root Column#2", "└─TableReader_9 2.00 root data:TableScan_10", - " └─TableScan_10 2.00 cop table:t, range:(1,3), keep order:false, stats:pseudo", + " └─TableScan_10 2.00 cop[tikv] table:t, range:(1,3), keep order:false, stats:pseudo", )) tk.MustQuery("select b from t where a > 1 and a < 3").Check(testkit.Rows()) } diff --git a/planner/core/cbo_test.go b/planner/core/cbo_test.go index c3e4bfea62bcb..b14e27a0d1f31 100644 --- a/planner/core/cbo_test.go +++ b/planner/core/cbo_test.go @@ -124,11 +124,11 @@ func (s *testAnalyzeSuite) TestCBOWithoutAnalyze(c *C) { testKit.MustQuery("explain select * from t1, t2 where t1.a = t2.a").Check(testkit.Rows( "HashLeftJoin_8 7.49 root inner join, inner:TableReader_15, equal:[eq(Column#1, Column#3)]", "├─TableReader_12 5.99 root data:Selection_11", - "│ └─Selection_11 5.99 cop not(isnull(Column#1))", - "│ └─TableScan_10 6.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_11 5.99 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_10 6.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_15 5.99 root data:Selection_14", - " └─Selection_14 5.99 cop not(isnull(Column#3))", - " └─TableScan_13 6.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_14 5.99 cop[tikv] not(isnull(Column#3))", + " └─TableScan_13 6.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", )) } @@ -153,13 +153,13 @@ func (s *testAnalyzeSuite) TestStraightJoin(c *C) { "├─HashLeftJoin_12 1000000000000.00 root CARTESIAN inner join, inner:TableReader_21", "│ ├─HashLeftJoin_14 100000000.00 root CARTESIAN inner join, inner:TableReader_19", "│ │ ├─TableReader_17 10000.00 root data:TableScan_16", - "│ │ │ └─TableScan_16 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ │ │ └─TableScan_16 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "│ │ └─TableReader_19 10000.00 root data:TableScan_18", - "│ │ └─TableScan_18 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ │ └─TableScan_18 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", "│ └─TableReader_21 10000.00 root data:TableScan_20", - "│ └─TableScan_20 10000.00 cop table:t3, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_20 10000.00 cop[tikv] table:t3, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_23 10000.00 root data:TableScan_22", - " └─TableScan_22 10000.00 cop table:t4, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_22 10000.00 cop[tikv] table:t4, range:[-inf,+inf], keep order:false, stats:pseudo", )) testKit.MustQuery("explain select * from t1 straight_join t2 straight_join t3 straight_join t4").Check(testkit.Rows( @@ -167,13 +167,13 @@ func (s *testAnalyzeSuite) TestStraightJoin(c *C) { "├─HashLeftJoin_12 1000000000000.00 root CARTESIAN inner join, inner:TableReader_21", "│ ├─HashLeftJoin_14 100000000.00 root CARTESIAN inner join, inner:TableReader_19", "│ │ ├─TableReader_17 10000.00 root data:TableScan_16", - "│ │ │ └─TableScan_16 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ │ │ └─TableScan_16 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "│ │ └─TableReader_19 10000.00 root data:TableScan_18", - "│ │ └─TableScan_18 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ │ └─TableScan_18 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", "│ └─TableReader_21 10000.00 root data:TableScan_20", - "│ └─TableScan_20 10000.00 cop table:t3, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_20 10000.00 cop[tikv] table:t3, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_23 10000.00 root data:TableScan_22", - " └─TableScan_22 10000.00 cop table:t4, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─TableScan_22 10000.00 cop[tikv] table:t4, range:[-inf,+inf], keep order:false, stats:pseudo", )) testKit.MustQuery("explain select straight_join * from t1, t2, t3, t4 where t1.a=t4.a;").Check(testkit.Rows( @@ -181,15 +181,15 @@ func (s *testAnalyzeSuite) TestStraightJoin(c *C) { "├─HashLeftJoin_13 999000000000.00 root CARTESIAN inner join, inner:TableReader_23", "│ ├─HashRightJoin_16 99900000.00 root CARTESIAN inner join, inner:TableReader_19", "│ │ ├─TableReader_19 9990.00 root data:Selection_18", - "│ │ │ └─Selection_18 9990.00 cop not(isnull(Column#1))", - "│ │ │ └─TableScan_17 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ │ │ └─Selection_18 9990.00 cop[tikv] not(isnull(Column#1))", + "│ │ │ └─TableScan_17 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "│ │ └─TableReader_21 10000.00 root data:TableScan_20", - "│ │ └─TableScan_20 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ │ └─TableScan_20 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo", "│ └─TableReader_23 10000.00 root data:TableScan_22", - "│ └─TableScan_22 10000.00 cop table:t3, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─TableScan_22 10000.00 cop[tikv] table:t3, range:[-inf,+inf], keep order:false, stats:pseudo", "└─TableReader_26 9990.00 root data:Selection_25", - " └─Selection_25 9990.00 cop not(isnull(Column#7))", - " └─TableScan_24 10000.00 cop table:t4, range:[-inf,+inf], keep order:false, stats:pseudo", + " └─Selection_25 9990.00 cop[tikv] not(isnull(Column#7))", + " └─TableScan_24 10000.00 cop[tikv] table:t4, range:[-inf,+inf], keep order:false, stats:pseudo", )) } @@ -249,8 +249,8 @@ func (s *testAnalyzeSuite) TestEstimation(c *C) { testKit.MustQuery("explain select count(*) from t group by a").Check(testkit.Rows( "HashAgg_9 2.00 root group by:Column#6, funcs:count(Column#5)", "└─TableReader_10 2.00 root data:HashAgg_5", - " └─HashAgg_5 2.00 cop group by:Column#1, funcs:count(1)", - " └─TableScan_8 8.00 cop table:t, range:[-inf,+inf], keep order:false", + " └─HashAgg_5 2.00 cop[tikv] group by:Column#1, funcs:count(1)", + " └─TableScan_8 8.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) } @@ -591,14 +591,14 @@ func (s *testAnalyzeSuite) TestOutdatedAnalyze(c *C) { statistics.RatioOfPseudoEstimate.Store(10.0) testKit.MustQuery("explain select * from t where a <= 5 and b <= 5").Check(testkit.Rows( "TableReader_7 35.91 root data:Selection_6", - "└─Selection_6 35.91 cop le(Column#1, 5), le(Column#2, 5)", - " └─TableScan_5 80.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 35.91 cop[tikv] le(Column#1, 5), le(Column#2, 5)", + " └─TableScan_5 80.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) statistics.RatioOfPseudoEstimate.Store(0.7) testKit.MustQuery("explain select * from t where a <= 5 and b <= 5").Check(testkit.Rows( "TableReader_7 8.84 root data:Selection_6", - "└─Selection_6 8.84 cop le(Column#1, 5), le(Column#2, 5)", - " └─TableScan_5 80.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo", + "└─Selection_6 8.84 cop[tikv] le(Column#1, 5), le(Column#2, 5)", + " └─TableScan_5 80.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo", )) } @@ -660,26 +660,26 @@ func (s *testAnalyzeSuite) TestNullCount(c *C) { testKit.MustExec("analyze table t") testKit.MustQuery("explain select * from t where a is null").Check(testkit.Rows( "TableReader_7 2.00 root data:Selection_6", - "└─Selection_6 2.00 cop isnull(Column#1)", - " └─TableScan_5 2.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 2.00 cop[tikv] isnull(Column#1)", + " └─TableScan_5 2.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) testKit.MustQuery("explain select * from t use index(idx) where a is null").Check(testkit.Rows( "IndexLookUp_7 2.00 root ", - "├─IndexScan_5 2.00 cop table:t, index:a, range:[NULL,NULL], keep order:false", - "└─TableScan_6 2.00 cop table:t, keep order:false", + "├─IndexScan_5 2.00 cop[tikv] table:t, index:a, range:[NULL,NULL], keep order:false", + "└─TableScan_6 2.00 cop[tikv] table:t, keep order:false", )) h := dom.StatsHandle() h.Clear() c.Assert(h.Update(dom.InfoSchema()), IsNil) testKit.MustQuery("explain select * from t where b = 1").Check(testkit.Rows( "TableReader_7 0.00 root data:Selection_6", - "└─Selection_6 0.00 cop eq(Column#2, 1)", - " └─TableScan_5 2.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 0.00 cop[tikv] eq(Column#2, 1)", + " └─TableScan_5 2.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) testKit.MustQuery("explain select * from t where b < 1").Check(testkit.Rows( "TableReader_7 0.00 root data:Selection_6", - "└─Selection_6 0.00 cop lt(Column#2, 1)", - " └─TableScan_5 2.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 0.00 cop[tikv] lt(Column#2, 1)", + " └─TableScan_5 2.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) } @@ -702,27 +702,27 @@ func (s *testAnalyzeSuite) TestCorrelatedEstimation(c *C) { "Projection_11 10.00 root Column#15", "└─Apply_13 10.00 root CARTESIAN left outer semi join, inner:StreamAgg_22, other cond:eq(Column#3, Column#13)", " ├─TableReader_15 10.00 root data:TableScan_14", - " │ └─TableScan_14 10.00 cop table:t, range:[-inf,+inf], keep order:false", + " │ └─TableScan_14 10.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", " └─StreamAgg_22 1.00 root funcs:count(1)", " └─HashLeftJoin_23 1.00 root inner join, inner:TableReader_33, equal:[eq(Column#5, Column#9)]", " ├─TableReader_27 1.00 root data:Selection_26", - " │ └─Selection_26 1.00 cop eq(Column#5, Column#1), not(isnull(Column#5))", - " │ └─TableScan_25 10.00 cop table:s, range:[-inf,+inf], keep order:false", + " │ └─Selection_26 1.00 cop[tikv] eq(Column#5, Column#1), not(isnull(Column#5))", + " │ └─TableScan_25 10.00 cop[tikv] table:s, range:[-inf,+inf], keep order:false", " └─TableReader_33 1.00 root data:Selection_32", - " └─Selection_32 1.00 cop eq(Column#9, Column#1), not(isnull(Column#9))", - " └─TableScan_31 10.00 cop table:t1, range:[-inf,+inf], keep order:false", + " └─Selection_32 1.00 cop[tikv] eq(Column#9, Column#1), not(isnull(Column#9))", + " └─TableScan_31 10.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false", )) tk.MustQuery("explain select (select concat(t1.a, \",\", t1.b) from t t1 where t1.a=t.a and t1.c=t.c) from t"). Check(testkit.Rows( "Projection_8 10.00 root Column#9", "└─Apply_10 10.00 root CARTESIAN left outer join, inner:MaxOneRow_15", " ├─TableReader_12 10.00 root data:TableScan_11", - " │ └─TableScan_11 10.00 cop table:t, range:[-inf,+inf], keep order:false", + " │ └─TableScan_11 10.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", " └─MaxOneRow_15 1.00 root ", " └─Projection_16 0.10 root concat(cast(Column#5), \",\", cast(Column#6))", " └─IndexReader_19 0.10 root index:Selection_18", - " └─Selection_18 0.10 cop eq(Column#5, Column#1)", - " └─IndexScan_17 1.00 cop table:t1, index:c, b, a, range: decided by [eq(Column#7, Column#3)], keep order:false", + " └─Selection_18 0.10 cop[tikv] eq(Column#5, Column#1)", + " └─IndexScan_17 1.00 cop[tikv] table:t1, index:c, b, a, range: decided by [eq(Column#7, Column#3)], keep order:false", )) } @@ -751,9 +751,9 @@ func (s *testAnalyzeSuite) TestInconsistentEstimation(c *C) { tk.MustQuery("explain select * from t use index(ab) where a = 5 and c = 5"). Check(testkit.Rows( "IndexLookUp_8 10.00 root ", - "├─IndexScan_5 12.50 cop table:t, index:a, b, range:[5,5], keep order:false", - "└─Selection_7 10.00 cop eq(Column#3, 5)", - " └─TableScan_6 12.50 cop table:t, keep order:false", + "├─IndexScan_5 12.50 cop[tikv] table:t, index:a, b, range:[5,5], keep order:false", + "└─Selection_7 10.00 cop[tikv] eq(Column#3, 5)", + " └─TableScan_6 12.50 cop[tikv] table:t, keep order:false", )) } diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index f322ad3bf1664..61c8c84c4702d 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -26,6 +26,7 @@ import ( "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/infoschema" + "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/metrics" "github.com/pingcap/tidb/privilege" "github.com/pingcap/tidb/sessionctx" @@ -698,22 +699,31 @@ func (e *Explain) explainPlanInRowFormat(p Plan, taskType, indent string, isLast switch x := p.(type) { case *PhysicalTableReader: - e.explainPlanInRowFormat(x.tablePlan, "cop", childIndent, true) + var storeType string + switch x.StoreType { + case kv.TiKV: + storeType = "tikv" + case kv.TiFlash: + storeType = "tiflash" + default: + storeType = "unknown" + } + e.explainPlanInRowFormat(x.tablePlan, "cop["+storeType+"]", childIndent, true) case *PhysicalIndexReader: - e.explainPlanInRowFormat(x.indexPlan, "cop", childIndent, true) + e.explainPlanInRowFormat(x.indexPlan, "cop[tikv]", childIndent, true) case *PhysicalIndexLookUpReader: - e.explainPlanInRowFormat(x.indexPlan, "cop", childIndent, false) - e.explainPlanInRowFormat(x.tablePlan, "cop", childIndent, true) + e.explainPlanInRowFormat(x.indexPlan, "cop[tikv]", childIndent, false) + e.explainPlanInRowFormat(x.tablePlan, "cop[tikv]", childIndent, true) case *PhysicalIndexMergeReader: for i := 0; i < len(x.partialPlans); i++ { if x.tablePlan == nil && i == len(x.partialPlans)-1 { - e.explainPlanInRowFormat(x.partialPlans[i], "cop", childIndent, true) + e.explainPlanInRowFormat(x.partialPlans[i], "cop[tikv]", childIndent, true) } else { - e.explainPlanInRowFormat(x.partialPlans[i], "cop", childIndent, false) + e.explainPlanInRowFormat(x.partialPlans[i], "cop[tikv]", childIndent, false) } } if x.tablePlan != nil { - e.explainPlanInRowFormat(x.tablePlan, "cop", childIndent, true) + e.explainPlanInRowFormat(x.tablePlan, "cop[tikv]", childIndent, true) } case *Insert: if x.SelectPlan != nil { diff --git a/planner/core/exhaust_physical_plans.go b/planner/core/exhaust_physical_plans.go index b979c6bd655ea..8082cef1ef28f 100644 --- a/planner/core/exhaust_physical_plans.go +++ b/planner/core/exhaust_physical_plans.go @@ -464,7 +464,7 @@ func (p *LogicalJoin) getIndexJoinByOuterIdx(prop *property.PhysicalProperty, ou } ds, isDataSource := innerChild.(*DataSource) us, isUnionScan := innerChild.(*LogicalUnionScan) - if !isDataSource && !isUnionScan { + if (!isDataSource && !isUnionScan) || (isDataSource && ds.preferStoreType&preferTiFlash != 0) { return nil } if isUnionScan { diff --git a/planner/core/find_best_task.go b/planner/core/find_best_task.go index b9e96acb17bff..6e666d2db83aa 100644 --- a/planner/core/find_best_task.go +++ b/planner/core/find_best_task.go @@ -21,6 +21,7 @@ import ( "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/infoschema" + "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/planner/property" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/statistics" @@ -457,6 +458,10 @@ func (ds *DataSource) findBestTask(prop *property.PhysicalProperty) (t task, err } continue } + // TiFlash storage do not support index scan. + if ds.preferStoreType&preferTiFlash != 0 { + continue + } idxTask, err := ds.convertToIndexScan(prop, candidate) if err != nil { return nil, err @@ -1014,7 +1019,13 @@ func (ds *DataSource) getOriginalPhysicalTableScan(prop *property.PhysicalProper Ranges: path.ranges, AccessCondition: path.accessConds, filterCondition: path.tableFilters, + StoreType: kv.TiKV, }.Init(ds.ctx, ds.blockOffset) + if ds.preferStoreType&preferTiFlash != 0 { + ts.StoreType = kv.TiFlash + } else { + ts.StoreType = kv.TiKV + } ts.SetSchema(ds.schema) if ts.Table.PKIsHandle { if pkColInfo := ts.Table.GetPkColInfo(); pkColInfo != nil { diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index c6f6452140c46..0b0506c8c364d 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -70,6 +70,8 @@ const ( HintIgnoreIndex = "ignore_index" // HintAggToCop is hint enforce pushing aggregation to coprocessor. HintAggToCop = "agg_to_cop" + // HintReadFromStorage is hint enforce some tables read from specific type of storage. + HintReadFromStorage = "read_from_storage" ) const ( @@ -377,6 +379,22 @@ func (p *LogicalJoin) setPreferredJoinType(hintInfo *tableHintInfo) { } } +func (p *DataSource) setPreferredStoreType(hintInfo *tableHintInfo) { + if hintInfo == nil { + return + } + + var alias *hintTableInfo + if len(p.TableAsName.L) != 0 { + alias = &hintTableInfo{name: *p.TableAsName, selectOffset: p.SelectBlockOffset()} + } else { + alias = extractTableAlias(p) + } + if hintInfo.ifPreferTiFlash(alias) { + p.preferStoreType |= preferTiFlash + } +} + func resetNotNullFlag(schema *expression.Schema, start, end int) { for i := start; i < end; i++ { col := *schema.Columns[i] @@ -1971,6 +1989,7 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, nodeType n var ( sortMergeTables, INLJTables, hashJoinTables []hintTableInfo indexHintList []indexHintInfo + tiflashTables []hintTableInfo aggHints aggHintInfo ) for _, hint := range hints { @@ -2009,16 +2028,21 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, nodeType n }, }) } + case HintReadFromStorage: + if hint.StoreType.L == "tiflash" { + tiflashTables = tableNames2HintTableInfo(hint.Tables, b.hintProcessor, nodeType, currentLevel) + } default: // ignore hints that not implemented } } - if len(sortMergeTables)+len(INLJTables)+len(hashJoinTables)+len(indexHintList) > 0 || aggHints.preferAggType != 0 || aggHints.preferAggToCop { + if len(sortMergeTables)+len(INLJTables)+len(hashJoinTables)+len(indexHintList)+len(tiflashTables) > 0 || aggHints.preferAggType != 0 || aggHints.preferAggToCop { b.tableHintInfo = append(b.tableHintInfo, tableHintInfo{ sortMergeJoinTables: sortMergeTables, indexNestedLoopJoinTables: INLJTables, hashJoinTables: hashJoinTables, indexHintList: indexHintList, + flashTables: tiflashTables, aggHints: aggHints, }) return true @@ -2388,6 +2412,7 @@ func (b *PlanBuilder) buildDataSource(ctx context.Context, tn *ast.TableName, as b.handleHelper.pushMap(nil) } ds.SetSchema(schema) + ds.setPreferredStoreType(b.TableHints()) // Init fullIdxCols, fullIdxColLens for accessPaths. for _, path := range ds.possibleAccessPaths { diff --git a/planner/core/logical_plans.go b/planner/core/logical_plans.go index afe988226839a..055690a857ede 100644 --- a/planner/core/logical_plans.go +++ b/planner/core/logical_plans.go @@ -102,6 +102,8 @@ const ( preferMergeJoin preferHashAgg preferStreamAgg + preferTiKV + preferTiFlash ) // LogicalJoin is the logical join plan. @@ -368,6 +370,8 @@ type DataSource struct { // TblColHists contains the Histogram of all original table columns, // it is converted from statisticTable, and used for IO/network cost estimating. TblColHists *statistics.HistColl + //preferStoreType means the DataSource is enforced to which storage. + preferStoreType int } // TableGather is a leaf logical operator of TiDB layer to gather diff --git a/planner/core/physical_plans.go b/planner/core/physical_plans.go index ce103daaed282..ab1be7098a47f 100644 --- a/planner/core/physical_plans.go +++ b/planner/core/physical_plans.go @@ -204,6 +204,8 @@ type PhysicalTableScan struct { // HandleIdx is the index of handle, which is only used for admin check table. HandleIdx int + StoreType kv.StoreType + // The table scan may be a partition, rather than a real table. isPartition bool // KeepOrder is true, if sort data by scanning pkcol, diff --git a/planner/core/planbuilder.go b/planner/core/planbuilder.go index aaa9f3edc677c..4a6d287bdf621 100644 --- a/planner/core/planbuilder.go +++ b/planner/core/planbuilder.go @@ -60,6 +60,7 @@ type tableHintInfo struct { sortMergeJoinTables []hintTableInfo hashJoinTables []hintTableInfo indexHintList []indexHintInfo + flashTables []hintTableInfo aggHints aggHintInfo } @@ -102,6 +103,10 @@ func (info *tableHintInfo) ifPreferINLJ(tableNames ...*hintTableInfo) bool { return info.matchTableName(tableNames, info.indexNestedLoopJoinTables) } +func (info *tableHintInfo) ifPreferTiFlash(tableNames ...*hintTableInfo) bool { + return info.matchTableName(tableNames, info.flashTables) +} + // matchTableName checks whether the hint hit the need. // Only need either side matches one on the list. // Even though you can put 2 tables on the list, diff --git a/planner/core/rule_predicate_push_down.go b/planner/core/rule_predicate_push_down.go index 397a8d5a5f08b..72244399b28e4 100644 --- a/planner/core/rule_predicate_push_down.go +++ b/planner/core/rule_predicate_push_down.go @@ -100,6 +100,10 @@ func (p *LogicalUnionScan) PredicatePushDown(predicates []expression.Expression) // PredicatePushDown implements LogicalPlan PredicatePushDown interface. func (ds *DataSource) PredicatePushDown(predicates []expression.Expression) ([]expression.Expression, LogicalPlan) { ds.allConds = predicates + if ds.preferStoreType&preferTiFlash != 0 { + ds.pushedDownConds, predicates = expression.CheckExprPushFlash(predicates) + return predicates, ds + } _, ds.pushedDownConds, predicates = expression.ExpressionsToPB(ds.ctx.GetSessionVars().StmtCtx, predicates, ds.ctx.GetClient()) return predicates, ds } diff --git a/planner/core/task.go b/planner/core/task.go index 2ae87eae85110..913897f5c375e 100644 --- a/planner/core/task.go +++ b/planner/core/task.go @@ -23,6 +23,7 @@ import ( "github.com/pingcap/parser/mysql" "github.com/pingcap/tidb/expression" "github.com/pingcap/tidb/expression/aggregation" + "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/statistics" "github.com/pingcap/tidb/types" @@ -603,8 +604,16 @@ func finishCopTask(ctx sessionctx.Context, task task) task { p.stats = t.indexPlan.statsInfo() newTask.p = p } else { - splitCopAvg2CountAndSum(t.tablePlan) - p := PhysicalTableReader{tablePlan: t.tablePlan}.Init(ctx, t.tablePlan.SelectBlockOffset()) + tp := t.tablePlan + splitCopAvg2CountAndSum(tp) + for len(tp.Children()) > 0 { + tp = tp.Children()[0] + } + ts := tp.(*PhysicalTableScan) + p := PhysicalTableReader{ + tablePlan: t.tablePlan, + StoreType: ts.StoreType, + }.Init(ctx, t.tablePlan.SelectBlockOffset()) p.stats = t.tablePlan.statsInfo() newTask.p = p } @@ -843,11 +852,19 @@ func (sel *PhysicalSelection) attach2Task(tasks ...task) task { return t } -func (p *basePhysicalAgg) newPartialAggregate() (partial, final PhysicalPlan) { +func (p *basePhysicalAgg) newPartialAggregate(copToFlash bool) (partial, final PhysicalPlan) { // Check if this aggregation can push down. sc := p.ctx.GetSessionVars().StmtCtx client := p.ctx.GetClient() for _, aggFunc := range p.AggFuncs { + if copToFlash { + if !aggregation.CheckAggPushFlash(aggFunc) { + return nil, p.self + } + if _, remain := expression.CheckExprPushFlash(append(aggFunc.Args, p.GroupByItems...)); len(remain) > 0 { + return nil, p.self + } + } pb := aggregation.AggFuncToPBExpr(sc, client, aggFunc) if pb == nil { return nil, p.self @@ -968,7 +985,14 @@ func (p *PhysicalStreamAgg) attach2Task(tasks ...task) task { t := tasks[0].copy() inputRows := t.count() if cop, ok := t.(*copTask); ok { - partialAgg, finalAgg := p.newPartialAggregate() + // copToFlash means whether the cop task is run on flash storage + copToFlash := false + if cop.tablePlan != nil { + if ts, ok := cop.tablePlan.(*PhysicalTableScan); ok { + copToFlash = ts.StoreType == kv.TiFlash + } + } + partialAgg, finalAgg := p.newPartialAggregate(copToFlash) if partialAgg != nil { if cop.tablePlan != nil { cop.finishIndexPlan() @@ -1026,7 +1050,14 @@ func (p *PhysicalHashAgg) attach2Task(tasks ...task) task { t := tasks[0].copy() inputRows := t.count() if cop, ok := t.(*copTask); ok { - partialAgg, finalAgg := p.newPartialAggregate() + // copToFlash means whether the cop task is running on flash storage + copToFlash := false + if cop.tablePlan != nil { + if ts, ok := cop.tablePlan.(*PhysicalTableScan); ok { + copToFlash = ts.StoreType == kv.TiFlash + } + } + partialAgg, finalAgg := p.newPartialAggregate(copToFlash) if partialAgg != nil { if cop.tablePlan != nil { cop.finishIndexPlan() diff --git a/planner/core/testdata/analyze_suite_out.json b/planner/core/testdata/analyze_suite_out.json index 3eeade5e19251..dff2b27a2324d 100644 --- a/planner/core/testdata/analyze_suite_out.json +++ b/planner/core/testdata/analyze_suite_out.json @@ -10,8 +10,8 @@ "Plan": [ "TopN_8 1.00 root Column#1:asc, offset:0, count:1", "└─IndexReader_16 1.00 root index:TopN_15", - " └─TopN_15 1.00 cop Column#1:asc, offset:0, count:1", - " └─IndexScan_14 10.00 cop table:t, index:b, c, range:[2,2], keep order:false, stats:pseudo" + " └─TopN_15 1.00 cop[tikv] Column#1:asc, offset:0, count:1", + " └─IndexScan_14 10.00 cop[tikv] table:t, index:b, c, range:[2,2], keep order:false, stats:pseudo" ] }, { @@ -23,8 +23,8 @@ "Plan": [ "TopN_8 1.00 root Column#1:asc, offset:0, count:1", "└─IndexReader_16 1.00 root index:TopN_15", - " └─TopN_15 1.00 cop Column#1:asc, offset:0, count:1", - " └─IndexScan_14 6.00 cop table:t, index:b, c, range:[2,2], keep order:false" + " └─TopN_15 1.00 cop[tikv] Column#1:asc, offset:0, count:1", + " └─IndexScan_14 6.00 cop[tikv] table:t, index:b, c, range:[2,2], keep order:false" ] }, { @@ -37,8 +37,8 @@ "Plan": [ "TopN_8 1.00 root Column#1:asc, offset:0, count:1", "└─IndexReader_16 1.00 root index:TopN_15", - " └─TopN_15 1.00 cop Column#1:asc, offset:0, count:1", - " └─IndexScan_14 6.00 cop table:t, index:b, c, range:[-inf,6], keep order:false" + " └─TopN_15 1.00 cop[tikv] Column#1:asc, offset:0, count:1", + " └─IndexScan_14 6.00 cop[tikv] table:t, index:b, c, range:[-inf,6], keep order:false" ] }, { @@ -50,10 +50,10 @@ "└─IndexMergeJoin_70 1.00 root left outer semi join, inner:IndexReader_68, outer key:Column#1, inner key:Column#8", " ├─TopN_29 1.00 root Column#1:asc, offset:0, count:1", " │ └─IndexReader_37 1.00 root index:TopN_36", - " │ └─TopN_36 1.00 cop Column#1:asc, offset:0, count:1", - " │ └─IndexScan_35 6.00 cop table:t1, index:b, c, range:[-inf,6], keep order:false", + " │ └─TopN_36 1.00 cop[tikv] Column#1:asc, offset:0, count:1", + " │ └─IndexScan_35 6.00 cop[tikv] table:t1, index:b, c, range:[-inf,6], keep order:false", " └─IndexReader_68 1.04 root index:IndexScan_67", - " └─IndexScan_67 1.04 cop table:t2, index:b, c, range: decided by [eq(Column#8, Column#1)], keep order:true" + " └─IndexScan_67 1.04 cop[tikv] table:t2, index:b, c, range: decided by [eq(Column#8, Column#1)], keep order:true" ] }, { @@ -66,8 +66,8 @@ "Plan": [ "TopN_8 1.00 root Column#1:desc, offset:0, count:1", "└─IndexReader_16 1.00 root index:TopN_15", - " └─TopN_15 1.00 cop Column#1:desc, offset:0, count:1", - " └─IndexScan_14 6.00 cop table:t, index:b, c, range:[1,1], keep order:false" + " └─TopN_15 1.00 cop[tikv] Column#1:desc, offset:0, count:1", + " └─IndexScan_14 6.00 cop[tikv] table:t, index:b, c, range:[1,1], keep order:false" ] }, { @@ -80,9 +80,9 @@ "Plan": [ "Limit_11 1.00 root offset:0, count:1", "└─TableReader_22 1.00 root data:Limit_21", - " └─Limit_21 1.00 cop offset:0, count:1", - " └─Selection_20 1.00 cop eq(Column#2, 2)", - " └─TableScan_19 4.17 cop table:t, range:[-inf,+inf], keep order:true" + " └─Limit_21 1.00 cop[tikv] offset:0, count:1", + " └─Selection_20 1.00 cop[tikv] eq(Column#2, 2)", + " └─TableScan_19 4.17 cop[tikv] table:t, range:[-inf,+inf], keep order:true" ] }, { @@ -93,8 +93,8 @@ "Plan": [ "TopN_8 1.00 root Column#1:asc, offset:0, count:1", "└─IndexReader_16 1.00 root index:TopN_15", - " └─TopN_15 1.00 cop Column#1:asc, offset:0, count:1", - " └─IndexScan_14 6.00 cop table:t, index:b, c, range:[2,2], keep order:false" + " └─TopN_15 1.00 cop[tikv] Column#1:asc, offset:0, count:1", + " └─IndexScan_14 6.00 cop[tikv] table:t, index:b, c, range:[2,2], keep order:false" ] }, { @@ -108,9 +108,9 @@ "Plan": [ "TopN_8 1.00 root Column#1:asc, offset:0, count:1", "└─IndexReader_19 1.00 root index:TopN_18", - " └─TopN_18 1.00 cop Column#1:asc, offset:0, count:1", - " └─Selection_17 6.00 cop gt(Column#1, 0)", - " └─IndexScan_16 6.00 cop table:t, index:b, c, range:[2,2], keep order:false" + " └─TopN_18 1.00 cop[tikv] Column#1:asc, offset:0, count:1", + " └─Selection_17 6.00 cop[tikv] gt(Column#1, 0)", + " └─IndexScan_16 6.00 cop[tikv] table:t, index:b, c, range:[2,2], keep order:false" ] }, { @@ -125,9 +125,9 @@ "Projection_7 1.00 root Column#1", "└─TopN_8 1.00 root Column#1:asc, offset:0, count:1", " └─IndexReader_17 1.00 root index:TopN_16", - " └─TopN_16 1.00 cop Column#1:asc, offset:0, count:1", - " └─Selection_15 6.00 cop gt(Column#3, 0)", - " └─IndexScan_14 6.00 cop table:t, index:b, d, a, c, range:[2,2], keep order:false" + " └─TopN_16 1.00 cop[tikv] Column#1:asc, offset:0, count:1", + " └─Selection_15 6.00 cop[tikv] gt(Column#3, 0)", + " └─IndexScan_14 6.00 cop[tikv] table:t, index:b, d, a, c, range:[2,2], keep order:false" ] } ] @@ -144,11 +144,11 @@ "Plan": [ "IndexMergeJoin_14 12475.01 root inner join, inner:IndexReader_12, outer key:Column#1, inner key:Column#5, other cond:eq(Column#3, Column#7), gt(Column#6, minus(Column#2, 1)), lt(Column#6, plus(Column#2, 1))", "├─TableReader_19 9980.01 root data:Selection_18", - "│ └─Selection_18 9980.01 cop not(isnull(Column#1)), not(isnull(Column#3))", - "│ └─TableScan_17 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_18 9980.01 cop[tikv] not(isnull(Column#1)), not(isnull(Column#3))", + "│ └─TableScan_17 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─IndexReader_12 1.25 root index:Selection_11", - " └─Selection_11 1.25 cop not(isnull(Column#5)), not(isnull(Column#7))", - " └─IndexScan_10 1.25 cop table:t2, index:a, b, c, range: decided by [eq(Column#5, Column#1) gt(Column#6, minus(Column#2, 1)) lt(Column#6, plus(Column#2, 1))], keep order:true, stats:pseudo" + " └─Selection_11 1.25 cop[tikv] not(isnull(Column#5)), not(isnull(Column#7))", + " └─IndexScan_10 1.25 cop[tikv] table:t2, index:a, b, c, range: decided by [eq(Column#5, Column#1) gt(Column#6, minus(Column#2, 1)) lt(Column#6, plus(Column#2, 1))], keep order:true, stats:pseudo" ] }, { @@ -160,11 +160,11 @@ "Projection_7 0.00 root Column#1, Column#2, Column#4, Column#5", "└─HashRightJoin_9 0.00 root inner join, inner:IndexReader_15, equal:[eq(Column#5, Column#2)]", " ├─IndexReader_15 0.00 root index:Selection_14", - " │ └─Selection_14 0.00 cop isnull(Column#5), not(isnull(Column#5))", - " │ └─IndexScan_13 10000.00 cop table:t2, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo", + " │ └─Selection_14 0.00 cop[tikv] isnull(Column#5), not(isnull(Column#5))", + " │ └─IndexScan_13 10000.00 cop[tikv] table:t2, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo", " └─IndexReader_21 9990.00 root index:Selection_20", - " └─Selection_20 9990.00 cop not(isnull(Column#2))", - " └─IndexScan_19 10000.00 cop table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo" + " └─Selection_20 9990.00 cop[tikv] not(isnull(Column#2))", + " └─IndexScan_19 10000.00 cop[tikv] table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo" ] } ] diff --git a/planner/core/testdata/integration_suite_out.json b/planner/core/testdata/integration_suite_out.json index 51e8c4001d067..3434d771dd7ff 100644 --- a/planner/core/testdata/integration_suite_out.json +++ b/planner/core/testdata/integration_suite_out.json @@ -6,9 +6,9 @@ "SQL": "explain select * from tbl use index(idx_b_c) where b > 1 limit 2,1", "Plan": [ "IndexLookUp_14 1.00 root limit embedded(offset:2, count:1)", - "├─Limit_13 3.00 cop offset:0, count:3", - "│ └─IndexScan_11 3.00 cop table:tbl, index:b, c, range:(1,+inf], keep order:false", - "└─TableScan_12 1.00 cop table:tbl, keep order:false, stats:pseudo" + "├─Limit_13 3.00 cop[tikv] offset:0, count:3", + "│ └─IndexScan_11 3.00 cop[tikv] table:tbl, index:b, c, range:(1,+inf], keep order:false", + "└─TableScan_12 1.00 cop[tikv] table:tbl, keep order:false, stats:pseudo" ] }, { @@ -16,19 +16,19 @@ "Plan": [ "Projection_25 1.00 root Column#1, Column#2, Column#3", "└─IndexLookUp_24 1.00 root limit embedded(offset:2, count:1)", - " ├─Limit_23 3.00 cop offset:0, count:3", - " │ └─IndexScan_21 3.00 cop table:tbl, index:b, c, range:(1,+inf], keep order:true, desc", - " └─TableScan_22 1.00 cop table:tbl, keep order:false, stats:pseudo" + " ├─Limit_23 3.00 cop[tikv] offset:0, count:3", + " │ └─IndexScan_21 3.00 cop[tikv] table:tbl, index:b, c, range:(1,+inf], keep order:true, desc", + " └─TableScan_22 1.00 cop[tikv] table:tbl, keep order:false, stats:pseudo" ] }, { "SQL": "explain select * from tbl use index(idx_b_c) where b > 1 and c > 1 limit 2,1", "Plan": [ "IndexLookUp_15 1.00 root limit embedded(offset:2, count:1)", - "├─Limit_14 3.00 cop offset:0, count:3", - "│ └─Selection_13 3.00 cop gt(Column#3, 1)", - "│ └─IndexScan_11 3.75 cop table:tbl, index:b, c, range:(1,+inf], keep order:false", - "└─TableScan_12 1.00 cop table:tbl, keep order:false, stats:pseudo" + "├─Limit_14 3.00 cop[tikv] offset:0, count:3", + "│ └─Selection_13 3.00 cop[tikv] gt(Column#3, 1)", + "│ └─IndexScan_11 3.75 cop[tikv] table:tbl, index:b, c, range:(1,+inf], keep order:false", + "└─TableScan_12 1.00 cop[tikv] table:tbl, keep order:false, stats:pseudo" ] }, { @@ -36,10 +36,10 @@ "Plan": [ "Limit_9 1.00 root offset:2, count:1", "└─IndexLookUp_15 3.00 root ", - " ├─IndexScan_11 3.75 cop table:tbl, index:b, c, range:(1,+inf], keep order:false", - " └─Limit_14 3.00 cop offset:0, count:3", - " └─Selection_13 3.00 cop gt(Column#1, 1)", - " └─TableScan_12 3.75 cop table:tbl, keep order:false" + " ├─IndexScan_11 3.75 cop[tikv] table:tbl, index:b, c, range:(1,+inf], keep order:false", + " └─Limit_14 3.00 cop[tikv] offset:0, count:3", + " └─Selection_13 3.00 cop[tikv] gt(Column#1, 1)", + " └─TableScan_12 3.75 cop[tikv] table:tbl, keep order:false" ] } ] diff --git a/statistics/selectivity_test.go b/statistics/selectivity_test.go index 7b636656b3d92..f0e7d74314761 100644 --- a/statistics/selectivity_test.go +++ b/statistics/selectivity_test.go @@ -324,7 +324,7 @@ func (s *testStatsSuite) TestDiscreteDistribution(c *C) { testKit.MustExec("analyze table t") testKit.MustQuery("explain select * from t where a = 'tw' and b < 0").Check(testkit.Rows( "IndexReader_6 0.00 root index:IndexScan_5", - "└─IndexScan_5 0.00 cop table:t, index:a, b, range:[\"tw\" -inf,\"tw\" 0), keep order:false")) + "└─IndexScan_5 0.00 cop[tikv] table:t, index:a, b, range:[\"tw\" -inf,\"tw\" 0), keep order:false")) } func (s *testStatsSuite) TestSelectCombinedLowBound(c *C) { @@ -337,7 +337,7 @@ func (s *testStatsSuite) TestSelectCombinedLowBound(c *C) { testKit.MustExec("analyze table t") testKit.MustQuery("explain select * from t where kid = 1").Check(testkit.Rows( "IndexReader_6 7.00 root index:IndexScan_5", - "└─IndexScan_5 7.00 cop table:t, index:kid, pid, range:[1,1], keep order:false")) + "└─IndexScan_5 7.00 cop[tikv] table:t, index:kid, pid, range:[1,1], keep order:false")) } func getRange(start, end int64) []*ranger.Range { @@ -432,14 +432,14 @@ func (s *testStatsSuite) TestPrimaryKeySelectivity(c *C) { testKit.MustExec("create table t(a char(10) primary key, b int)") testKit.MustQuery(`explain select * from t where a > "t"`).Check(testkit.Rows( "TableReader_7 3333.33 root data:Selection_6", - "└─Selection_6 3333.33 cop gt(Column#1, \"t\")", - " └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo")) + "└─Selection_6 3333.33 cop[tikv] gt(Column#1, \"t\")", + " └─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo")) testKit.MustExec("drop table t") testKit.MustExec("create table t(a int primary key, b int)") testKit.MustQuery(`explain select * from t where a > 1`).Check(testkit.Rows( "TableReader_6 3333.33 root data:TableScan_5", - "└─TableScan_5 3333.33 cop table:t, range:(1,+inf], keep order:false, stats:pseudo")) + "└─TableScan_5 3333.33 cop[tikv] table:t, range:(1,+inf], keep order:false, stats:pseudo")) } func BenchmarkSelectivity(b *testing.B) { @@ -491,49 +491,49 @@ func (s *testStatsSuite) TestColumnIndexNullEstimation(c *C) { testKit.MustExec("analyze table t") testKit.MustQuery(`explain select b from t where b is null`).Check(testkit.Rows( "IndexReader_6 4.00 root index:IndexScan_5", - "└─IndexScan_5 4.00 cop table:t, index:b, range:[NULL,NULL], keep order:false", + "└─IndexScan_5 4.00 cop[tikv] table:t, index:b, range:[NULL,NULL], keep order:false", )) testKit.MustQuery(`explain select b from t where b is not null`).Check(testkit.Rows( "IndexReader_6 1.00 root index:IndexScan_5", - "└─IndexScan_5 1.00 cop table:t, index:b, range:[-inf,+inf], keep order:false", + "└─IndexScan_5 1.00 cop[tikv] table:t, index:b, range:[-inf,+inf], keep order:false", )) testKit.MustQuery(`explain select b from t where b is null or b > 3`).Check(testkit.Rows( "IndexReader_6 4.00 root index:IndexScan_5", - "└─IndexScan_5 4.00 cop table:t, index:b, range:[NULL,NULL], (3,+inf], keep order:false", + "└─IndexScan_5 4.00 cop[tikv] table:t, index:b, range:[NULL,NULL], (3,+inf], keep order:false", )) testKit.MustQuery(`explain select b from t use index(idx_b)`).Check(testkit.Rows( "IndexReader_5 5.00 root index:IndexScan_4", - "└─IndexScan_4 5.00 cop table:t, index:b, range:[NULL,+inf], keep order:false", + "└─IndexScan_4 5.00 cop[tikv] table:t, index:b, range:[NULL,+inf], keep order:false", )) testKit.MustQuery(`explain select b from t where b < 4`).Check(testkit.Rows( "IndexReader_6 1.00 root index:IndexScan_5", - "└─IndexScan_5 1.00 cop table:t, index:b, range:[-inf,4), keep order:false", + "└─IndexScan_5 1.00 cop[tikv] table:t, index:b, range:[-inf,4), keep order:false", )) // Make sure column stats has been loaded. testKit.MustExec(`explain select * from t where a is null`) c.Assert(h.LoadNeededHistograms(), IsNil) testKit.MustQuery(`explain select * from t where a is null`).Check(testkit.Rows( "TableReader_7 1.00 root data:Selection_6", - "└─Selection_6 1.00 cop isnull(Column#1)", - " └─TableScan_5 5.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 1.00 cop[tikv] isnull(Column#1)", + " └─TableScan_5 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) testKit.MustQuery(`explain select * from t where a is not null`).Check(testkit.Rows( "TableReader_7 4.00 root data:Selection_6", - "└─Selection_6 4.00 cop not(isnull(Column#1))", - " └─TableScan_5 5.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 4.00 cop[tikv] not(isnull(Column#1))", + " └─TableScan_5 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) testKit.MustQuery(`explain select * from t where a is null or a > 3`).Check(testkit.Rows( "TableReader_7 2.00 root data:Selection_6", - "└─Selection_6 2.00 cop or(isnull(Column#1), gt(Column#1, 3))", - " └─TableScan_5 5.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 2.00 cop[tikv] or(isnull(Column#1), gt(Column#1, 3))", + " └─TableScan_5 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) testKit.MustQuery(`explain select * from t`).Check(testkit.Rows( "TableReader_5 5.00 root data:TableScan_4", - "└─TableScan_4 5.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─TableScan_4 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) testKit.MustQuery(`explain select * from t where a < 4`).Check(testkit.Rows( "TableReader_7 3.00 root data:Selection_6", - "└─Selection_6 3.00 cop lt(Column#1, 4)", - " └─TableScan_5 5.00 cop table:t, range:[-inf,+inf], keep order:false", + "└─Selection_6 3.00 cop[tikv] lt(Column#1, 4)", + " └─TableScan_5 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", )) } diff --git a/util/ranger/ranger_test.go b/util/ranger/ranger_test.go index c623c5197a12f..262e725a60873 100644 --- a/util/ranger/ranger_test.go +++ b/util/ranger/ranger_test.go @@ -1085,9 +1085,9 @@ func (s *testRangerSuite) TestIndexRangeElimininatedProjection(c *C) { testKit.MustQuery("explain select * from (select * from t union all select ifnull(a,b), b from t) sub where a > 0").Check(testkit.Rows( "Union_11 2.00 root ", "├─IndexReader_14 1.00 root index:IndexScan_13", - "│ └─IndexScan_13 1.00 cop table:t, index:a, b, range:(0,+inf], keep order:false", + "│ └─IndexScan_13 1.00 cop[tikv] table:t, index:a, b, range:(0,+inf], keep order:false", "└─IndexReader_17 1.00 root index:IndexScan_16", - " └─IndexScan_16 1.00 cop table:t, index:a, b, range:(0,+inf], keep order:false", + " └─IndexScan_16 1.00 cop[tikv] table:t, index:a, b, range:(0,+inf], keep order:false", )) testKit.MustQuery("select * from (select * from t union all select ifnull(a,b), b from t) sub where a > 0").Check(testkit.Rows( "1 2", diff --git a/util/ranger/testdata/ranger_suite_out.json b/util/ranger/testdata/ranger_suite_out.json index 95cefa1a26917..dcb3afdd2e7a9 100644 --- a/util/ranger/testdata/ranger_suite_out.json +++ b/util/ranger/testdata/ranger_suite_out.json @@ -8,13 +8,13 @@ "Projection_11 2.00 root Column#18", "└─Apply_13 2.00 root CARTESIAN left outer semi join, inner:StreamAgg_20, other cond:eq(Column#5, Column#16)", " ├─TableReader_15 2.00 root data:TableScan_14", - " │ └─TableScan_14 2.00 cop table:t, range:[-inf,+inf], keep order:false", + " │ └─TableScan_14 2.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false", " └─StreamAgg_20 1.00 root funcs:count(1)", " └─IndexMergeJoin_44 2.00 root inner join, inner:TableReader_42, outer key:Column#6, inner key:Column#11", " ├─IndexReader_33 2.00 root index:IndexScan_32", - " │ └─IndexScan_32 2.00 cop table:s, index:b, c, d, range: decided by [eq(Column#7, 1) in(Column#8, 1, 2) eq(Column#9, Column#1)], keep order:false", + " │ └─IndexScan_32 2.00 cop[tikv] table:s, index:b, c, d, range: decided by [eq(Column#7, 1) in(Column#8, 1, 2) eq(Column#9, Column#1)], keep order:false", " └─TableReader_42 1.00 root data:TableScan_41", - " └─TableScan_41 1.00 cop table:t1, range: decided by [Column#6], keep order:true" + " └─TableScan_41 1.00 cop[tikv] table:t1, range: decided by [Column#6], keep order:true" ] }, { From 820b69bd7e020d0273a4f52768a64f0a9f494c1a Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Sun, 29 Sep 2019 17:50:46 +0800 Subject: [PATCH 2/9] add explain test for tiflash --- cmd/explaintest/r/access_tiflash.result | 32 +++++++++++++++++++++++++ cmd/explaintest/t/access_tiflash.test | 13 ++++++++++ 2 files changed, 45 insertions(+) create mode 100644 cmd/explaintest/r/access_tiflash.result create mode 100644 cmd/explaintest/t/access_tiflash.test diff --git a/cmd/explaintest/r/access_tiflash.result b/cmd/explaintest/r/access_tiflash.result new file mode 100644 index 0000000000000..e5c80adacdb3e --- /dev/null +++ b/cmd/explaintest/r/access_tiflash.result @@ -0,0 +1,32 @@ +drop table if exists t, tt; +create table t(a int, b int, index ia(a)); +desc select avg(a) from t; +id count task operator info +StreamAgg_20 1.00 root funcs:avg(Column#8, Column#9) +└─IndexReader_21 1.00 root index:StreamAgg_8 + └─StreamAgg_8 1.00 cop[tikv] funcs:avg(Column#1) + └─IndexScan_19 10000.00 cop[tikv] table:t, index:a, range:[NULL,+inf], keep order:false, stats:pseudo +desc select /*+ read_from_storage(tiflash[t]) */ avg(a) from t; +id count task operator info +StreamAgg_16 1.00 root funcs:avg(Column#8, Column#9) +└─TableReader_17 1.00 root data:StreamAgg_8 + └─StreamAgg_8 1.00 cop[tiflash] funcs:count(Column#1), sum(Column#1) + └─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo +desc select /*+ read_from_storage(tiflash[t]) */ sum(a) from t; +id count task operator info +StreamAgg_16 1.00 root funcs:sum(Column#7) +└─TableReader_17 1.00 root data:StreamAgg_8 + └─StreamAgg_8 1.00 cop[tiflash] funcs:sum(Column#1) + └─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo +desc select /*+ read_from_storage(tiflash[t]) */ sum(a+1) from t; +id count task operator info +StreamAgg_16 1.00 root funcs:sum(Column#7) +└─TableReader_17 1.00 root data:StreamAgg_8 + └─StreamAgg_8 1.00 cop[tiflash] funcs:sum(plus(Column#1, 1)) + └─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo +desc select /*+ read_from_storage(tiflash[t]) */ sum(isnull(a)) from t; +id count task operator info +StreamAgg_16 1.00 root funcs:sum(Column#7) +└─TableReader_17 1.00 root data:StreamAgg_8 + └─StreamAgg_8 1.00 cop[tiflash] funcs:sum(isnull(Column#1)) + └─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/t/access_tiflash.test b/cmd/explaintest/t/access_tiflash.test new file mode 100644 index 0000000000000..cb891d0e9de1f --- /dev/null +++ b/cmd/explaintest/t/access_tiflash.test @@ -0,0 +1,13 @@ +drop table if exists t, tt; + +create table t(a int, b int, index ia(a)); + +desc select avg(a) from t; + +desc select /*+ read_from_storage(tiflash[t]) */ avg(a) from t; + +desc select /*+ read_from_storage(tiflash[t]) */ sum(a) from t; + +desc select /*+ read_from_storage(tiflash[t]) */ sum(a+1) from t; + +desc select /*+ read_from_storage(tiflash[t]) */ sum(isnull(a)) from t; \ No newline at end of file From 5099bbbfec50668b0b4f0b1ad23ca54c27f90ee0 Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Sun, 29 Sep 2019 18:04:07 +0800 Subject: [PATCH 3/9] fix ci --- cmd/explaintest/r/explain_easy.result | 348 +- cmd/explaintest/r/explain_easy_stats.result | 86 +- cmd/explaintest/r/explain_indexmerge.result | 44 +- cmd/explaintest/r/generated_columns.result | 70 +- cmd/explaintest/r/index_join.result | 28 +- cmd/explaintest/r/partition_pruning.result | 3270 +++++++++---------- cmd/explaintest/r/select.result | 96 +- cmd/explaintest/r/subquery.result | 10 +- cmd/explaintest/r/topn_push_down.result | 62 +- cmd/explaintest/r/tpch.result | 258 +- cmd/explaintest/r/window_function.result | 14 +- planner/core/logical_plan_builder.go | 10 +- 12 files changed, 2148 insertions(+), 2148 deletions(-) diff --git a/cmd/explaintest/r/explain_easy.result b/cmd/explaintest/r/explain_easy.result index 2889317c581a5..a5393e40ea357 100644 --- a/cmd/explaintest/r/explain_easy.result +++ b/cmd/explaintest/r/explain_easy.result @@ -15,41 +15,41 @@ Projection_11 8000.00 root Column#1, Column#2, Column#3, Column#4 └─HashLeftJoin_12 8000.00 root semi join, inner:StreamAgg_27, equal:[eq(Column#19, Column#11)] ├─Projection_13 10000.00 root Column#1, Column#2, Column#3, Column#4, cast(Column#1) │ └─TableReader_15 10000.00 root data:TableScan_14 - │ └─TableScan_14 10000.00 cop table:t3, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_14 10000.00 cop[tikv] table:t3, range:[-inf,+inf], keep order:false, stats:pseudo └─StreamAgg_27 1.00 root funcs:sum(Column#22) └─TableReader_28 1.00 root data:StreamAgg_19 - └─StreamAgg_19 1.00 cop funcs:sum(Column#6) - └─TableScan_26 10000.00 cop table:s, range:[-inf,+inf], keep order:false, stats:pseudo + └─StreamAgg_19 1.00 cop[tikv] funcs:sum(Column#6) + └─TableScan_26 10000.00 cop[tikv] table:s, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1; id count task operator info TableReader_5 10000.00 root data:TableScan_4 -└─TableScan_4 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +└─TableScan_4 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 order by c2; id count task operator info IndexLookUp_12 10000.00 root -├─IndexScan_10 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:true, stats:pseudo -└─TableScan_11 10000.00 cop table:t1, keep order:false, stats:pseudo +├─IndexScan_10 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:true, stats:pseudo +└─TableScan_11 10000.00 cop[tikv] table:t1, keep order:false, stats:pseudo explain select * from t2 order by c2; id count task operator info Sort_4 10000.00 root Column#5:asc └─TableReader_8 10000.00 root data:TableScan_7 - └─TableScan_7 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_7 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where t1.c1 > 0; id count task operator info TableReader_6 3333.33 root data:TableScan_5 -└─TableScan_5 3333.33 cop table:t1, range:(0,+inf], keep order:false, stats:pseudo +└─TableScan_5 3333.33 cop[tikv] table:t1, range:(0,+inf], keep order:false, stats:pseudo explain select t1.c1, t1.c2 from t1 where t1.c2 = 1; id count task operator info IndexReader_6 10.00 root index:IndexScan_5 -└─IndexScan_5 10.00 cop table:t1, index:c2, range:[1,1], keep order:false, stats:pseudo +└─IndexScan_5 10.00 cop[tikv] table:t1, index:c2, range:[1,1], keep order:false, stats:pseudo explain select * from t1 left join t2 on t1.c2 = t2.c1 where t1.c1 > 1; id count task operator info HashLeftJoin_21 4166.67 root left outer join, inner:TableReader_34, equal:[eq(Column#2, Column#4)] ├─TableReader_31 3333.33 root data:TableScan_30 -│ └─TableScan_30 3333.33 cop table:t1, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_30 3333.33 cop[tikv] table:t1, range:(1,+inf], keep order:false, stats:pseudo └─TableReader_34 9990.00 root data:Selection_33 - └─Selection_33 9990.00 cop not(isnull(Column#4)) - └─TableScan_32 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_33 9990.00 cop[tikv] not(isnull(Column#4)) + └─TableScan_32 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain update t1 set t1.c2 = 2 where t1.c1 = 1; id count task operator info Update_2 N/A root N/A @@ -58,64 +58,64 @@ explain delete from t1 where t1.c2 = 1; id count task operator info Delete_3 N/A root N/A └─IndexLookUp_9 10.00 root - ├─IndexScan_7 10.00 cop table:t1, index:c2, range:[1,1], keep order:false, stats:pseudo - └─TableScan_8 10.00 cop table:t1, keep order:false, stats:pseudo + ├─IndexScan_7 10.00 cop[tikv] table:t1, index:c2, range:[1,1], keep order:false, stats:pseudo + └─TableScan_8 10.00 cop[tikv] table:t1, keep order:false, stats:pseudo explain select count(b.c2) from t1 a, t2 b where a.c1 = b.c2 group by a.c1; id count task operator info Projection_11 9990.00 root cast(Column#9) └─HashLeftJoin_21 9990.00 root inner join, inner:HashAgg_28, equal:[eq(Column#1, Column#5)] ├─IndexReader_36 10000.00 root index:IndexScan_35 - │ └─IndexScan_35 10000.00 cop table:a, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_35 10000.00 cop[tikv] table:a, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo └─HashAgg_28 7992.00 root group by:Column#12, funcs:count(Column#10), firstrow(Column#12) └─TableReader_29 7992.00 root data:HashAgg_23 - └─HashAgg_23 7992.00 cop group by:Column#5, funcs:count(Column#5) - └─Selection_27 9990.00 cop not(isnull(Column#5)) - └─TableScan_26 10000.00 cop table:b, range:[-inf,+inf], keep order:false, stats:pseudo + └─HashAgg_23 7992.00 cop[tikv] group by:Column#5, funcs:count(Column#5) + └─Selection_27 9990.00 cop[tikv] not(isnull(Column#5)) + └─TableScan_26 10000.00 cop[tikv] table:b, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 order by t2.c2 limit 0, 1; id count task operator info TopN_7 1.00 root Column#2:asc, offset:0, count:1 └─TableReader_15 1.00 root data:TopN_14 - └─TopN_14 1.00 cop Column#2:asc, offset:0, count:1 - └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TopN_14 1.00 cop[tikv] Column#2:asc, offset:0, count:1 + └─TableScan_13 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where c1 > 1 and c2 = 1 and c3 < 1; id count task operator info IndexLookUp_11 1.11 root -├─IndexScan_8 33.33 cop table:t1, index:c2, range:(1 1,1 +inf], keep order:false, stats:pseudo -└─Selection_10 1.11 cop lt(Column#3, 1) - └─TableScan_9 33.33 cop table:t1, keep order:false, stats:pseudo +├─IndexScan_8 33.33 cop[tikv] table:t1, index:c2, range:(1 1,1 +inf], keep order:false, stats:pseudo +└─Selection_10 1.11 cop[tikv] lt(Column#3, 1) + └─TableScan_9 33.33 cop[tikv] table:t1, keep order:false, stats:pseudo explain select * from t1 where c1 = 1 and c2 > 1; id count task operator info TableReader_7 0.33 root data:Selection_6 -└─Selection_6 0.33 cop gt(Column#2, 1) - └─TableScan_5 1.00 cop table:t1, range:[1,1], keep order:false, stats:pseudo +└─Selection_6 0.33 cop[tikv] gt(Column#2, 1) + └─TableScan_5 1.00 cop[tikv] table:t1, range:[1,1], keep order:false, stats:pseudo explain select sum(t1.c1 in (select c1 from t2)) from t1; id count task operator info StreamAgg_12 1.00 root funcs:sum(Column#0) └─Projection_23 10000.00 root cast(Column#8) └─HashLeftJoin_22 10000.00 root CARTESIAN left outer semi join, inner:IndexReader_21, other cond:eq(Column#1, Column#4) ├─IndexReader_17 10000.00 root index:IndexScan_16 - │ └─IndexScan_16 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_16 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_21 10000.00 root index:IndexScan_20 - └─IndexScan_20 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:false, stats:pseudo + └─IndexScan_20 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:false, stats:pseudo explain select c1 from t1 where c1 in (select c2 from t2); id count task operator info Projection_9 9990.00 root Column#1 └─HashLeftJoin_19 9990.00 root inner join, inner:HashAgg_23, equal:[eq(Column#1, Column#5)] ├─IndexReader_34 10000.00 root index:IndexScan_33 - │ └─IndexScan_33 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_33 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo └─HashAgg_23 7992.00 root group by:Column#5, funcs:firstrow(Column#5) └─TableReader_30 9990.00 root data:Selection_29 - └─Selection_29 9990.00 cop not(isnull(Column#5)) - └─TableScan_28 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_29 9990.00 cop[tikv] not(isnull(Column#5)) + └─TableScan_28 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain select (select count(1) k from t1 s where s.c1 = t1.c1 having k != 0) from t1; id count task operator info Projection_12 10000.00 root ifnull(Column#7, 0) └─MergeJoin_13 10000.00 root left outer join, left key:Column#1, right key:Column#4 ├─TableReader_16 10000.00 root data:TableScan_15 - │ └─TableScan_15 10000.00 cop table:t1, range:[-inf,+inf], keep order:true, stats:pseudo + │ └─TableScan_15 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:true, stats:pseudo └─Projection_17 8000.00 root 1, Column#4 └─TableReader_19 10000.00 root data:TableScan_18 - └─TableScan_18 10000.00 cop table:s, range:[-inf,+inf], keep order:true, stats:pseudo + └─TableScan_18 10000.00 cop[tikv] table:s, range:[-inf,+inf], keep order:true, stats:pseudo explain select * from information_schema.columns; id count task operator info MemTableScan_4 10000.00 root @@ -124,42 +124,42 @@ id count task operator info Projection_12 10000.00 root eq(Column#2, Column#5) └─Apply_14 10000.00 root CARTESIAN left outer join, inner:Projection_43 ├─IndexReader_18 10000.00 root index:IndexScan_17 - │ └─IndexScan_17 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_17 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo └─Projection_43 1.00 root Column#4, Column#5 └─IndexLookUp_42 1.00 root limit embedded(offset:0, count:1) - ├─Limit_41 1.00 cop offset:0, count:1 - │ └─IndexScan_39 1.00 cop table:t2, index:c1, range: decided by [eq(Column#1, Column#4)], keep order:true, stats:pseudo - └─TableScan_40 1.00 cop table:t2, keep order:false, stats:pseudo + ├─Limit_41 1.00 cop[tikv] offset:0, count:1 + │ └─IndexScan_39 1.00 cop[tikv] table:t2, index:c1, range: decided by [eq(Column#1, Column#4)], keep order:true, stats:pseudo + └─TableScan_40 1.00 cop[tikv] table:t2, keep order:false, stats:pseudo explain select * from t1 order by c1 desc limit 1; id count task operator info Limit_10 1.00 root offset:0, count:1 └─TableReader_20 1.00 root data:Limit_19 - └─Limit_19 1.00 cop offset:0, count:1 - └─TableScan_18 1.00 cop table:t1, range:[-inf,+inf], keep order:true, desc, stats:pseudo + └─Limit_19 1.00 cop[tikv] offset:0, count:1 + └─TableScan_18 1.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:true, desc, stats:pseudo explain select * from t4 use index(idx) where a > 1 and b > 1 and c > 1 limit 1; id count task operator info Limit_9 1.00 root offset:0, count:1 └─IndexLookUp_16 1.00 root - ├─Selection_13 3.00 cop gt(Column#2, 1) - │ └─IndexScan_11 9.00 cop table:t4, index:a, b, range:(1,+inf], keep order:false, stats:pseudo - └─Limit_15 1.00 cop offset:0, count:1 - └─Selection_14 1.00 cop gt(Column#3, 1) - └─TableScan_12 3.00 cop table:t4, keep order:false, stats:pseudo + ├─Selection_13 3.00 cop[tikv] gt(Column#2, 1) + │ └─IndexScan_11 9.00 cop[tikv] table:t4, index:a, b, range:(1,+inf], keep order:false, stats:pseudo + └─Limit_15 1.00 cop[tikv] offset:0, count:1 + └─Selection_14 1.00 cop[tikv] gt(Column#3, 1) + └─TableScan_12 3.00 cop[tikv] table:t4, keep order:false, stats:pseudo explain select * from t4 where a > 1 and c > 1 limit 1; id count task operator info Limit_8 1.00 root offset:0, count:1 └─TableReader_14 1.00 root data:Limit_13 - └─Limit_13 1.00 cop offset:0, count:1 - └─Selection_12 1.00 cop gt(Column#3, 1) - └─TableScan_11 3.00 cop table:t4, range:(1,+inf], keep order:false, stats:pseudo + └─Limit_13 1.00 cop[tikv] offset:0, count:1 + └─Selection_12 1.00 cop[tikv] gt(Column#3, 1) + └─TableScan_11 3.00 cop[tikv] table:t4, range:(1,+inf], keep order:false, stats:pseudo explain select ifnull(null, t1.c1) from t1; id count task operator info IndexReader_7 10000.00 root index:IndexScan_6 -└─IndexScan_6 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo +└─IndexScan_6 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo explain select if(10, t1.c1, t1.c2) from t1; id count task operator info IndexReader_7 10000.00 root index:IndexScan_6 -└─IndexScan_6 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo +└─IndexScan_6 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo explain select c1 from t2 union select c1 from t2 union all select c1 from t2; id count task operator info Union_17 26000.00 root @@ -167,53 +167,53 @@ Union_17 26000.00 root │ └─Union_22 16000.00 root │ ├─StreamAgg_27 8000.00 root group by:Column#9, funcs:firstrow(Column#9), firstrow(Column#9) │ │ └─IndexReader_40 10000.00 root index:IndexScan_39 -│ │ └─IndexScan_39 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo +│ │ └─IndexScan_39 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo │ └─StreamAgg_45 8000.00 root group by:Column#5, funcs:firstrow(Column#5), firstrow(Column#5) │ └─IndexReader_58 10000.00 root index:IndexScan_57 -│ └─IndexScan_57 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo +│ └─IndexScan_57 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo └─IndexReader_63 10000.00 root index:IndexScan_62 - └─IndexScan_62 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:false, stats:pseudo + └─IndexScan_62 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:false, stats:pseudo explain select c1 from t2 union all select c1 from t2 union select c1 from t2; id count task operator info HashAgg_18 24000.00 root group by:Column#13, funcs:firstrow(Column#14) └─Union_19 24000.00 root ├─StreamAgg_24 8000.00 root group by:Column#9, funcs:firstrow(Column#9), firstrow(Column#9) │ └─IndexReader_37 10000.00 root index:IndexScan_36 - │ └─IndexScan_36 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo + │ └─IndexScan_36 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo ├─StreamAgg_42 8000.00 root group by:Column#5, funcs:firstrow(Column#5), firstrow(Column#5) │ └─IndexReader_55 10000.00 root index:IndexScan_54 - │ └─IndexScan_54 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo + │ └─IndexScan_54 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo └─StreamAgg_60 8000.00 root group by:Column#1, funcs:firstrow(Column#1), firstrow(Column#1) └─IndexReader_73 10000.00 root index:IndexScan_72 - └─IndexScan_72 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo + └─IndexScan_72 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo explain select count(1) from (select count(1) from (select * from t1 where c3 = 100) k) k2; id count task operator info StreamAgg_13 1.00 root funcs:count(1) └─StreamAgg_28 1.00 root funcs:firstrow(Column#13) └─TableReader_29 1.00 root data:StreamAgg_17 - └─StreamAgg_17 1.00 cop funcs:firstrow(1) - └─Selection_27 10.00 cop eq(Column#3, 100) - └─TableScan_26 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + └─StreamAgg_17 1.00 cop[tikv] funcs:firstrow(1) + └─Selection_27 10.00 cop[tikv] eq(Column#3, 100) + └─TableScan_26 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo explain select 1 from (select count(c2), count(c3) from t1) k; id count task operator info Projection_5 1.00 root 1 └─StreamAgg_21 1.00 root funcs:firstrow(Column#12) └─IndexReader_22 1.00 root index:StreamAgg_9 - └─StreamAgg_9 1.00 cop funcs:firstrow(1) - └─IndexScan_20 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + └─StreamAgg_9 1.00 cop[tikv] funcs:firstrow(1) + └─IndexScan_20 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo explain select count(1) from (select max(c2), count(c3) as m from t1) k; id count task operator info StreamAgg_11 1.00 root funcs:count(1) └─StreamAgg_27 1.00 root funcs:firstrow(Column#12) └─IndexReader_28 1.00 root index:StreamAgg_15 - └─StreamAgg_15 1.00 cop funcs:firstrow(1) - └─IndexScan_26 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + └─StreamAgg_15 1.00 cop[tikv] funcs:firstrow(1) + └─IndexScan_26 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo explain select count(1) from (select count(c2) from t1 group by c3) k; id count task operator info StreamAgg_11 1.00 root funcs:count(1) └─HashAgg_22 8000.00 root group by:Column#3, funcs:firstrow(1) └─TableReader_19 10000.00 root data:TableScan_18 - └─TableScan_18 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_18 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo set @@session.tidb_opt_insubq_to_join_and_agg=0; explain select sum(t1.c1 in (select c1 from t2)) from t1; id count task operator info @@ -221,28 +221,28 @@ StreamAgg_12 1.00 root funcs:sum(Column#0) └─Projection_23 10000.00 root cast(Column#8) └─HashLeftJoin_22 10000.00 root CARTESIAN left outer semi join, inner:IndexReader_21, other cond:eq(Column#1, Column#4) ├─IndexReader_17 10000.00 root index:IndexScan_16 - │ └─IndexScan_16 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_16 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_21 10000.00 root index:IndexScan_20 - └─IndexScan_20 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:false, stats:pseudo + └─IndexScan_20 10000.00 cop[tikv] table:t2, index:c1, range:[NULL,+inf], keep order:false, stats:pseudo explain select 1 in (select c2 from t2) from t1; id count task operator info Projection_6 10000.00 root Column#8 └─HashLeftJoin_7 10000.00 root CARTESIAN left outer semi join, inner:TableReader_14 ├─IndexReader_11 10000.00 root index:IndexScan_10 - │ └─IndexScan_10 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_10 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo └─TableReader_14 10.00 root data:Selection_13 - └─Selection_13 10.00 cop eq(1, Column#5) - └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 10.00 cop[tikv] eq(1, Column#5) + └─TableScan_12 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain select sum(6 in (select c2 from t2)) from t1; id count task operator info StreamAgg_12 1.00 root funcs:sum(Column#0) └─Projection_22 10000.00 root cast(Column#8) └─HashLeftJoin_21 10000.00 root CARTESIAN left outer semi join, inner:TableReader_20 ├─IndexReader_17 10000.00 root index:IndexScan_16 - │ └─IndexScan_16 10000.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_16 10000.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false, stats:pseudo └─TableReader_20 10.00 root data:Selection_19 - └─Selection_19 10.00 cop eq(6, Column#5) - └─TableScan_18 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_19 10.00 cop[tikv] eq(6, Column#5) + └─TableScan_18 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain format="dot" select sum(t1.c1 in (select c1 from t2)) from t1; dot contents @@ -308,39 +308,39 @@ id count task operator info Projection_11 10000.00 root Column#12 └─Apply_13 10000.00 root CARTESIAN left outer semi join, inner:StreamAgg_20, other cond:eq(Column#3, Column#10) ├─TableReader_15 10000.00 root data:TableScan_14 - │ └─TableScan_14 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_14 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo └─StreamAgg_20 1.00 root funcs:count(1) └─MergeJoin_54 12.50 root inner join, left key:Column#4, right key:Column#7 ├─TableReader_47 1.00 root data:TableScan_46 - │ └─TableScan_46 1.00 cop table:s, range: decided by [eq(Column#4, Column#1)], keep order:true, stats:pseudo + │ └─TableScan_46 1.00 cop[tikv] table:s, range: decided by [eq(Column#4, Column#1)], keep order:true, stats:pseudo └─TableReader_49 1.00 root data:TableScan_48 - └─TableScan_48 1.00 cop table:t1, range: decided by [eq(Column#7, Column#1)], keep order:true, stats:pseudo + └─TableScan_48 1.00 cop[tikv] table:t1, range: decided by [eq(Column#7, Column#1)], keep order:true, stats:pseudo explain select t.c in (select count(*) from t s use index(idx), t t1 where s.b = t.a and s.a = t1.a) from t; id count task operator info Projection_11 10000.00 root Column#12 └─Apply_13 10000.00 root CARTESIAN left outer semi join, inner:StreamAgg_20, other cond:eq(Column#3, Column#10) ├─TableReader_15 10000.00 root data:TableScan_14 - │ └─TableScan_14 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_14 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo └─StreamAgg_20 1.00 root funcs:count(1) └─IndexMergeJoin_44 12.50 root inner join, inner:TableReader_42, outer key:Column#4, inner key:Column#7 ├─IndexReader_33 10.00 root index:IndexScan_32 - │ └─IndexScan_32 10.00 cop table:s, index:b, range: decided by [eq(Column#5, Column#1)], keep order:false, stats:pseudo + │ └─IndexScan_32 10.00 cop[tikv] table:s, index:b, range: decided by [eq(Column#5, Column#1)], keep order:false, stats:pseudo └─TableReader_42 1.00 root data:TableScan_41 - └─TableScan_41 1.00 cop table:t1, range: decided by [Column#4], keep order:true, stats:pseudo + └─TableScan_41 1.00 cop[tikv] table:t1, range: decided by [Column#4], keep order:true, stats:pseudo explain select t.c in (select count(*) from t s use index(idx), t t1 where s.b = t.a and s.c = t1.a) from t; id count task operator info Projection_11 10000.00 root Column#12 └─Apply_13 10000.00 root CARTESIAN left outer semi join, inner:StreamAgg_20, other cond:eq(Column#3, Column#10) ├─TableReader_15 10000.00 root data:TableScan_14 - │ └─TableScan_14 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_14 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo └─StreamAgg_20 1.00 root funcs:count(1) └─IndexMergeJoin_46 12.49 root inner join, inner:TableReader_44, outer key:Column#6, inner key:Column#7 ├─IndexLookUp_35 9.99 root - │ ├─IndexScan_32 10.00 cop table:s, index:b, range: decided by [eq(Column#5, Column#1)], keep order:false, stats:pseudo - │ └─Selection_34 9.99 cop not(isnull(Column#6)) - │ └─TableScan_33 10.00 cop table:s, keep order:false, stats:pseudo + │ ├─IndexScan_32 10.00 cop[tikv] table:s, index:b, range: decided by [eq(Column#5, Column#1)], keep order:false, stats:pseudo + │ └─Selection_34 9.99 cop[tikv] not(isnull(Column#6)) + │ └─TableScan_33 10.00 cop[tikv] table:s, keep order:false, stats:pseudo └─TableReader_44 1.00 root data:TableScan_43 - └─TableScan_43 1.00 cop table:t1, range: decided by [Column#6], keep order:true, stats:pseudo + └─TableScan_43 1.00 cop[tikv] table:t1, range: decided by [Column#6], keep order:true, stats:pseudo insert into t values(1, 1, 1), (2, 2 ,2), (3, 3, 3), (4, 3, 4),(5,3,5); analyze table t; explain select t.c in (select count(*) from t s, t t1 where s.b = t.a and s.b = 3 and s.a = t1.a) from t; @@ -348,80 +348,80 @@ id count task operator info Projection_11 5.00 root Column#12 └─Apply_13 5.00 root CARTESIAN left outer semi join, inner:StreamAgg_20, other cond:eq(Column#3, Column#10) ├─TableReader_15 5.00 root data:TableScan_14 - │ └─TableScan_14 5.00 cop table:t, range:[-inf,+inf], keep order:false + │ └─TableScan_14 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false └─StreamAgg_20 1.00 root funcs:count(1) └─MergeJoin_51 2.40 root inner join, left key:Column#4, right key:Column#7 ├─IndexReader_38 2.40 root index:Selection_37 - │ └─Selection_37 2.40 cop eq(3, Column#1) - │ └─IndexScan_36 3.00 cop table:s, index:b, range:[3,3], keep order:true + │ └─Selection_37 2.40 cop[tikv] eq(3, Column#1) + │ └─IndexScan_36 3.00 cop[tikv] table:s, index:b, range:[3,3], keep order:true └─TableReader_41 4.00 root data:Selection_40 - └─Selection_40 4.00 cop eq(3, Column#1) - └─TableScan_39 5.00 cop table:t1, range:[-inf,+inf], keep order:true + └─Selection_40 4.00 cop[tikv] eq(3, Column#1) + └─TableScan_39 5.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:true explain select t.c in (select count(*) from t s left join t t1 on s.a = t1.a where 3 = t.a and s.b = 3) from t; id count task operator info Projection_10 5.00 root Column#12 └─Apply_12 5.00 root CARTESIAN left outer semi join, inner:StreamAgg_19, other cond:eq(Column#3, Column#10) ├─TableReader_14 5.00 root data:TableScan_13 - │ └─TableScan_13 5.00 cop table:t, range:[-inf,+inf], keep order:false + │ └─TableScan_13 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false └─StreamAgg_19 1.00 root funcs:count(1) └─MergeJoin_49 2.40 root left outer join, left key:Column#4, right key:Column#7 ├─IndexReader_36 2.40 root index:Selection_35 - │ └─Selection_35 2.40 cop eq(3, Column#1) - │ └─IndexScan_34 3.00 cop table:s, index:b, range:[3,3], keep order:true + │ └─Selection_35 2.40 cop[tikv] eq(3, Column#1) + │ └─IndexScan_34 3.00 cop[tikv] table:s, index:b, range:[3,3], keep order:true └─TableReader_39 4.00 root data:Selection_38 - └─Selection_38 4.00 cop eq(3, Column#1) - └─TableScan_37 5.00 cop table:t1, range:[-inf,+inf], keep order:true + └─Selection_38 4.00 cop[tikv] eq(3, Column#1) + └─TableScan_37 5.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:true explain select t.c in (select count(*) from t s right join t t1 on s.a = t1.a where 3 = t.a and t1.b = 3) from t; id count task operator info Projection_10 5.00 root Column#12 └─Apply_12 5.00 root CARTESIAN left outer semi join, inner:StreamAgg_19, other cond:eq(Column#3, Column#10) ├─TableReader_14 5.00 root data:TableScan_13 - │ └─TableScan_13 5.00 cop table:t, range:[-inf,+inf], keep order:false + │ └─TableScan_13 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false └─StreamAgg_19 1.00 root funcs:count(1) └─MergeJoin_48 2.40 root right outer join, left key:Column#4, right key:Column#7 ├─TableReader_35 4.00 root data:Selection_34 - │ └─Selection_34 4.00 cop eq(3, Column#1) - │ └─TableScan_33 5.00 cop table:s, range:[-inf,+inf], keep order:true + │ └─Selection_34 4.00 cop[tikv] eq(3, Column#1) + │ └─TableScan_33 5.00 cop[tikv] table:s, range:[-inf,+inf], keep order:true └─IndexReader_38 2.40 root index:Selection_37 - └─Selection_37 2.40 cop eq(3, Column#1) - └─IndexScan_36 3.00 cop table:t1, index:b, range:[3,3], keep order:true + └─Selection_37 2.40 cop[tikv] eq(3, Column#1) + └─IndexScan_36 3.00 cop[tikv] table:t1, index:b, range:[3,3], keep order:true drop table if exists t; create table t(a int unsigned); explain select t.a = '123455' from t; id count task operator info Projection_3 10000.00 root eq(Column#1, 123455) └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select t.a > '123455' from t; id count task operator info Projection_3 10000.00 root gt(Column#1, 123455) └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select t.a != '123455' from t; id count task operator info Projection_3 10000.00 root ne(Column#1, 123455) └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select t.a = 12345678912345678998789678687678.111 from t; id count task operator info Projection_3 10000.00 root 0 └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a bigint, b bigint, index idx(a, b)); explain select * from t where a in (1, 2) and a in (1, 3); id count task operator info IndexReader_6 10.00 root index:IndexScan_5 -└─IndexScan_5 10.00 cop table:t, index:a, b, range:[1,1], keep order:false, stats:pseudo +└─IndexScan_5 10.00 cop[tikv] table:t, index:a, b, range:[1,1], keep order:false, stats:pseudo explain select * from t where b in (1, 2) and b in (1, 3); id count task operator info IndexReader_10 10.00 root index:Selection_9 -└─Selection_9 10.00 cop eq(Column#2, 1) - └─IndexScan_8 10000.00 cop table:t, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_9 10.00 cop[tikv] eq(Column#2, 1) + └─IndexScan_8 10000.00 cop[tikv] table:t, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo explain select * from t where a = 1 and a = 1; id count task operator info IndexReader_6 10.00 root index:IndexScan_5 -└─IndexScan_5 10.00 cop table:t, index:a, b, range:[1,1], keep order:false, stats:pseudo +└─IndexScan_5 10.00 cop[tikv] table:t, index:a, b, range:[1,1], keep order:false, stats:pseudo explain select * from t where a = 1 and a = 2; id count task operator info TableDual_5 0.00 root rows:0 @@ -433,18 +433,18 @@ id count task operator info Projection_7 0.00 root Column#1, Column#2, Column#4, Column#5 └─HashRightJoin_9 0.00 root inner join, inner:IndexReader_15, equal:[eq(Column#5, Column#2)] ├─IndexReader_15 0.00 root index:Selection_14 - │ └─Selection_14 0.00 cop isnull(Column#5), not(isnull(Column#5)) - │ └─IndexScan_13 10000.00 cop table:t2, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─Selection_14 0.00 cop[tikv] isnull(Column#5), not(isnull(Column#5)) + │ └─IndexScan_13 10000.00 cop[tikv] table:t2, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_21 9990.00 root index:Selection_20 - └─Selection_20 9990.00 cop not(isnull(Column#2)) - └─IndexScan_19 10000.00 cop table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_20 9990.00 cop[tikv] not(isnull(Column#2)) + └─IndexScan_19 10000.00 cop[tikv] table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo explain select * from t t1 where not exists (select * from t t2 where t1.b = t2.b); id count task operator info HashLeftJoin_9 8000.00 root anti semi join, inner:IndexReader_17, equal:[eq(Column#2, Column#5)] ├─IndexReader_13 10000.00 root index:IndexScan_12 -│ └─IndexScan_12 10000.00 cop table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_17 10000.00 root index:IndexScan_16 - └─IndexScan_16 10000.00 cop table:t2, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─IndexScan_16 10000.00 cop[tikv] table:t2, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a bigint primary key); explain select * from t where a = 1 and a = 2; @@ -454,7 +454,7 @@ explain select null or a > 1 from t; id count task operator info Projection_3 10000.00 root or(NULL, gt(Column#1, 1)) └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t where a = 1 for update; id count task operator info Point_Get_1 1.00 root table:t, handle:1, lock @@ -469,7 +469,7 @@ Projection_5 8000.00 root Column#1 └─Selection_6 8000.00 root eq(cast(Column#1), 1) └─UnionScan_7 10000.00 root eq(cast(Column#1), 1) └─TableReader_9 10000.00 root data:TableScan_8 - └─TableScan_8 10000.00 cop table:ta, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_8 10000.00 cop[tikv] table:ta, range:[-inf,+inf], keep order:false, stats:pseudo rollback; drop table if exists t1, t2; create table t1(a int, b int, c int, primary key(a, b)); @@ -477,163 +477,163 @@ create table t2(a int, b int, c int, primary key(a)); explain select t1.a, t1.b from t1 left outer join t2 on t1.a = t2.a; id count task operator info IndexReader_9 10000.00 root index:IndexScan_8 -└─IndexScan_8 10000.00 cop table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─IndexScan_8 10000.00 cop[tikv] table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo explain select distinct t1.a, t1.b from t1 left outer join t2 on t1.a = t2.a; id count task operator info IndexReader_11 10000.00 root index:IndexScan_10 -└─IndexScan_10 10000.00 cop table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─IndexScan_10 10000.00 cop[tikv] table:t1, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int, nb int not null, nc int not null); explain select ifnull(a, 0) from t; id count task operator info Projection_3 10000.00 root ifnull(Column#1, 0) └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select ifnull(nb, 0) from t; id count task operator info TableReader_5 10000.00 root data:TableScan_4 -└─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select ifnull(nb, 0), ifnull(nc, 0) from t; id count task operator info TableReader_5 10000.00 root data:TableScan_4 -└─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select ifnull(a, 0), ifnull(nb, 0) from t; id count task operator info Projection_3 10000.00 root ifnull(Column#1, 0), Column#2 └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select ifnull(nb, 0), ifnull(nb, 0) from t; id count task operator info Projection_3 10000.00 root Column#2, Column#2 └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select 1+ifnull(nb, 0) from t; id count task operator info Projection_3 10000.00 root plus(1, Column#2) └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select 1+ifnull(a, 0) from t; id count task operator info Projection_3 10000.00 root plus(1, ifnull(Column#1, 0)) └─TableReader_5 10000.00 root data:TableScan_4 - └─TableScan_4 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_4 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select 1+ifnull(nb, 0) from t where nb=1; id count task operator info Projection_4 10.00 root plus(1, Column#2) └─TableReader_7 10.00 root data:Selection_6 - └─Selection_6 10.00 cop eq(Column#2, 1) - └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_6 10.00 cop[tikv] eq(Column#2, 1) + └─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t ta left outer join t tb on ta.nb = tb.nb and ta.a > 1 where ifnull(ta.nb, 1) or ta.nb is null; id count task operator info HashLeftJoin_7 8320.83 root left outer join, inner:TableReader_12, equal:[eq(Column#2, Column#6)], left cond:[gt(Column#1, 1)] ├─TableReader_10 6656.67 root data:Selection_9 -│ └─Selection_9 6656.67 cop or(Column#2, isnull(Column#2)) -│ └─TableScan_8 10000.00 cop table:ta, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_9 6656.67 cop[tikv] or(Column#2, isnull(Column#2)) +│ └─TableScan_8 10000.00 cop[tikv] table:ta, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_12 10000.00 root data:TableScan_11 - └─TableScan_11 10000.00 cop table:tb, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_11 10000.00 cop[tikv] table:tb, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t ta right outer join t tb on ta.nb = tb.nb and ta.a > 1 where ifnull(tb.nb, 1) or tb.nb is null; id count task operator info HashRightJoin_7 6656.67 root right outer join, inner:TableReader_10, equal:[eq(Column#2, Column#6)] ├─TableReader_10 3333.33 root data:Selection_9 -│ └─Selection_9 3333.33 cop gt(Column#1, 1) -│ └─TableScan_8 10000.00 cop table:ta, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_9 3333.33 cop[tikv] gt(Column#1, 1) +│ └─TableScan_8 10000.00 cop[tikv] table:ta, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_13 6656.67 root data:Selection_12 - └─Selection_12 6656.67 cop or(Column#6, isnull(Column#6)) - └─TableScan_11 10000.00 cop table:tb, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_12 6656.67 cop[tikv] or(Column#6, isnull(Column#6)) + └─TableScan_11 10000.00 cop[tikv] table:tb, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t ta inner join t tb on ta.nb = tb.nb and ta.a > 1 where ifnull(tb.nb, 1) or tb.nb is null; id count task operator info HashRightJoin_9 4166.67 root inner join, inner:TableReader_12, equal:[eq(Column#2, Column#6)] ├─TableReader_12 3333.33 root data:Selection_11 -│ └─Selection_11 3333.33 cop gt(Column#1, 1) -│ └─TableScan_10 10000.00 cop table:ta, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3333.33 cop[tikv] gt(Column#1, 1) +│ └─TableScan_10 10000.00 cop[tikv] table:ta, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_15 6656.67 root data:Selection_14 - └─Selection_14 6656.67 cop or(Column#6, isnull(Column#6)) - └─TableScan_13 10000.00 cop table:tb, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_14 6656.67 cop[tikv] or(Column#6, isnull(Column#6)) + └─TableScan_13 10000.00 cop[tikv] table:tb, range:[-inf,+inf], keep order:false, stats:pseudo explain select ifnull(t.nc, 1) in (select count(*) from t s , t t1 where s.a = t.a and s.a = t1.a) from t; id count task operator info Projection_12 10000.00 root Column#15 └─Apply_14 10000.00 root CARTESIAN left outer semi join, inner:HashAgg_19, other cond:eq(Column#3, Column#13) ├─TableReader_16 10000.00 root data:TableScan_15 - │ └─TableScan_15 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_15 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo └─HashAgg_19 1.00 root funcs:count(Column#17) └─HashLeftJoin_20 9.99 root inner join, inner:HashAgg_30, equal:[eq(Column#5, Column#9)] ├─TableReader_24 9.99 root data:Selection_23 - │ └─Selection_23 9.99 cop eq(Column#5, Column#1), not(isnull(Column#5)) - │ └─TableScan_22 10000.00 cop table:s, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─Selection_23 9.99 cop[tikv] eq(Column#5, Column#1), not(isnull(Column#5)) + │ └─TableScan_22 10000.00 cop[tikv] table:s, range:[-inf,+inf], keep order:false, stats:pseudo └─HashAgg_30 7.99 root group by:Column#20, funcs:count(Column#18), firstrow(Column#20) └─TableReader_31 7.99 root data:HashAgg_25 - └─HashAgg_25 7.99 cop group by:Column#9, funcs:count(1) - └─Selection_29 9.99 cop eq(Column#9, Column#1), not(isnull(Column#9)) - └─TableScan_28 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + └─HashAgg_25 7.99 cop[tikv] group by:Column#9, funcs:count(1) + └─Selection_29 9.99 cop[tikv] eq(Column#9, Column#1), not(isnull(Column#9)) + └─TableScan_28 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t ta left outer join t tb on ta.nb = tb.nb and ta.a > 1 where ifnull(tb.a, 1) or tb.a is null; id count task operator info Selection_7 10000.00 root or(ifnull(Column#5, 1), isnull(Column#5)) └─HashLeftJoin_8 12500.00 root left outer join, inner:TableReader_12, equal:[eq(Column#2, Column#6)], left cond:[gt(Column#1, 1)] ├─TableReader_10 10000.00 root data:TableScan_9 - │ └─TableScan_9 10000.00 cop table:ta, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_9 10000.00 cop[tikv] table:ta, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_12 10000.00 root data:TableScan_11 - └─TableScan_11 10000.00 cop table:tb, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_11 10000.00 cop[tikv] table:tb, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t ta right outer join t tb on ta.nb = tb.nb and ta.a > 1 where ifnull(tb.a, 1) or tb.a is null; id count task operator info HashRightJoin_7 8000.00 root right outer join, inner:TableReader_10, equal:[eq(Column#2, Column#6)] ├─TableReader_10 3333.33 root data:Selection_9 -│ └─Selection_9 3333.33 cop gt(Column#1, 1) -│ └─TableScan_8 10000.00 cop table:ta, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_9 3333.33 cop[tikv] gt(Column#1, 1) +│ └─TableScan_8 10000.00 cop[tikv] table:ta, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_13 8000.00 root data:Selection_12 - └─Selection_12 8000.00 cop or(ifnull(Column#5, 1), isnull(Column#5)) - └─TableScan_11 10000.00 cop table:tb, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_12 8000.00 cop[tikv] or(ifnull(Column#5, 1), isnull(Column#5)) + └─TableScan_11 10000.00 cop[tikv] table:tb, range:[-inf,+inf], keep order:false, stats:pseudo explain select ifnull(t.a, 1) in (select count(*) from t s , t t1 where s.a = t.a and s.a = t1.a) from t; id count task operator info Projection_12 10000.00 root Column#15 └─Apply_14 10000.00 root CARTESIAN left outer semi join, inner:HashAgg_19, other cond:eq(ifnull(Column#1, 1), Column#13) ├─TableReader_16 10000.00 root data:TableScan_15 - │ └─TableScan_15 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_15 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo └─HashAgg_19 1.00 root funcs:count(Column#17) └─HashLeftJoin_20 9.99 root inner join, inner:HashAgg_30, equal:[eq(Column#5, Column#9)] ├─TableReader_24 9.99 root data:Selection_23 - │ └─Selection_23 9.99 cop eq(Column#5, Column#1), not(isnull(Column#5)) - │ └─TableScan_22 10000.00 cop table:s, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─Selection_23 9.99 cop[tikv] eq(Column#5, Column#1), not(isnull(Column#5)) + │ └─TableScan_22 10000.00 cop[tikv] table:s, range:[-inf,+inf], keep order:false, stats:pseudo └─HashAgg_30 7.99 root group by:Column#20, funcs:count(Column#18), firstrow(Column#20) └─TableReader_31 7.99 root data:HashAgg_25 - └─HashAgg_25 7.99 cop group by:Column#9, funcs:count(1) - └─Selection_29 9.99 cop eq(Column#9, Column#1), not(isnull(Column#9)) - └─TableScan_28 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + └─HashAgg_25 7.99 cop[tikv] group by:Column#9, funcs:count(1) + └─Selection_29 9.99 cop[tikv] eq(Column#9, Column#1), not(isnull(Column#9)) + └─TableScan_28 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int); explain select * from t where _tidb_rowid = 0; id count task operator info Projection_4 8000.00 root Column#1 └─TableReader_6 10000.00 root data:TableScan_5 - └─TableScan_5 10000.00 cop table:t, range:[0,0], keep order:false, stats:pseudo + └─TableScan_5 10000.00 cop[tikv] table:t, range:[0,0], keep order:false, stats:pseudo explain select * from t where _tidb_rowid > 0; id count task operator info Projection_4 8000.00 root Column#1 └─TableReader_6 10000.00 root data:TableScan_5 - └─TableScan_5 10000.00 cop table:t, range:(0,+inf], keep order:false, stats:pseudo + └─TableScan_5 10000.00 cop[tikv] table:t, range:(0,+inf], keep order:false, stats:pseudo explain select a, _tidb_rowid from t where a > 0; id count task operator info TableReader_7 3333.33 root data:Selection_6 -└─Selection_6 3333.33 cop gt(Column#1, 0) - └─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_6 3333.33 cop[tikv] gt(Column#1, 0) + └─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t where _tidb_rowid > 0 and a > 0; id count task operator info Projection_4 2666.67 root Column#1 └─TableReader_7 2666.67 root data:Selection_6 - └─Selection_6 2666.67 cop gt(Column#1, 0) - └─TableScan_5 3333.33 cop table:t, range:(0,+inf], keep order:false, stats:pseudo + └─Selection_6 2666.67 cop[tikv] gt(Column#1, 0) + └─TableScan_5 3333.33 cop[tikv] table:t, range:(0,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int, b int, c int); explain select * from (select * from t order by (select 2)) t order by a, b; id count task operator info Sort_12 10000.00 root Column#9:asc, Column#10:asc └─TableReader_18 10000.00 root data:TableScan_17 - └─TableScan_17 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_17 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from (select * from t order by c) t order by a, b; id count task operator info Sort_6 10000.00 root Column#8:asc, Column#9:asc └─Sort_9 10000.00 root Column#3:asc └─TableReader_12 10000.00 root data:TableScan_11 - └─TableScan_11 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_11 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; set @@session.tidb_opt_insubq_to_join_and_agg=1; explain SELECT 0 AS a FROM dual UNION SELECT 1 AS a FROM dual ORDER BY a; @@ -672,12 +672,12 @@ Projection_8 8320.83 root Column#1, Column#3 └─HashLeftJoin_9 8320.83 root left outer join, inner:UnionScan_14, equal:[eq(Column#1, Column#3)] ├─UnionScan_10 6656.67 root not(and(ge(Column#1, 1), le(Column#1, 2))) │ └─TableReader_13 6656.67 root data:Selection_12 - │ └─Selection_12 6656.67 cop or(lt(Column#1, 1), gt(Column#1, 2)) - │ └─TableScan_11 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─Selection_12 6656.67 cop[tikv] or(lt(Column#1, 1), gt(Column#1, 2)) + │ └─TableScan_11 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo └─UnionScan_14 6656.67 root not(and(ge(Column#3, 1), le(Column#3, 2))), not(isnull(Column#3)) └─TableReader_17 6656.67 root data:Selection_16 - └─Selection_16 6656.67 cop not(isnull(Column#3)), or(lt(Column#3, 1), gt(Column#3, 2)) - └─TableScan_15 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_16 6656.67 cop[tikv] not(isnull(Column#3)), or(lt(Column#3, 1), gt(Column#3, 2)) + └─TableScan_15 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo rollback; drop table if exists t; create table t(a time, b date); @@ -686,13 +686,13 @@ analyze table t; explain select * from t where a = 1; id count task operator info TableReader_7 1.00 root data:Selection_6 -└─Selection_6 1.00 cop eq(Column#1, 00:00:01.000000) - └─TableScan_5 3.00 cop table:t, range:[-inf,+inf], keep order:false +└─Selection_6 1.00 cop[tikv] eq(Column#1, 00:00:01.000000) + └─TableScan_5 3.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false explain select * from t where b = "1000-01-01"; id count task operator info TableReader_7 1.00 root data:Selection_6 -└─Selection_6 1.00 cop eq(Column#2, 1000-01-01 00:00:00.000000) - └─TableScan_5 3.00 cop table:t, range:[-inf,+inf], keep order:false +└─Selection_6 1.00 cop[tikv] eq(Column#2, 1000-01-01 00:00:00.000000) + └─TableScan_5 3.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false drop table t; create table t(a int); insert into t values (1),(2),(2),(2),(9),(9),(9),(10); @@ -700,18 +700,18 @@ analyze table t with 1 buckets; explain select * from t where a >= 3 and a <= 8; id count task operator info TableReader_7 0.00 root data:Selection_6 -└─Selection_6 0.00 cop ge(Column#1, 3), le(Column#1, 8) - └─TableScan_5 8.00 cop table:t, range:[-inf,+inf], keep order:false +└─Selection_6 0.00 cop[tikv] ge(Column#1, 3), le(Column#1, 8) + └─TableScan_5 8.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false drop table t; create table t(a int, b int, index idx_ab(a, b)); explain select a, b from t where a in (1) order by b; id count task operator info IndexReader_12 10.00 root index:IndexScan_11 -└─IndexScan_11 10.00 cop table:t, index:a, b, range:[1,1], keep order:true, stats:pseudo +└─IndexScan_11 10.00 cop[tikv] table:t, index:a, b, range:[1,1], keep order:true, stats:pseudo explain select a, b from t where a = 1 order by b; id count task operator info IndexReader_12 10.00 root index:IndexScan_11 -└─IndexScan_11 10.00 cop table:t, index:a, b, range:[1,1], keep order:true, stats:pseudo +└─IndexScan_11 10.00 cop[tikv] table:t, index:a, b, range:[1,1], keep order:true, stats:pseudo drop table if exists t; create table t(a int, b int); explain select a, b from (select a, b, avg(b) over (partition by a)as avg_b from t) as tt where a > 10 and b < 10 and a > avg_b; @@ -721,8 +721,8 @@ Projection_8 2666.67 root Column#1, Column#2 └─Window_10 3333.33 root avg(cast(Column#2)) over(partition by Column#1) └─Sort_14 3333.33 root Column#1:asc └─TableReader_13 3333.33 root data:Selection_12 - └─Selection_12 3333.33 cop gt(Column#1, 10) - └─TableScan_11 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_12 3333.33 cop[tikv] gt(Column#1, 10) + └─TableScan_11 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int, b int); explain format="dot" select * from t where a < 2; diff --git a/cmd/explaintest/r/explain_easy_stats.result b/cmd/explaintest/r/explain_easy_stats.result index 7f53bb5d92734..5b792f83258e4 100644 --- a/cmd/explaintest/r/explain_easy_stats.result +++ b/cmd/explaintest/r/explain_easy_stats.result @@ -18,41 +18,41 @@ Projection_11 1600.00 root Column#1, Column#2, Column#3, Column#4 └─HashLeftJoin_12 1600.00 root semi join, inner:StreamAgg_27, equal:[eq(Column#19, Column#11)] ├─Projection_13 2000.00 root Column#1, Column#2, Column#3, Column#4, cast(Column#1) │ └─TableReader_15 2000.00 root data:TableScan_14 - │ └─TableScan_14 2000.00 cop table:t3, range:[-inf,+inf], keep order:false + │ └─TableScan_14 2000.00 cop[tikv] table:t3, range:[-inf,+inf], keep order:false └─StreamAgg_27 1.00 root funcs:sum(Column#22) └─TableReader_28 1.00 root data:StreamAgg_19 - └─StreamAgg_19 1.00 cop funcs:sum(Column#6) - └─TableScan_26 2000.00 cop table:s, range:[-inf,+inf], keep order:false + └─StreamAgg_19 1.00 cop[tikv] funcs:sum(Column#6) + └─TableScan_26 2000.00 cop[tikv] table:s, range:[-inf,+inf], keep order:false explain select * from t1; id count task operator info TableReader_5 1999.00 root data:TableScan_4 -└─TableScan_4 1999.00 cop table:t1, range:[-inf,+inf], keep order:false +└─TableScan_4 1999.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false explain select * from t1 order by c2; id count task operator info IndexLookUp_12 1999.00 root -├─IndexScan_10 1999.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:true -└─TableScan_11 1999.00 cop table:t1, keep order:false +├─IndexScan_10 1999.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:true +└─TableScan_11 1999.00 cop[tikv] table:t1, keep order:false explain select * from t2 order by c2; id count task operator info Sort_4 1985.00 root Column#5:asc └─TableReader_8 1985.00 root data:TableScan_7 - └─TableScan_7 1985.00 cop table:t2, range:[-inf,+inf], keep order:false + └─TableScan_7 1985.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false explain select * from t1 where t1.c1 > 0; id count task operator info TableReader_6 1999.00 root data:TableScan_5 -└─TableScan_5 1999.00 cop table:t1, range:(0,+inf], keep order:false +└─TableScan_5 1999.00 cop[tikv] table:t1, range:(0,+inf], keep order:false explain select t1.c1, t1.c2 from t1 where t1.c2 = 1; id count task operator info IndexReader_6 0.00 root index:IndexScan_5 -└─IndexScan_5 0.00 cop table:t1, index:c2, range:[1,1], keep order:false +└─IndexScan_5 0.00 cop[tikv] table:t1, index:c2, range:[1,1], keep order:false explain select * from t1 left join t2 on t1.c2 = t2.c1 where t1.c1 > 1; id count task operator info HashLeftJoin_21 2481.25 root left outer join, inner:TableReader_34, equal:[eq(Column#2, Column#4)] ├─TableReader_31 1998.00 root data:TableScan_30 -│ └─TableScan_30 1998.00 cop table:t1, range:(1,+inf], keep order:false +│ └─TableScan_30 1998.00 cop[tikv] table:t1, range:(1,+inf], keep order:false └─TableReader_34 1985.00 root data:Selection_33 - └─Selection_33 1985.00 cop not(isnull(Column#4)) - └─TableScan_32 1985.00 cop table:t2, range:[-inf,+inf], keep order:false + └─Selection_33 1985.00 cop[tikv] not(isnull(Column#4)) + └─TableScan_32 1985.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false explain update t1 set t1.c2 = 2 where t1.c1 = 1; id count task operator info Update_2 N/A root N/A @@ -61,45 +61,45 @@ explain delete from t1 where t1.c2 = 1; id count task operator info Delete_3 N/A root N/A └─IndexLookUp_9 0.00 root - ├─IndexScan_7 0.00 cop table:t1, index:c2, range:[1,1], keep order:false - └─TableScan_8 0.00 cop table:t1, keep order:false + ├─IndexScan_7 0.00 cop[tikv] table:t1, index:c2, range:[1,1], keep order:false + └─TableScan_8 0.00 cop[tikv] table:t1, keep order:false explain select count(b.c2) from t1 a, t2 b where a.c1 = b.c2 group by a.c1; id count task operator info Projection_11 1985.00 root cast(Column#9) └─HashLeftJoin_21 1985.00 root inner join, inner:HashAgg_25, equal:[eq(Column#1, Column#5)] ├─IndexReader_36 1999.00 root index:IndexScan_35 - │ └─IndexScan_35 1999.00 cop table:a, index:c2, range:[NULL,+inf], keep order:false + │ └─IndexScan_35 1999.00 cop[tikv] table:a, index:c2, range:[NULL,+inf], keep order:false └─HashAgg_25 1985.00 root group by:Column#5, funcs:count(Column#5), firstrow(Column#5) └─TableReader_32 1985.00 root data:Selection_31 - └─Selection_31 1985.00 cop not(isnull(Column#5)) - └─TableScan_30 1985.00 cop table:b, range:[-inf,+inf], keep order:false + └─Selection_31 1985.00 cop[tikv] not(isnull(Column#5)) + └─TableScan_30 1985.00 cop[tikv] table:b, range:[-inf,+inf], keep order:false explain select * from t2 order by t2.c2 limit 0, 1; id count task operator info TopN_7 1.00 root Column#2:asc, offset:0, count:1 └─TableReader_15 1.00 root data:TopN_14 - └─TopN_14 1.00 cop Column#2:asc, offset:0, count:1 - └─TableScan_13 1985.00 cop table:t2, range:[-inf,+inf], keep order:false + └─TopN_14 1.00 cop[tikv] Column#2:asc, offset:0, count:1 + └─TableScan_13 1985.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false explain select * from t1 where c1 > 1 and c2 = 1 and c3 < 1; id count task operator info IndexLookUp_11 0.00 root -├─IndexScan_8 0.00 cop table:t1, index:c2, range:(1 1,1 +inf], keep order:false -└─Selection_10 0.00 cop lt(Column#3, 1) - └─TableScan_9 0.00 cop table:t1, keep order:false +├─IndexScan_8 0.00 cop[tikv] table:t1, index:c2, range:(1 1,1 +inf], keep order:false +└─Selection_10 0.00 cop[tikv] lt(Column#3, 1) + └─TableScan_9 0.00 cop[tikv] table:t1, keep order:false explain select * from t1 where c1 = 1 and c2 > 1; id count task operator info TableReader_7 0.50 root data:Selection_6 -└─Selection_6 0.50 cop gt(Column#2, 1) - └─TableScan_5 1.00 cop table:t1, range:[1,1], keep order:false +└─Selection_6 0.50 cop[tikv] gt(Column#2, 1) + └─TableScan_5 1.00 cop[tikv] table:t1, range:[1,1], keep order:false explain select c1 from t1 where c1 in (select c2 from t2); id count task operator info Projection_9 1985.00 root Column#1 └─HashLeftJoin_19 1985.00 root inner join, inner:HashAgg_23, equal:[eq(Column#1, Column#5)] ├─IndexReader_34 1999.00 root index:IndexScan_33 - │ └─IndexScan_33 1999.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false + │ └─IndexScan_33 1999.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false └─HashAgg_23 1985.00 root group by:Column#5, funcs:firstrow(Column#5) └─TableReader_30 1985.00 root data:Selection_29 - └─Selection_29 1985.00 cop not(isnull(Column#5)) - └─TableScan_28 1985.00 cop table:t2, range:[-inf,+inf], keep order:false + └─Selection_29 1985.00 cop[tikv] not(isnull(Column#5)) + └─TableScan_28 1985.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false explain select * from information_schema.columns; id count task operator info MemTableScan_4 10000.00 root @@ -108,28 +108,28 @@ id count task operator info Projection_12 1999.00 root eq(Column#2, Column#5) └─Apply_14 1999.00 root CARTESIAN left outer join, inner:Projection_43 ├─IndexReader_18 1999.00 root index:IndexScan_17 - │ └─IndexScan_17 1999.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false + │ └─IndexScan_17 1999.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false └─Projection_43 1.00 root Column#4, Column#5 └─IndexLookUp_42 1.00 root limit embedded(offset:0, count:1) - ├─Limit_41 1.00 cop offset:0, count:1 - │ └─IndexScan_39 1.25 cop table:t2, index:c1, range: decided by [eq(Column#1, Column#4)], keep order:true - └─TableScan_40 1.00 cop table:t2, keep order:false, stats:pseudo + ├─Limit_41 1.00 cop[tikv] offset:0, count:1 + │ └─IndexScan_39 1.25 cop[tikv] table:t2, index:c1, range: decided by [eq(Column#1, Column#4)], keep order:true + └─TableScan_40 1.00 cop[tikv] table:t2, keep order:false, stats:pseudo explain select * from t1 order by c1 desc limit 1; id count task operator info Limit_10 1.00 root offset:0, count:1 └─TableReader_20 1.00 root data:Limit_19 - └─Limit_19 1.00 cop offset:0, count:1 - └─TableScan_18 1.00 cop table:t1, range:[-inf,+inf], keep order:true, desc + └─Limit_19 1.00 cop[tikv] offset:0, count:1 + └─TableScan_18 1.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:true, desc set @@session.tidb_opt_insubq_to_join_and_agg=0; explain select 1 in (select c2 from t2) from t1; id count task operator info Projection_6 1999.00 root Column#8 └─HashLeftJoin_7 1999.00 root CARTESIAN left outer semi join, inner:TableReader_14 ├─IndexReader_11 1999.00 root index:IndexScan_10 - │ └─IndexScan_10 1999.00 cop table:t1, index:c2, range:[NULL,+inf], keep order:false + │ └─IndexScan_10 1999.00 cop[tikv] table:t1, index:c2, range:[NULL,+inf], keep order:false └─TableReader_14 0.00 root data:Selection_13 - └─Selection_13 0.00 cop eq(1, Column#5) - └─TableScan_12 1985.00 cop table:t2, range:[-inf,+inf], keep order:false + └─Selection_13 0.00 cop[tikv] eq(1, Column#5) + └─TableScan_12 1985.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false explain format="dot" select 1 in (select c2 from t2) from t1; dot contents @@ -167,15 +167,15 @@ TableDual_5 0.00 root rows:0 explain select * from index_prune WHERE a = 1010010404050976781 AND b = 26467085526790 LIMIT 1, 1; id count task operator info IndexLookUp_14 1.00 root limit embedded(offset:1, count:1) -├─Limit_13 1.00 cop offset:0, count:2 -│ └─IndexScan_11 1.00 cop table:index_prune, index:a, b, range:[1010010404050976781 26467085526790,1010010404050976781 26467085526790], keep order:false -└─TableScan_12 1.00 cop table:index_prune, keep order:false, stats:pseudo +├─Limit_13 1.00 cop[tikv] offset:0, count:2 +│ └─IndexScan_11 1.00 cop[tikv] table:index_prune, index:a, b, range:[1010010404050976781 26467085526790,1010010404050976781 26467085526790], keep order:false +└─TableScan_12 1.00 cop[tikv] table:index_prune, keep order:false, stats:pseudo explain select * from index_prune WHERE a = 1010010404050976781 AND b = 26467085526790 LIMIT 1, 0; id count task operator info IndexLookUp_14 0.00 root limit embedded(offset:1, count:0) -├─Limit_13 1.00 cop offset:0, count:1 -│ └─IndexScan_11 1.00 cop table:index_prune, index:a, b, range:[1010010404050976781 26467085526790,1010010404050976781 26467085526790], keep order:false -└─TableScan_12 0.00 cop table:index_prune, keep order:false, stats:pseudo +├─Limit_13 1.00 cop[tikv] offset:0, count:1 +│ └─IndexScan_11 1.00 cop[tikv] table:index_prune, index:a, b, range:[1010010404050976781 26467085526790,1010010404050976781 26467085526790], keep order:false +└─TableScan_12 0.00 cop[tikv] table:index_prune, keep order:false, stats:pseudo explain select * from index_prune WHERE a = 1010010404050976781 AND b = 26467085526790 LIMIT 0, 1; id count task operator info Point_Get_1 1.00 root table:index_prune, index:a b @@ -196,4 +196,4 @@ load stats 's/explain_easy_stats_tbl_dnf.json'; explain select * from tbl where (column1=0 and column2=1) or (column1=1 and column2=3) or (column1=2 and column2=5); id count task operator info IndexReader_6 3.00 root index:IndexScan_5 -└─IndexScan_5 3.00 cop table:tbl, index:column1, column2, range:[0 1,0 1], [1 3,1 3], [2 5,2 5], keep order:false +└─IndexScan_5 3.00 cop[tikv] table:tbl, index:column1, column2, range:[0 1,0 1], [1 3,1 3], [2 5,2 5], keep order:false diff --git a/cmd/explaintest/r/explain_indexmerge.result b/cmd/explaintest/r/explain_indexmerge.result index 4498ee0ec9e00..e903a02a14961 100644 --- a/cmd/explaintest/r/explain_indexmerge.result +++ b/cmd/explaintest/r/explain_indexmerge.result @@ -8,46 +8,46 @@ set session tidb_enable_index_merge = on; explain select * from t where a < 50 or b < 50; id count task operator info IndexMerge_11 98.00 root -├─TableScan_8 49.00 cop table:t, range:[-inf,50), keep order:false -├─IndexScan_9 49.00 cop table:t, index:b, range:[-inf,50), keep order:false -└─TableScan_10 98.00 cop table:t, keep order:false +├─TableScan_8 49.00 cop[tikv] table:t, range:[-inf,50), keep order:false +├─IndexScan_9 49.00 cop[tikv] table:t, index:b, range:[-inf,50), keep order:false +└─TableScan_10 98.00 cop[tikv] table:t, keep order:false explain select * from t where (a < 50 or b < 50) and f > 100; id count task operator info IndexMerge_12 98.00 root -├─TableScan_8 49.00 cop table:t, range:[-inf,50), keep order:false -├─IndexScan_9 49.00 cop table:t, index:b, range:[-inf,50), keep order:false -└─Selection_11 98.00 cop gt(Column#6, 100) - └─TableScan_10 98.00 cop table:t, keep order:false +├─TableScan_8 49.00 cop[tikv] table:t, range:[-inf,50), keep order:false +├─IndexScan_9 49.00 cop[tikv] table:t, index:b, range:[-inf,50), keep order:false +└─Selection_11 98.00 cop[tikv] gt(Column#6, 100) + └─TableScan_10 98.00 cop[tikv] table:t, keep order:false explain select * from t where a < 50 or b < 5000000; id count task operator info TableReader_7 4000000.00 root data:Selection_6 -└─Selection_6 4000000.00 cop or(lt(Column#1, 50), lt(Column#2, 5000000)) - └─TableScan_5 5000000.00 cop table:t, range:[-inf,+inf], keep order:false +└─Selection_6 4000000.00 cop[tikv] or(lt(Column#1, 50), lt(Column#2, 5000000)) + └─TableScan_5 5000000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false explain select * from t where b < 50 or c < 50; id count task operator info IndexMerge_11 98.00 root -├─IndexScan_8 49.00 cop table:t, index:b, range:[-inf,50), keep order:false -├─IndexScan_9 49.00 cop table:t, index:c, range:[-inf,50), keep order:false -└─TableScan_10 98.00 cop table:t, keep order:false +├─IndexScan_8 49.00 cop[tikv] table:t, index:b, range:[-inf,50), keep order:false +├─IndexScan_9 49.00 cop[tikv] table:t, index:c, range:[-inf,50), keep order:false +└─TableScan_10 98.00 cop[tikv] table:t, keep order:false explain select * from t where b < 50 or c < 5000000; id count task operator info TableReader_7 4000000.00 root data:Selection_6 -└─Selection_6 4000000.00 cop or(lt(Column#2, 50), lt(Column#3, 5000000)) - └─TableScan_5 5000000.00 cop table:t, range:[-inf,+inf], keep order:false +└─Selection_6 4000000.00 cop[tikv] or(lt(Column#2, 50), lt(Column#3, 5000000)) + └─TableScan_5 5000000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false explain select * from t where a < 50 or b < 50 or c < 50; id count task operator info IndexMerge_12 147.00 root -├─TableScan_8 49.00 cop table:t, range:[-inf,50), keep order:false -├─IndexScan_9 49.00 cop table:t, index:b, range:[-inf,50), keep order:false -├─IndexScan_10 49.00 cop table:t, index:c, range:[-inf,50), keep order:false -└─TableScan_11 147.00 cop table:t, keep order:false +├─TableScan_8 49.00 cop[tikv] table:t, range:[-inf,50), keep order:false +├─IndexScan_9 49.00 cop[tikv] table:t, index:b, range:[-inf,50), keep order:false +├─IndexScan_10 49.00 cop[tikv] table:t, index:c, range:[-inf,50), keep order:false +└─TableScan_11 147.00 cop[tikv] table:t, keep order:false explain select * from t where (b < 10000 or c < 10000) and (a < 10 or d < 10) and f < 10; id count task operator info IndexMerge_17 0.00 root -├─TableScan_13 9.00 cop table:t, range:[-inf,10), keep order:false -├─IndexScan_14 9.00 cop table:t, index:d, range:[-inf,10), keep order:false -└─Selection_16 0.00 cop lt(Column#6, 10), or(lt(Column#2, 10000), lt(Column#3, 10000)) - └─TableScan_15 18.00 cop table:t, keep order:false +├─TableScan_13 9.00 cop[tikv] table:t, range:[-inf,10), keep order:false +├─IndexScan_14 9.00 cop[tikv] table:t, index:d, range:[-inf,10), keep order:false +└─Selection_16 0.00 cop[tikv] lt(Column#6, 10), or(lt(Column#2, 10000), lt(Column#3, 10000)) + └─TableScan_15 18.00 cop[tikv] table:t, keep order:false explain format="dot" select * from t where (a < 50 or b < 50) and f > 100; dot contents diff --git a/cmd/explaintest/r/generated_columns.result b/cmd/explaintest/r/generated_columns.result index 6113c78864b75..6ace4e960c916 100644 --- a/cmd/explaintest/r/generated_columns.result +++ b/cmd/explaintest/r/generated_columns.result @@ -10,8 +10,8 @@ EXPLAIN SELECT name, id FROM person WHERE city = 'Beijing'; id count task operator info Projection_4 10.00 root Column#2, Column#1 └─IndexLookUp_10 10.00 root - ├─IndexScan_8 10.00 cop table:person, index:city, range:["Beijing","Beijing"], keep order:false, stats:pseudo - └─TableScan_9 10.00 cop table:person, keep order:false, stats:pseudo + ├─IndexScan_8 10.00 cop[tikv] table:person, index:city, range:["Beijing","Beijing"], keep order:false, stats:pseudo + └─TableScan_9 10.00 cop[tikv] table:person, keep order:false, stats:pseudo DROP TABLE IF EXISTS `sgc`; CREATE TABLE `sgc` ( `j1` JSON DEFAULT NULL, @@ -25,21 +25,21 @@ KEY `idx_a_b` (`a`,`b`) EXPLAIN SELECT a FROM sgc where a < 3; id count task operator info IndexReader_6 3323.33 root index:IndexScan_5 -└─IndexScan_5 3323.33 cop table:sgc, index:a, range:[-inf,3), keep order:false, stats:pseudo +└─IndexScan_5 3323.33 cop[tikv] table:sgc, index:a, range:[-inf,3), keep order:false, stats:pseudo EXPLAIN SELECT a, b FROM sgc where a < 3; id count task operator info IndexReader_6 3323.33 root index:IndexScan_5 -└─IndexScan_5 3323.33 cop table:sgc, index:a, b, range:[-inf,3), keep order:false, stats:pseudo +└─IndexScan_5 3323.33 cop[tikv] table:sgc, index:a, b, range:[-inf,3), keep order:false, stats:pseudo EXPLAIN SELECT a, b from sgc where b < 3; id count task operator info IndexReader_13 3323.33 root index:Selection_12 -└─Selection_12 3323.33 cop lt(Column#4, 3) - └─IndexScan_11 10000.00 cop table:sgc, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_12 3323.33 cop[tikv] lt(Column#4, 3) + └─IndexScan_11 10000.00 cop[tikv] table:sgc, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT a, b from sgc where a < 3 and b < 3; id count task operator info IndexReader_11 1104.45 root index:Selection_10 -└─Selection_10 1104.45 cop lt(Column#4, 3) - └─IndexScan_9 3323.33 cop table:sgc, index:a, b, range:[-inf,3), keep order:false, stats:pseudo +└─Selection_10 1104.45 cop[tikv] lt(Column#4, 3) + └─IndexScan_9 3323.33 cop[tikv] table:sgc, index:a, b, range:[-inf,3), keep order:false, stats:pseudo DROP TABLE IF EXISTS sgc1, sgc2; CREATE TABLE `sgc1` ( @@ -73,22 +73,22 @@ EXPLAIN SELECT /*+ TIDB_INLJ(sgc1, sgc2) */ * from sgc1 join sgc2 on sgc1.a=sgc2 id count task operator info IndexHashJoin_33 5.00 root inner join, inner:IndexLookUp_24, outer key:Column#8, inner key:Column#3 ├─IndexLookUp_24 5.00 root -│ ├─Selection_23 5.00 cop not(isnull(Column#3)) -│ │ └─IndexScan_21 5.00 cop table:sgc1, index:a, range: decided by [eq(Column#3, Column#8)], keep order:false -│ └─TableScan_22 5.00 cop table:sgc1, keep order:false +│ ├─Selection_23 5.00 cop[tikv] not(isnull(Column#3)) +│ │ └─IndexScan_21 5.00 cop[tikv] table:sgc1, index:a, range: decided by [eq(Column#3, Column#8)], keep order:false +│ └─TableScan_22 5.00 cop[tikv] table:sgc1, keep order:false └─TableReader_36 1.00 root data:Selection_35 - └─Selection_35 1.00 cop not(isnull(Column#8)) - └─TableScan_34 1.00 cop table:sgc2, range:[-inf,+inf], keep order:false + └─Selection_35 1.00 cop[tikv] not(isnull(Column#8)) + └─TableScan_34 1.00 cop[tikv] table:sgc2, range:[-inf,+inf], keep order:false EXPLAIN SELECT * from sgc1 join sgc2 on sgc1.a=sgc2.a; id count task operator info Projection_6 5.00 root Column#1, Column#2, Column#3, Column#4, Column#6, Column#7, Column#8, Column#9 └─HashRightJoin_23 5.00 root inner join, inner:TableReader_42, equal:[eq(Column#8, Column#3)] ├─TableReader_42 1.00 root data:Selection_41 - │ └─Selection_41 1.00 cop not(isnull(Column#8)) - │ └─TableScan_40 1.00 cop table:sgc2, range:[-inf,+inf], keep order:false + │ └─Selection_41 1.00 cop[tikv] not(isnull(Column#8)) + │ └─TableScan_40 1.00 cop[tikv] table:sgc2, range:[-inf,+inf], keep order:false └─TableReader_51 5.00 root data:Selection_50 - └─Selection_50 5.00 cop not(isnull(Column#3)) - └─TableScan_49 5.00 cop table:sgc1, range:[-inf,+inf], keep order:false + └─Selection_50 5.00 cop[tikv] not(isnull(Column#3)) + └─TableScan_49 5.00 cop[tikv] table:sgc1, range:[-inf,+inf], keep order:false DROP TABLE IF EXISTS sgc3; CREATE TABLE sgc3 ( j JSON, @@ -106,32 +106,32 @@ EXPLAIN SELECT * FROM sgc3 WHERE a <= 1; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#2, 1) -│ └─TableScan_9 10000.00 cop table:sgc3, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#2, 1) +│ └─TableScan_9 10000.00 cop[tikv] table:sgc3, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#2, 1) - └─TableScan_12 10000.00 cop table:sgc3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#2, 1) + └─TableScan_12 10000.00 cop[tikv] table:sgc3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM sgc3 WHERE a < 7; id count task operator info Union_13 23263.33 root ├─TableReader_16 3323.33 root data:Selection_15 -│ └─Selection_15 3323.33 cop lt(Column#2, 7) -│ └─TableScan_14 10000.00 cop table:sgc3, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3323.33 cop[tikv] lt(Column#2, 7) +│ └─TableScan_14 10000.00 cop[tikv] table:sgc3, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3323.33 root data:Selection_18 -│ └─Selection_18 3323.33 cop lt(Column#2, 7) -│ └─TableScan_17 10000.00 cop table:sgc3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3323.33 cop[tikv] lt(Column#2, 7) +│ └─TableScan_17 10000.00 cop[tikv] table:sgc3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_22 3323.33 root data:Selection_21 -│ └─Selection_21 3323.33 cop lt(Column#2, 7) -│ └─TableScan_20 10000.00 cop table:sgc3, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3323.33 cop[tikv] lt(Column#2, 7) +│ └─TableScan_20 10000.00 cop[tikv] table:sgc3, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_25 3323.33 root data:Selection_24 -│ └─Selection_24 3323.33 cop lt(Column#2, 7) -│ └─TableScan_23 10000.00 cop table:sgc3, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_24 3323.33 cop[tikv] lt(Column#2, 7) +│ └─TableScan_23 10000.00 cop[tikv] table:sgc3, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_28 3323.33 root data:Selection_27 -│ └─Selection_27 3323.33 cop lt(Column#2, 7) -│ └─TableScan_26 10000.00 cop table:sgc3, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3323.33 cop[tikv] lt(Column#2, 7) +│ └─TableScan_26 10000.00 cop[tikv] table:sgc3, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_31 3323.33 root data:Selection_30 -│ └─Selection_30 3323.33 cop lt(Column#2, 7) -│ └─TableScan_29 10000.00 cop table:sgc3, partition:p5, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_30 3323.33 cop[tikv] lt(Column#2, 7) +│ └─TableScan_29 10000.00 cop[tikv] table:sgc3, partition:p5, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_34 3323.33 root data:Selection_33 - └─Selection_33 3323.33 cop lt(Column#2, 7) - └─TableScan_32 10000.00 cop table:sgc3, partition:max, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_33 3323.33 cop[tikv] lt(Column#2, 7) + └─TableScan_32 10000.00 cop[tikv] table:sgc3, partition:max, range:[-inf,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/index_join.result b/cmd/explaintest/r/index_join.result index def2ecba1ae1f..3a00035c43aff 100644 --- a/cmd/explaintest/r/index_join.result +++ b/cmd/explaintest/r/index_join.result @@ -10,22 +10,22 @@ explain select /*+ TIDB_INLJ(t1, t2) */ * from t1 join t2 on t1.a=t2.a; id count task operator info IndexHashJoin_32 5.00 root inner join, inner:IndexLookUp_23, outer key:Column#4, inner key:Column#1 ├─IndexLookUp_23 5.00 root -│ ├─Selection_22 5.00 cop not(isnull(Column#1)) -│ │ └─IndexScan_20 5.00 cop table:t1, index:a, range: decided by [eq(Column#1, Column#4)], keep order:false -│ └─TableScan_21 5.00 cop table:t1, keep order:false +│ ├─Selection_22 5.00 cop[tikv] not(isnull(Column#1)) +│ │ └─IndexScan_20 5.00 cop[tikv] table:t1, index:a, range: decided by [eq(Column#1, Column#4)], keep order:false +│ └─TableScan_21 5.00 cop[tikv] table:t1, keep order:false └─TableReader_35 1.00 root data:Selection_34 - └─Selection_34 1.00 cop not(isnull(Column#4)) - └─TableScan_33 1.00 cop table:t2, range:[-inf,+inf], keep order:false + └─Selection_34 1.00 cop[tikv] not(isnull(Column#4)) + └─TableScan_33 1.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false explain select * from t1 join t2 on t1.a=t2.a; id count task operator info Projection_6 5.00 root Column#1, Column#2, Column#4, Column#5 └─HashRightJoin_22 5.00 root inner join, inner:TableReader_33, equal:[eq(Column#4, Column#1)] ├─TableReader_33 1.00 root data:Selection_32 - │ └─Selection_32 1.00 cop not(isnull(Column#4)) - │ └─TableScan_31 1.00 cop table:t2, range:[-inf,+inf], keep order:false + │ └─Selection_32 1.00 cop[tikv] not(isnull(Column#4)) + │ └─TableScan_31 1.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false └─TableReader_39 5.00 root data:Selection_38 - └─Selection_38 5.00 cop not(isnull(Column#1)) - └─TableScan_37 5.00 cop table:t1, range:[-inf,+inf], keep order:false + └─Selection_38 5.00 cop[tikv] not(isnull(Column#1)) + └─TableScan_37 5.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false drop table if exists t1, t2; create table t1(a int not null, b int not null); create table t2(a int not null, b int not null, key a(a)); @@ -34,9 +34,9 @@ explain select /*+ TIDB_INLJ(t2@sel_2) */ * from t1 where t1.a in (select t2.a f id count task operator info IndexMergeJoin_14 8000.00 root semi join, inner:IndexReader_12, outer key:Column#1, inner key:Column#4 ├─TableReader_18 10000.00 root data:TableScan_17 -│ └─TableScan_17 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_17 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─IndexReader_12 1.25 root index:IndexScan_11 - └─IndexScan_11 1.25 cop table:t2, index:a, range: decided by [eq(Column#4, Column#1)], keep order:true, stats:pseudo + └─IndexScan_11 1.25 cop[tikv] table:t2, index:a, range: decided by [eq(Column#4, Column#1)], keep order:true, stats:pseudo show warnings; Level Code Message set @@tidb_opt_insubq_to_join_and_agg=1; @@ -48,8 +48,8 @@ id count task operator info Projection_8 10000.00 root Column#1, Column#2 └─IndexMergeJoin_17 10000.00 root inner join, inner:IndexLookUp_15, outer key:Column#4, inner key:Column#1 ├─IndexLookUp_15 1.25 root - │ ├─IndexScan_13 1.25 cop table:t1, index:a, range: decided by [eq(Column#1, Column#4)], keep order:true, stats:pseudo - │ └─TableScan_14 1.25 cop table:t1, keep order:false, stats:pseudo + │ ├─IndexScan_13 1.25 cop[tikv] table:t1, index:a, range: decided by [eq(Column#1, Column#4)], keep order:true, stats:pseudo + │ └─TableScan_14 1.25 cop[tikv] table:t1, keep order:false, stats:pseudo └─StreamAgg_24 8000.00 root group by:Column#4, funcs:firstrow(Column#4) └─IndexReader_37 10000.00 root index:IndexScan_36 - └─IndexScan_36 10000.00 cop table:t2, index:a, range:[NULL,+inf], keep order:true, stats:pseudo + └─IndexScan_36 10000.00 cop[tikv] table:t2, index:a, range:[NULL,+inf], keep order:true, stats:pseudo diff --git a/cmd/explaintest/r/partition_pruning.result b/cmd/explaintest/r/partition_pruning.result index 74bf385b81bd8..5b0c32032bf85 100644 --- a/cmd/explaintest/r/partition_pruning.result +++ b/cmd/explaintest/r/partition_pruning.result @@ -18,33 +18,33 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 1; id count task operator info Union_8 2.00 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE a < 7; id count task operator info Union_13 49.00 root ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p0, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p1, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p2, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_21 3333.33 root data:TableScan_20 -│ └─TableScan_20 3333.33 cop table:t1, partition:p3, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:TableScan_22 -│ └─TableScan_22 3333.33 cop table:t1, partition:p4, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_22 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_25 3333.33 root data:TableScan_24 -│ └─TableScan_24 3333.33 cop table:t1, partition:p5, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_24 3333.33 cop[tikv] table:t1, partition:p5, range:[-inf,7), keep order:false, stats:pseudo └─TableReader_27 3333.33 root data:TableScan_26 - └─TableScan_26 3333.33 cop table:t1, partition:max, range:[-inf,7), keep order:false, stats:pseudo + └─TableScan_26 3333.33 cop[tikv] table:t1, partition:max, range:[-inf,7), keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE a <= 1; id count task operator info Union_8 2.00 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo DROP TABLE t1; # # Bug#49742: Partition Pruning not working correctly for RANGE @@ -66,7 +66,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a < 1; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:p0, range:[-inf,1), keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,1), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 2 order by a; a -1 @@ -76,9 +76,9 @@ EXPLAIN SELECT * FROM t1 WHERE a < 2; id count task operator info Union_8 4.00 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p0, range:[-inf,2), keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,2), keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:p1, range:[-inf,2), keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,2), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 3 order by a; a -1 @@ -89,11 +89,11 @@ EXPLAIN SELECT * FROM t1 WHERE a < 3; id count task operator info Union_9 9.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p0, range:[-inf,3), keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,3), keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p1, range:[-inf,3), keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,3), keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:p2, range:[-inf,3), keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,3), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 4 order by a; a -1 @@ -105,13 +105,13 @@ EXPLAIN SELECT * FROM t1 WHERE a < 4; id count task operator info Union_10 16.00 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p0, range:[-inf,4), keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,4), keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p1, range:[-inf,4), keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,4), keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p2, range:[-inf,4), keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,4), keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:p3, range:[-inf,4), keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,4), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 5 order by a; a -1 @@ -124,15 +124,15 @@ EXPLAIN SELECT * FROM t1 WHERE a < 5; id count task operator info Union_11 25.00 root ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p0, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,5), keep order:false, stats:pseudo ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p1, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,5), keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p2, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,5), keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p3, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,5), keep order:false, stats:pseudo └─TableReader_21 3333.33 root data:TableScan_20 - └─TableScan_20 3333.33 cop table:t1, partition:p4, range:[-inf,5), keep order:false, stats:pseudo + └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,5), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 6 order by a; a -1 @@ -146,17 +146,17 @@ EXPLAIN SELECT * FROM t1 WHERE a < 6; id count task operator info Union_12 36.00 root ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p0, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p1, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_18 3333.33 root data:TableScan_17 -│ └─TableScan_17 3333.33 cop table:t1, partition:p2, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:TableScan_19 -│ └─TableScan_19 3333.33 cop table:t1, partition:p3, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_19 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_22 3333.33 root data:TableScan_21 -│ └─TableScan_21 3333.33 cop table:t1, partition:p4, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_21 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,6), keep order:false, stats:pseudo └─TableReader_24 3333.33 root data:TableScan_23 - └─TableScan_23 3333.33 cop table:t1, partition:p5, range:[-inf,6), keep order:false, stats:pseudo + └─TableScan_23 3333.33 cop[tikv] table:t1, partition:p5, range:[-inf,6), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 7 order by a; a -1 @@ -171,19 +171,19 @@ EXPLAIN SELECT * FROM t1 WHERE a < 7; id count task operator info Union_13 49.00 root ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p0, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p1, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p2, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_21 3333.33 root data:TableScan_20 -│ └─TableScan_20 3333.33 cop table:t1, partition:p3, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:TableScan_22 -│ └─TableScan_22 3333.33 cop table:t1, partition:p4, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_22 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,7), keep order:false, stats:pseudo ├─TableReader_25 3333.33 root data:TableScan_24 -│ └─TableScan_24 3333.33 cop table:t1, partition:p5, range:[-inf,7), keep order:false, stats:pseudo +│ └─TableScan_24 3333.33 cop[tikv] table:t1, partition:p5, range:[-inf,7), keep order:false, stats:pseudo └─TableReader_27 3333.33 root data:TableScan_26 - └─TableScan_26 3333.33 cop table:t1, partition:max, range:[-inf,7), keep order:false, stats:pseudo + └─TableScan_26 3333.33 cop[tikv] table:t1, partition:max, range:[-inf,7), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 1 order by a; a -1 @@ -193,9 +193,9 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 1; id count task operator info Union_8 2.00 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 2 order by a; a -1 @@ -206,11 +206,11 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 2; id count task operator info Union_9 6.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p0, range:[-inf,2], keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,2], keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p1, range:[-inf,2], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,2], keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:p2, range:[-inf,2], keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,2], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 3 order by a; a -1 @@ -222,13 +222,13 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 3; id count task operator info Union_10 12.00 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p0, range:[-inf,3], keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,3], keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p1, range:[-inf,3], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,3], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p2, range:[-inf,3], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,3], keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:p3, range:[-inf,3], keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,3], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 4 order by a; a -1 @@ -241,15 +241,15 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 4; id count task operator info Union_11 20.00 root ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p0, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,4], keep order:false, stats:pseudo ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p1, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,4], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p2, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,4], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p3, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,4], keep order:false, stats:pseudo └─TableReader_21 3333.33 root data:TableScan_20 - └─TableScan_20 3333.33 cop table:t1, partition:p4, range:[-inf,4], keep order:false, stats:pseudo + └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,4], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 5 order by a; a -1 @@ -263,17 +263,17 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 5; id count task operator info Union_12 30.00 root ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p0, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p1, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_18 3333.33 root data:TableScan_17 -│ └─TableScan_17 3333.33 cop table:t1, partition:p2, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:TableScan_19 -│ └─TableScan_19 3333.33 cop table:t1, partition:p3, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_19 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_22 3333.33 root data:TableScan_21 -│ └─TableScan_21 3333.33 cop table:t1, partition:p4, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_21 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,5], keep order:false, stats:pseudo └─TableReader_24 3333.33 root data:TableScan_23 - └─TableScan_23 3333.33 cop table:t1, partition:p5, range:[-inf,5], keep order:false, stats:pseudo + └─TableScan_23 3333.33 cop[tikv] table:t1, partition:p5, range:[-inf,5], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 6 order by a; a -1 @@ -288,19 +288,19 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 6; id count task operator info Union_13 42.00 root ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p0, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p1, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p2, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_21 3333.33 root data:TableScan_20 -│ └─TableScan_20 3333.33 cop table:t1, partition:p3, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:TableScan_22 -│ └─TableScan_22 3333.33 cop table:t1, partition:p4, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_22 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_25 3333.33 root data:TableScan_24 -│ └─TableScan_24 3333.33 cop table:t1, partition:p5, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_24 3333.33 cop[tikv] table:t1, partition:p5, range:[-inf,6], keep order:false, stats:pseudo └─TableReader_27 3333.33 root data:TableScan_26 - └─TableScan_26 3333.33 cop table:t1, partition:max, range:[-inf,6], keep order:false, stats:pseudo + └─TableScan_26 3333.33 cop[tikv] table:t1, partition:max, range:[-inf,6], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 7 order by a; a -1 @@ -316,68 +316,68 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 7; id count task operator info Union_13 49.00 root ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p0, range:[-inf,7], keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,7], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p1, range:[-inf,7], keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,7], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p2, range:[-inf,7], keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,7], keep order:false, stats:pseudo ├─TableReader_21 3333.33 root data:TableScan_20 -│ └─TableScan_20 3333.33 cop table:t1, partition:p3, range:[-inf,7], keep order:false, stats:pseudo +│ └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,7], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:TableScan_22 -│ └─TableScan_22 3333.33 cop table:t1, partition:p4, range:[-inf,7], keep order:false, stats:pseudo +│ └─TableScan_22 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,7], keep order:false, stats:pseudo ├─TableReader_25 3333.33 root data:TableScan_24 -│ └─TableScan_24 3333.33 cop table:t1, partition:p5, range:[-inf,7], keep order:false, stats:pseudo +│ └─TableScan_24 3333.33 cop[tikv] table:t1, partition:p5, range:[-inf,7], keep order:false, stats:pseudo └─TableReader_27 3333.33 root data:TableScan_26 - └─TableScan_26 3333.33 cop table:t1, partition:max, range:[-inf,7], keep order:false, stats:pseudo + └─TableScan_26 3333.33 cop[tikv] table:t1, partition:max, range:[-inf,7], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 1 order by a; a 1 EXPLAIN SELECT * FROM t1 WHERE a = 1; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p1, range:[1,1], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p1, range:[1,1], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 2 order by a; a 2 EXPLAIN SELECT * FROM t1 WHERE a = 2; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p2, range:[2,2], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p2, range:[2,2], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 3 order by a; a 3 EXPLAIN SELECT * FROM t1 WHERE a = 3; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p3, range:[3,3], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p3, range:[3,3], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 4 order by a; a 4 EXPLAIN SELECT * FROM t1 WHERE a = 4; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p4, range:[4,4], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p4, range:[4,4], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 5 order by a; a 5 EXPLAIN SELECT * FROM t1 WHERE a = 5; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p5, range:[5,5], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p5, range:[5,5], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 6 order by a; a 6 EXPLAIN SELECT * FROM t1 WHERE a = 6; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:max, range:[6,6], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:max, range:[6,6], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 7 order by a; a 7 EXPLAIN SELECT * FROM t1 WHERE a = 7; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:max, range:[7,7], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:max, range:[7,7], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 1 order by a; a 1 @@ -392,17 +392,17 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 1; id count task operator info Union_12 20000.00 root ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p1, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p1, range:[1,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p2, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p2, range:[1,+inf], keep order:false, stats:pseudo ├─TableReader_18 3333.33 root data:TableScan_17 -│ └─TableScan_17 3333.33 cop table:t1, partition:p3, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p3, range:[1,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:TableScan_19 -│ └─TableScan_19 3333.33 cop table:t1, partition:p4, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_19 3333.33 cop[tikv] table:t1, partition:p4, range:[1,+inf], keep order:false, stats:pseudo ├─TableReader_22 3333.33 root data:TableScan_21 -│ └─TableScan_21 3333.33 cop table:t1, partition:p5, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_21 3333.33 cop[tikv] table:t1, partition:p5, range:[1,+inf], keep order:false, stats:pseudo └─TableReader_24 3333.33 root data:TableScan_23 - └─TableScan_23 3333.33 cop table:t1, partition:max, range:[1,+inf], keep order:false, stats:pseudo + └─TableScan_23 3333.33 cop[tikv] table:t1, partition:max, range:[1,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 2 order by a; a 2 @@ -416,15 +416,15 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 2; id count task operator info Union_11 16666.67 root ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p2, range:[2,+inf], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p2, range:[2,+inf], keep order:false, stats:pseudo ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p3, range:[2,+inf], keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p3, range:[2,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p4, range:[2,+inf], keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p4, range:[2,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p5, range:[2,+inf], keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p5, range:[2,+inf], keep order:false, stats:pseudo └─TableReader_21 3333.33 root data:TableScan_20 - └─TableScan_20 3333.33 cop table:t1, partition:max, range:[2,+inf], keep order:false, stats:pseudo + └─TableScan_20 3333.33 cop[tikv] table:t1, partition:max, range:[2,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 3 order by a; a 3 @@ -437,13 +437,13 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 3; id count task operator info Union_10 13333.33 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p3, range:[3,+inf], keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p3, range:[3,+inf], keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p4, range:[3,+inf], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p4, range:[3,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p5, range:[3,+inf], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p5, range:[3,+inf], keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:max, range:[3,+inf], keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:max, range:[3,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 4 order by a; a 4 @@ -455,11 +455,11 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 4; id count task operator info Union_9 10000.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p4, range:[4,+inf], keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p4, range:[4,+inf], keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p5, range:[4,+inf], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p5, range:[4,+inf], keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:max, range:[4,+inf], keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:max, range:[4,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 5 order by a; a 5 @@ -470,9 +470,9 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 5; id count task operator info Union_8 6666.67 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p5, range:[5,+inf], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p5, range:[5,+inf], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:max, range:[5,+inf], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:max, range:[5,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 6 order by a; a 6 @@ -481,7 +481,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a >= 6; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:[6,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:[6,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 7 order by a; a 7 @@ -489,7 +489,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a >= 7; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:[7,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:[7,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 1 order by a; a 2 @@ -503,15 +503,15 @@ EXPLAIN SELECT * FROM t1 WHERE a > 1; id count task operator info Union_11 16666.67 root ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p2, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p2, range:(1,+inf], keep order:false, stats:pseudo ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p3, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p3, range:(1,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p4, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p4, range:(1,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p5, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p5, range:(1,+inf], keep order:false, stats:pseudo └─TableReader_21 3333.33 root data:TableScan_20 - └─TableScan_20 3333.33 cop table:t1, partition:max, range:(1,+inf], keep order:false, stats:pseudo + └─TableScan_20 3333.33 cop[tikv] table:t1, partition:max, range:(1,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 2 order by a; a 3 @@ -524,13 +524,13 @@ EXPLAIN SELECT * FROM t1 WHERE a > 2; id count task operator info Union_10 13333.33 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p3, range:(2,+inf], keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p3, range:(2,+inf], keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p4, range:(2,+inf], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p4, range:(2,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p5, range:(2,+inf], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p5, range:(2,+inf], keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:max, range:(2,+inf], keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:max, range:(2,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 3 order by a; a 4 @@ -542,11 +542,11 @@ EXPLAIN SELECT * FROM t1 WHERE a > 3; id count task operator info Union_9 10000.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p4, range:(3,+inf], keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p4, range:(3,+inf], keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p5, range:(3,+inf], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p5, range:(3,+inf], keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:max, range:(3,+inf], keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:max, range:(3,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 4 order by a; a 5 @@ -557,9 +557,9 @@ EXPLAIN SELECT * FROM t1 WHERE a > 4; id count task operator info Union_8 6666.67 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p5, range:(4,+inf], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p5, range:(4,+inf], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:max, range:(4,+inf], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:max, range:(4,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 5 order by a; a 6 @@ -568,7 +568,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a > 5; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:(5,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:(5,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 6 order by a; a 7 @@ -576,14 +576,14 @@ a EXPLAIN SELECT * FROM t1 WHERE a > 6; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:(6,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:(6,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 7 order by a; a 8 EXPLAIN SELECT * FROM t1 WHERE a > 7; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:(7,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:(7,+inf], keep order:false, stats:pseudo DROP TABLE t1; CREATE TABLE t1 (a INT PRIMARY KEY) PARTITION BY RANGE (a) ( @@ -601,7 +601,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a < 1; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:p0, range:[-inf,1), keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,1), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 2 order by a; a -1 @@ -611,9 +611,9 @@ EXPLAIN SELECT * FROM t1 WHERE a < 2; id count task operator info Union_8 4.00 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p0, range:[-inf,2), keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,2), keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:p1, range:[-inf,2), keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,2), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 3 order by a; a -1 @@ -624,11 +624,11 @@ EXPLAIN SELECT * FROM t1 WHERE a < 3; id count task operator info Union_9 9.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p0, range:[-inf,3), keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,3), keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p1, range:[-inf,3), keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,3), keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:p2, range:[-inf,3), keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,3), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 4 order by a; a -1 @@ -640,13 +640,13 @@ EXPLAIN SELECT * FROM t1 WHERE a < 4; id count task operator info Union_10 16.00 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p0, range:[-inf,4), keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,4), keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p1, range:[-inf,4), keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,4), keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p2, range:[-inf,4), keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,4), keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:p3, range:[-inf,4), keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,4), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 5 order by a; a -1 @@ -659,15 +659,15 @@ EXPLAIN SELECT * FROM t1 WHERE a < 5; id count task operator info Union_11 25.00 root ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p0, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,5), keep order:false, stats:pseudo ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p1, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,5), keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p2, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,5), keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p3, range:[-inf,5), keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,5), keep order:false, stats:pseudo └─TableReader_21 3333.33 root data:TableScan_20 - └─TableScan_20 3333.33 cop table:t1, partition:p4, range:[-inf,5), keep order:false, stats:pseudo + └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,5), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a < 6 order by a; a -1 @@ -681,17 +681,17 @@ EXPLAIN SELECT * FROM t1 WHERE a < 6; id count task operator info Union_12 36.00 root ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p0, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p1, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_18 3333.33 root data:TableScan_17 -│ └─TableScan_17 3333.33 cop table:t1, partition:p2, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:TableScan_19 -│ └─TableScan_19 3333.33 cop table:t1, partition:p3, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_19 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,6), keep order:false, stats:pseudo ├─TableReader_22 3333.33 root data:TableScan_21 -│ └─TableScan_21 3333.33 cop table:t1, partition:p4, range:[-inf,6), keep order:false, stats:pseudo +│ └─TableScan_21 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,6), keep order:false, stats:pseudo └─TableReader_24 3333.33 root data:TableScan_23 - └─TableScan_23 3333.33 cop table:t1, partition:max, range:[-inf,6), keep order:false, stats:pseudo + └─TableScan_23 3333.33 cop[tikv] table:t1, partition:max, range:[-inf,6), keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 1 order by a; a -1 @@ -701,9 +701,9 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 1; id count task operator info Union_8 2.00 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,1], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,1], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 2 order by a; a -1 @@ -714,11 +714,11 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 2; id count task operator info Union_9 6.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p0, range:[-inf,2], keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,2], keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p1, range:[-inf,2], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,2], keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:p2, range:[-inf,2], keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,2], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 3 order by a; a -1 @@ -730,13 +730,13 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 3; id count task operator info Union_10 12.00 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p0, range:[-inf,3], keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,3], keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p1, range:[-inf,3], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,3], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p2, range:[-inf,3], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,3], keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:p3, range:[-inf,3], keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,3], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 4 order by a; a -1 @@ -749,15 +749,15 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 4; id count task operator info Union_11 20.00 root ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p0, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,4], keep order:false, stats:pseudo ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p1, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,4], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p2, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,4], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p3, range:[-inf,4], keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,4], keep order:false, stats:pseudo └─TableReader_21 3333.33 root data:TableScan_20 - └─TableScan_20 3333.33 cop table:t1, partition:p4, range:[-inf,4], keep order:false, stats:pseudo + └─TableScan_20 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,4], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 5 order by a; a -1 @@ -771,17 +771,17 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 5; id count task operator info Union_12 30.00 root ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p0, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p1, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_18 3333.33 root data:TableScan_17 -│ └─TableScan_17 3333.33 cop table:t1, partition:p2, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:TableScan_19 -│ └─TableScan_19 3333.33 cop table:t1, partition:p3, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_19 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,5], keep order:false, stats:pseudo ├─TableReader_22 3333.33 root data:TableScan_21 -│ └─TableScan_21 3333.33 cop table:t1, partition:p4, range:[-inf,5], keep order:false, stats:pseudo +│ └─TableScan_21 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,5], keep order:false, stats:pseudo └─TableReader_24 3333.33 root data:TableScan_23 - └─TableScan_23 3333.33 cop table:t1, partition:max, range:[-inf,5], keep order:false, stats:pseudo + └─TableScan_23 3333.33 cop[tikv] table:t1, partition:max, range:[-inf,5], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a <= 6 order by a; a -1 @@ -796,59 +796,59 @@ EXPLAIN SELECT * FROM t1 WHERE a <= 6; id count task operator info Union_12 36.00 root ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p0, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p0, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p1, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p1, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_18 3333.33 root data:TableScan_17 -│ └─TableScan_17 3333.33 cop table:t1, partition:p2, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_17 3333.33 cop[tikv] table:t1, partition:p2, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:TableScan_19 -│ └─TableScan_19 3333.33 cop table:t1, partition:p3, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_19 3333.33 cop[tikv] table:t1, partition:p3, range:[-inf,6], keep order:false, stats:pseudo ├─TableReader_22 3333.33 root data:TableScan_21 -│ └─TableScan_21 3333.33 cop table:t1, partition:p4, range:[-inf,6], keep order:false, stats:pseudo +│ └─TableScan_21 3333.33 cop[tikv] table:t1, partition:p4, range:[-inf,6], keep order:false, stats:pseudo └─TableReader_24 3333.33 root data:TableScan_23 - └─TableScan_23 3333.33 cop table:t1, partition:max, range:[-inf,6], keep order:false, stats:pseudo + └─TableScan_23 3333.33 cop[tikv] table:t1, partition:max, range:[-inf,6], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 1; a 1 EXPLAIN SELECT * FROM t1 WHERE a = 1; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p1, range:[1,1], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p1, range:[1,1], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 2; a 2 EXPLAIN SELECT * FROM t1 WHERE a = 2; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p2, range:[2,2], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p2, range:[2,2], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 3; a 3 EXPLAIN SELECT * FROM t1 WHERE a = 3; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p3, range:[3,3], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p3, range:[3,3], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 4; a 4 EXPLAIN SELECT * FROM t1 WHERE a = 4; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:p4, range:[4,4], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:p4, range:[4,4], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 5; a 5 EXPLAIN SELECT * FROM t1 WHERE a = 5; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:max, range:[5,5], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:max, range:[5,5], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a = 6; a 6 EXPLAIN SELECT * FROM t1 WHERE a = 6; id count task operator info TableReader_7 1.00 root data:TableScan_6 -└─TableScan_6 1.00 cop table:t1, partition:max, range:[6,6], keep order:false, stats:pseudo +└─TableScan_6 1.00 cop[tikv] table:t1, partition:max, range:[6,6], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 1 order by a; a 1 @@ -862,15 +862,15 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 1; id count task operator info Union_11 16666.67 root ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p1, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p1, range:[1,+inf], keep order:false, stats:pseudo ├─TableReader_15 3333.33 root data:TableScan_14 -│ └─TableScan_14 3333.33 cop table:t1, partition:p2, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_14 3333.33 cop[tikv] table:t1, partition:p2, range:[1,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:TableScan_16 -│ └─TableScan_16 3333.33 cop table:t1, partition:p3, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_16 3333.33 cop[tikv] table:t1, partition:p3, range:[1,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:TableScan_18 -│ └─TableScan_18 3333.33 cop table:t1, partition:p4, range:[1,+inf], keep order:false, stats:pseudo +│ └─TableScan_18 3333.33 cop[tikv] table:t1, partition:p4, range:[1,+inf], keep order:false, stats:pseudo └─TableReader_21 3333.33 root data:TableScan_20 - └─TableScan_20 3333.33 cop table:t1, partition:max, range:[1,+inf], keep order:false, stats:pseudo + └─TableScan_20 3333.33 cop[tikv] table:t1, partition:max, range:[1,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 2 order by a; a 2 @@ -883,13 +883,13 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 2; id count task operator info Union_10 13333.33 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p2, range:[2,+inf], keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p2, range:[2,+inf], keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p3, range:[2,+inf], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p3, range:[2,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p4, range:[2,+inf], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p4, range:[2,+inf], keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:max, range:[2,+inf], keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:max, range:[2,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 3 order by a; a 3 @@ -901,11 +901,11 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 3; id count task operator info Union_9 10000.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p3, range:[3,+inf], keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p3, range:[3,+inf], keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p4, range:[3,+inf], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p4, range:[3,+inf], keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:max, range:[3,+inf], keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:max, range:[3,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 4 order by a; a 4 @@ -916,9 +916,9 @@ EXPLAIN SELECT * FROM t1 WHERE a >= 4; id count task operator info Union_8 6666.67 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p4, range:[4,+inf], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p4, range:[4,+inf], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:max, range:[4,+inf], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:max, range:[4,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 5 order by a; a 5 @@ -927,7 +927,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a >= 5; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:[5,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:[5,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a >= 6 order by a; a 6 @@ -935,7 +935,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a >= 6; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:[6,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:[6,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 1 order by a; a 2 @@ -948,13 +948,13 @@ EXPLAIN SELECT * FROM t1 WHERE a > 1; id count task operator info Union_10 13333.33 root ├─TableReader_12 3333.33 root data:TableScan_11 -│ └─TableScan_11 3333.33 cop table:t1, partition:p2, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_11 3333.33 cop[tikv] table:t1, partition:p2, range:(1,+inf], keep order:false, stats:pseudo ├─TableReader_14 3333.33 root data:TableScan_13 -│ └─TableScan_13 3333.33 cop table:t1, partition:p3, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_13 3333.33 cop[tikv] table:t1, partition:p3, range:(1,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:TableScan_15 -│ └─TableScan_15 3333.33 cop table:t1, partition:p4, range:(1,+inf], keep order:false, stats:pseudo +│ └─TableScan_15 3333.33 cop[tikv] table:t1, partition:p4, range:(1,+inf], keep order:false, stats:pseudo └─TableReader_18 3333.33 root data:TableScan_17 - └─TableScan_17 3333.33 cop table:t1, partition:max, range:(1,+inf], keep order:false, stats:pseudo + └─TableScan_17 3333.33 cop[tikv] table:t1, partition:max, range:(1,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 2 order by a; a 3 @@ -966,11 +966,11 @@ EXPLAIN SELECT * FROM t1 WHERE a > 2; id count task operator info Union_9 10000.00 root ├─TableReader_11 3333.33 root data:TableScan_10 -│ └─TableScan_10 3333.33 cop table:t1, partition:p3, range:(2,+inf], keep order:false, stats:pseudo +│ └─TableScan_10 3333.33 cop[tikv] table:t1, partition:p3, range:(2,+inf], keep order:false, stats:pseudo ├─TableReader_13 3333.33 root data:TableScan_12 -│ └─TableScan_12 3333.33 cop table:t1, partition:p4, range:(2,+inf], keep order:false, stats:pseudo +│ └─TableScan_12 3333.33 cop[tikv] table:t1, partition:p4, range:(2,+inf], keep order:false, stats:pseudo └─TableReader_15 3333.33 root data:TableScan_14 - └─TableScan_14 3333.33 cop table:t1, partition:max, range:(2,+inf], keep order:false, stats:pseudo + └─TableScan_14 3333.33 cop[tikv] table:t1, partition:max, range:(2,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 3 order by a; a 4 @@ -981,9 +981,9 @@ EXPLAIN SELECT * FROM t1 WHERE a > 3; id count task operator info Union_8 6666.67 root ├─TableReader_10 3333.33 root data:TableScan_9 -│ └─TableScan_9 3333.33 cop table:t1, partition:p4, range:(3,+inf], keep order:false, stats:pseudo +│ └─TableScan_9 3333.33 cop[tikv] table:t1, partition:p4, range:(3,+inf], keep order:false, stats:pseudo └─TableReader_12 3333.33 root data:TableScan_11 - └─TableScan_11 3333.33 cop table:t1, partition:max, range:(3,+inf], keep order:false, stats:pseudo + └─TableScan_11 3333.33 cop[tikv] table:t1, partition:max, range:(3,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 4 order by a; a 5 @@ -992,7 +992,7 @@ a EXPLAIN SELECT * FROM t1 WHERE a > 4; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:(4,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:(4,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 5 order by a; a 6 @@ -1000,14 +1000,14 @@ a EXPLAIN SELECT * FROM t1 WHERE a > 5; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:(5,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:(5,+inf], keep order:false, stats:pseudo SELECT * FROM t1 WHERE a > 6 order by a; a 7 EXPLAIN SELECT * FROM t1 WHERE a > 6; id count task operator info TableReader_7 3333.33 root data:TableScan_6 -└─TableScan_6 3333.33 cop table:t1, partition:max, range:(6,+inf], keep order:false, stats:pseudo +└─TableScan_6 3333.33 cop[tikv] table:t1, partition:max, range:(6,+inf], keep order:false, stats:pseudo DROP TABLE t1; # test of RANGE and index CREATE TABLE t1 (a DATE, KEY(a)) @@ -1041,489 +1041,489 @@ EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:00) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME); id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03 00:00:00) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop le(Column#2, 2009-04-02 23:59:59) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-02 23:59:59) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE); id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00'; id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59'; id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03'; id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:01) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03 00:00:01) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:01) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop le(Column#2, 2009-04-02 23:59:58) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-02 23:59:58) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:58) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo DROP TABLE t1; # Test with DATE column NOT NULL CREATE TABLE t1 ( @@ -1544,489 +1544,489 @@ EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:00) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME); id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03 00:00:00) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop le(Column#2, 2009-04-02 23:59:59) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info IndexReader_11 0.00 root index:Selection_10 -└─Selection_10 0.00 cop eq(Column#2, 2009-04-02 23:59:59) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 0.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE); id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00'; id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59'; id count task operator info IndexReader_11 0.00 root index:Selection_10 -└─Selection_10 0.00 cop eq(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 0.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03'; id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03'; id count task operator info IndexReader_11 10.00 root index:Selection_10 -└─Selection_10 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03'; id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─IndexReader_15 3323.33 root index:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_13 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_13 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_21 3323.33 root index:Selection_20 -│ └─Selection_20 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_19 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_20 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_19 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_27 3323.33 root index:Selection_26 - └─Selection_26 3323.33 cop le(Column#2, 2009-04-03 00:00:01) - └─IndexScan_25 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_26 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) + └─IndexScan_25 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info IndexReader_11 0.00 root index:Selection_10 -└─Selection_10 0.00 cop eq(Column#2, 2009-04-03 00:00:01) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 0.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:01) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─IndexReader_16 3333.33 root index:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_14 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_14 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_22 3333.33 root index:Selection_21 -│ └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_20 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_20 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_28 3333.33 root index:Selection_27 -│ └─Selection_27 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─IndexScan_26 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_27 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─IndexScan_26 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_34 3333.33 root index:Selection_33 - └─Selection_33 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) - └─IndexScan_32 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_33 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) + └─IndexScan_32 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─IndexReader_14 3323.33 root index:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_12 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_20 3323.33 root index:Selection_19 - └─Selection_19 3323.33 cop le(Column#2, 2009-04-02 23:59:58) - └─IndexScan_18 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_19 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) + └─IndexScan_18 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info IndexReader_11 0.00 root index:Selection_10 -└─Selection_10 0.00 cop eq(Column#2, 2009-04-02 23:59:58) - └─IndexScan_9 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +└─Selection_10 0.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:58) + └─IndexScan_9 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─IndexReader_17 3333.33 root index:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_15 10000.00 cop table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_15 10000.00 cop[tikv] table:t1, partition:p20090401, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_23 3333.33 root index:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_21 10000.00 cop table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_21 10000.00 cop[tikv] table:t1, partition:p20090402, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_29 3333.33 root index:Selection_28 -│ └─Selection_28 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_27 10000.00 cop table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_28 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_27 10000.00 cop[tikv] table:t1, partition:p20090403, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo ├─IndexReader_35 3333.33 root index:Selection_34 -│ └─Selection_34 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─IndexScan_33 10000.00 cop table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo +│ └─Selection_34 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─IndexScan_33 10000.00 cop[tikv] table:t1, partition:p20090404, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_41 3333.33 root index:Selection_40 - └─Selection_40 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) - └─IndexScan_39 10000.00 cop table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo + └─Selection_40 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) + └─IndexScan_39 10000.00 cop[tikv] table:t1, partition:p20090405, index:a, b, range:[NULL,+inf], keep order:false, stats:pseudo DROP TABLE t1; # Test with DATETIME column NULL CREATE TABLE t1 ( @@ -2046,489 +2046,489 @@ EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:00) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME); id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03 00:00:00) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-02 23:59:59) - └─TableScan_6 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE); id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00'; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59'; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_6 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03'; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:01) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03 00:00:01) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:01) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:58) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-02 23:59:58) - └─TableScan_6 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:58) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo DROP TABLE t1; # Test with DATE column NULL CREATE TABLE t1 ( @@ -2548,489 +2548,489 @@ EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:00) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:00) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATETIME); id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03 00:00:00) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info TableReader_8 0.00 root data:Selection_7 -└─Selection_7 0.00 cop eq(Column#2, 2009-04-02 23:59:59) - └─TableScan_6 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 0.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#2, 2009-04-02 23:59:59) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:59' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop gt(Column#2, 2009-04-02 23:59:59) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03' AS DATE); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03' AS DATE); id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03' AS DATE); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03 00:00:00'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03 00:00:00'; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03 00:00:00'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-02 23:59:59'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-02 23:59:59'; id count task operator info TableReader_8 0.00 root data:Selection_7 -└─Selection_7 0.00 cop eq(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_6 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 0.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-02 23:59:59'; id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop gt(Column#2, 2009-04-02 23:59:59.000000) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:59.000000) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < '2009-04-03'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= '2009-04-03'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = '2009-04-03'; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= '2009-04-03'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > '2009-04-03'; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:00.000000) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:00.000000) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#2, 2009-04-03 00:00:01) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#2, 2009-04-03 00:00:01) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_10 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop le(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_13 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop le(Column#2, 2009-04-03 00:00:01) - └─TableScan_16 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] le(Column#2, 2009-04-03 00:00:01) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info TableReader_8 0.00 root data:Selection_7 -└─Selection_7 0.00 cop eq(Column#2, 2009-04-03 00:00:01) - └─TableScan_6 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 0.00 cop[tikv] eq(Column#2, 2009-04-03 00:00:01) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#2, 2009-04-03 00:00:01) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#2, 2009-04-03 00:00:01) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-03 00:00:01' AS DATETIME); id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_11 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_14 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) -│ └─TableScan_17 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#2, 2009-04-03 00:00:01) - └─TableScan_20 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#2, 2009-04-03 00:00:01) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#2, 2009-04-02 23:59:58) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#2, 2009-04-02 23:59:58) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b <= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_9 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#2, 2009-04-02 23:59:58) - └─TableScan_12 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#2, 2009-04-02 23:59:58) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b = CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info TableReader_8 0.00 root data:Selection_7 -└─Selection_7 0.00 cop eq(Column#2, 2009-04-02 23:59:58) - └─TableScan_6 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 0.00 cop[tikv] eq(Column#2, 2009-04-02 23:59:58) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b >= CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#2, 2009-04-02 23:59:58) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#2, 2009-04-02 23:59:58) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo EXPLAIN SELECT * FROM t1 WHERE b > CAST('2009-04-02 23:59:58' AS DATETIME); id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop gt(Column#2, 2009-04-02 23:59:58) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] gt(Column#2, 2009-04-02 23:59:58) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo DROP TABLE t1; # For better code coverage of the patch CREATE TABLE t1 ( @@ -3048,20 +3048,20 @@ EXPLAIN SELECT * FROM t1 WHERE b < CAST('2009-04-99' AS DATETIME); id count task operator info Union_11 0.00 root ├─TableReader_14 0.00 root data:Selection_13 -│ └─Selection_13 0.00 cop lt(Column#2, NULL) -│ └─TableScan_12 10000.00 cop table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 0.00 cop[tikv] lt(Column#2, NULL) +│ └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p20090401, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 0.00 root data:Selection_16 -│ └─Selection_16 0.00 cop lt(Column#2, NULL) -│ └─TableScan_15 10000.00 cop table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 0.00 cop[tikv] lt(Column#2, NULL) +│ └─TableScan_15 10000.00 cop[tikv] table:t1, partition:p20090402, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 0.00 root data:Selection_19 -│ └─Selection_19 0.00 cop lt(Column#2, NULL) -│ └─TableScan_18 10000.00 cop table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 0.00 cop[tikv] lt(Column#2, NULL) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, partition:p20090403, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 0.00 root data:Selection_22 -│ └─Selection_22 0.00 cop lt(Column#2, NULL) -│ └─TableScan_21 10000.00 cop table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 0.00 cop[tikv] lt(Column#2, NULL) +│ └─TableScan_21 10000.00 cop[tikv] table:t1, partition:p20090404, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 0.00 root data:Selection_25 - └─Selection_25 0.00 cop lt(Column#2, NULL) - └─TableScan_24 10000.00 cop table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 0.00 cop[tikv] lt(Column#2, NULL) + └─TableScan_24 10000.00 cop[tikv] table:t1, partition:p20090405, range:[-inf,+inf], keep order:false, stats:pseudo DROP TABLE t1; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, @@ -3086,13 +3086,13 @@ insert into t3 values (5),(15); explain select * from t3 where a=11; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 11) - └─TableScan_6 10000.00 cop table:t3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 11) + └─TableScan_6 10000.00 cop[tikv] table:t3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t3 where a=10; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 10) - └─TableScan_6 10000.00 cop table:t3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 10) + └─TableScan_6 10000.00 cop[tikv] table:t3, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t3 where a=20; id count task operator info TableDual_6 0.00 root rows:0 @@ -3110,190 +3110,190 @@ insert into t7 values (10),(30),(50); explain select * from t7 where a < 5; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop lt(Column#1, 5) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] lt(Column#1, 5) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 9; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop lt(Column#1, 9) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] lt(Column#1, 9) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 9; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop le(Column#1, 9) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] le(Column#1, 9) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 9; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 9) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 9) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a >= 9; id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#1, 9) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#1, 9) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#1, 9) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#1, 9) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#1, 9) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#1, 9) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a > 9; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#1, 9) -│ └─TableScan_11 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#1, 9) +│ └─TableScan_11 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#1, 9) -│ └─TableScan_14 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#1, 9) +│ └─TableScan_14 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#1, 9) -│ └─TableScan_17 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#1, 9) +│ └─TableScan_17 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#1, 9) - └─TableScan_20 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#1, 9) + └─TableScan_20 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 10; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop lt(Column#1, 10) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] lt(Column#1, 10) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 10; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#1, 10) -│ └─TableScan_9 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#1, 10) +│ └─TableScan_9 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#1, 10) - └─TableScan_12 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#1, 10) + └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 10; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 10) - └─TableScan_6 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 10) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a >= 10; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#1, 10) -│ └─TableScan_11 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#1, 10) +│ └─TableScan_11 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#1, 10) -│ └─TableScan_14 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#1, 10) +│ └─TableScan_14 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#1, 10) -│ └─TableScan_17 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#1, 10) +│ └─TableScan_17 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#1, 10) - └─TableScan_20 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#1, 10) + └─TableScan_20 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a > 10; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#1, 10) -│ └─TableScan_11 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#1, 10) +│ └─TableScan_11 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#1, 10) -│ └─TableScan_14 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#1, 10) +│ └─TableScan_14 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#1, 10) -│ └─TableScan_17 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#1, 10) +│ └─TableScan_17 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#1, 10) - └─TableScan_20 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#1, 10) + └─TableScan_20 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 89; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#1, 89) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop lt(Column#1, 89) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop lt(Column#1, 89) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop lt(Column#1, 89) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop lt(Column#1, 89) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] lt(Column#1, 89) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 89; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#1, 89) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop le(Column#1, 89) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop le(Column#1, 89) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop le(Column#1, 89) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop le(Column#1, 89) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] le(Column#1, 89) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 89; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 89) - └─TableScan_6 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 89) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a > 89; id count task operator info TableDual_6 0.00 root rows:0 explain select * from t7 where a >= 89; id count task operator info TableReader_8 3333.33 root data:Selection_7 -└─Selection_7 3333.33 cop ge(Column#1, 89) - └─TableScan_6 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3333.33 cop[tikv] ge(Column#1, 89) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 90; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#1, 90) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop lt(Column#1, 90) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop lt(Column#1, 90) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop lt(Column#1, 90) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop lt(Column#1, 90) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] lt(Column#1, 90) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 90; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#1, 90) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop le(Column#1, 90) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop le(Column#1, 90) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop le(Column#1, 90) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop le(Column#1, 90) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] le(Column#1, 90) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 90; id count task operator info TableDual_6 0.00 root rows:0 @@ -3309,8 +3309,8 @@ TableDual_6 0.00 root rows:0 explain select * from t7 where a > 11 and a < 29; id count task operator info TableReader_8 250.00 root data:Selection_7 -└─Selection_7 250.00 cop gt(Column#1, 11), lt(Column#1, 29) - └─TableScan_6 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 250.00 cop[tikv] gt(Column#1, 11), lt(Column#1, 29) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo drop table t7; create table t7 (a int unsigned not null) partition by RANGE(a) ( partition p10 values less than (10), @@ -3323,190 +3323,190 @@ insert into t7 values (10),(30),(50); explain select * from t7 where a < 5; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop lt(Column#1, 5) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] lt(Column#1, 5) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 9; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop lt(Column#1, 9) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] lt(Column#1, 9) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 9; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop le(Column#1, 9) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] le(Column#1, 9) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 9; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 9) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 9) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a >= 9; id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop ge(Column#1, 9) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3333.33 root data:Selection_16 -│ └─Selection_16 3333.33 cop ge(Column#1, 9) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop ge(Column#1, 9) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3333.33 root data:Selection_22 -│ └─Selection_22 3333.33 cop ge(Column#1, 9) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3333.33 cop[tikv] ge(Column#1, 9) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3333.33 root data:Selection_25 - └─Selection_25 3333.33 cop ge(Column#1, 9) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3333.33 cop[tikv] ge(Column#1, 9) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a > 9; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#1, 9) -│ └─TableScan_11 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#1, 9) +│ └─TableScan_11 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#1, 9) -│ └─TableScan_14 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#1, 9) +│ └─TableScan_14 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#1, 9) -│ └─TableScan_17 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#1, 9) +│ └─TableScan_17 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#1, 9) - └─TableScan_20 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#1, 9) + └─TableScan_20 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 10; id count task operator info TableReader_8 3323.33 root data:Selection_7 -└─Selection_7 3323.33 cop lt(Column#1, 10) - └─TableScan_6 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3323.33 cop[tikv] lt(Column#1, 10) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 10; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#1, 10) -│ └─TableScan_9 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#1, 10) +│ └─TableScan_9 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#1, 10) - └─TableScan_12 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#1, 10) + └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 10; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 10) - └─TableScan_6 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 10) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a >= 10; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop ge(Column#1, 10) -│ └─TableScan_11 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] ge(Column#1, 10) +│ └─TableScan_11 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop ge(Column#1, 10) -│ └─TableScan_14 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] ge(Column#1, 10) +│ └─TableScan_14 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop ge(Column#1, 10) -│ └─TableScan_17 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] ge(Column#1, 10) +│ └─TableScan_17 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop ge(Column#1, 10) - └─TableScan_20 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] ge(Column#1, 10) + └─TableScan_20 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a > 10; id count task operator info Union_10 13333.33 root ├─TableReader_13 3333.33 root data:Selection_12 -│ └─Selection_12 3333.33 cop gt(Column#1, 10) -│ └─TableScan_11 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 3333.33 cop[tikv] gt(Column#1, 10) +│ └─TableScan_11 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 3333.33 root data:Selection_15 -│ └─Selection_15 3333.33 cop gt(Column#1, 10) -│ └─TableScan_14 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 3333.33 cop[tikv] gt(Column#1, 10) +│ └─TableScan_14 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 3333.33 root data:Selection_18 -│ └─Selection_18 3333.33 cop gt(Column#1, 10) -│ └─TableScan_17 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 3333.33 cop[tikv] gt(Column#1, 10) +│ └─TableScan_17 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 3333.33 root data:Selection_21 - └─Selection_21 3333.33 cop gt(Column#1, 10) - └─TableScan_20 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 3333.33 cop[tikv] gt(Column#1, 10) + └─TableScan_20 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 89; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#1, 89) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop lt(Column#1, 89) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop lt(Column#1, 89) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop lt(Column#1, 89) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] lt(Column#1, 89) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop lt(Column#1, 89) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] lt(Column#1, 89) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 89; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#1, 89) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop le(Column#1, 89) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop le(Column#1, 89) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop le(Column#1, 89) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] le(Column#1, 89) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop le(Column#1, 89) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] le(Column#1, 89) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 89; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 89) - └─TableScan_6 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 89) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a > 89; id count task operator info TableDual_6 0.00 root rows:0 explain select * from t7 where a >= 89; id count task operator info TableReader_8 3333.33 root data:Selection_7 -└─Selection_7 3333.33 cop ge(Column#1, 89) - └─TableScan_6 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 3333.33 cop[tikv] ge(Column#1, 89) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a < 90; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop lt(Column#1, 90) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop lt(Column#1, 90) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop lt(Column#1, 90) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop lt(Column#1, 90) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] lt(Column#1, 90) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop lt(Column#1, 90) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] lt(Column#1, 90) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a <= 90; id count task operator info Union_11 16616.67 root ├─TableReader_14 3323.33 root data:Selection_13 -│ └─Selection_13 3323.33 cop le(Column#1, 90) -│ └─TableScan_12 10000.00 cop table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_12 10000.00 cop[tikv] table:t7, partition:p10, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 3323.33 root data:Selection_16 -│ └─Selection_16 3323.33 cop le(Column#1, 90) -│ └─TableScan_15 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_15 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3323.33 root data:Selection_19 -│ └─Selection_19 3323.33 cop le(Column#1, 90) -│ └─TableScan_18 10000.00 cop table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_18 10000.00 cop[tikv] table:t7, partition:p50, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 3323.33 root data:Selection_22 -│ └─Selection_22 3323.33 cop le(Column#1, 90) -│ └─TableScan_21 10000.00 cop table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 3323.33 cop[tikv] le(Column#1, 90) +│ └─TableScan_21 10000.00 cop[tikv] table:t7, partition:p70, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 3323.33 root data:Selection_25 - └─Selection_25 3323.33 cop le(Column#1, 90) - └─TableScan_24 10000.00 cop table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 3323.33 cop[tikv] le(Column#1, 90) + └─TableScan_24 10000.00 cop[tikv] table:t7, partition:p90, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t7 where a = 90; id count task operator info TableDual_6 0.00 root rows:0 @@ -3522,8 +3522,8 @@ TableDual_6 0.00 root rows:0 explain select * from t7 where a > 11 and a < 29; id count task operator info TableReader_8 250.00 root data:Selection_7 -└─Selection_7 250.00 cop gt(Column#1, 11), lt(Column#1, 29) - └─TableScan_6 10000.00 cop table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 250.00 cop[tikv] gt(Column#1, 11), lt(Column#1, 29) + └─TableScan_6 10000.00 cop[tikv] table:t7, partition:p30, range:[-inf,+inf], keep order:false, stats:pseudo create table t8 (a date not null) partition by RANGE(YEAR(a)) ( partition p0 values less than (1980), partition p1 values less than (1990), @@ -3534,14 +3534,14 @@ explain select * from t8 where a < '1980-02-02'; id count task operator info Union_9 9970.00 root ├─TableReader_12 3323.33 root data:Selection_11 -│ └─Selection_11 3323.33 cop lt(Column#1, 1980-02-02 00:00:00.000000) -│ └─TableScan_10 10000.00 cop table:t8, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 3323.33 cop[tikv] lt(Column#1, 1980-02-02 00:00:00.000000) +│ └─TableScan_10 10000.00 cop[tikv] table:t8, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 3323.33 root data:Selection_14 -│ └─Selection_14 3323.33 cop lt(Column#1, 1980-02-02 00:00:00.000000) -│ └─TableScan_13 10000.00 cop table:t8, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 3323.33 cop[tikv] lt(Column#1, 1980-02-02 00:00:00.000000) +│ └─TableScan_13 10000.00 cop[tikv] table:t8, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 3323.33 root data:Selection_17 - └─Selection_17 3323.33 cop lt(Column#1, 1980-02-02 00:00:00.000000) - └─TableScan_16 10000.00 cop table:t8, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 3323.33 cop[tikv] lt(Column#1, 1980-02-02 00:00:00.000000) + └─TableScan_16 10000.00 cop[tikv] table:t8, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo create table t9 (a date not null) partition by RANGE(TO_DAYS(a)) ( partition p0 values less than (732299), -- 2004-12-19 partition p1 values less than (732468), -- 2005-06-06 @@ -3552,20 +3552,20 @@ explain select * from t9 where a < '2004-12-19'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#1, 2004-12-19 00:00:00.000000) -│ └─TableScan_9 10000.00 cop table:t9, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#1, 2004-12-19 00:00:00.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t9, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#1, 2004-12-19 00:00:00.000000) - └─TableScan_12 10000.00 cop table:t9, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#1, 2004-12-19 00:00:00.000000) + └─TableScan_12 10000.00 cop[tikv] table:t9, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t9 where a <= '2004-12-19'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop le(Column#1, 2004-12-19 00:00:00.000000) -│ └─TableScan_9 10000.00 cop table:t9, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] le(Column#1, 2004-12-19 00:00:00.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t9, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop le(Column#1, 2004-12-19 00:00:00.000000) - └─TableScan_12 10000.00 cop table:t9, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] le(Column#1, 2004-12-19 00:00:00.000000) + └─TableScan_12 10000.00 cop[tikv] table:t9, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo drop table t7,t8,t9; create table t1 ( a1 int not null @@ -3580,20 +3580,20 @@ explain select * from t1 where a1 > 3; id count task operator info Union_8 6666.67 root ├─TableReader_11 3333.33 root data:Selection_10 -│ └─Selection_10 3333.33 cop gt(Column#1, 3) -│ └─TableScan_9 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3333.33 cop[tikv] gt(Column#1, 3) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3333.33 root data:Selection_13 - └─Selection_13 3333.33 cop gt(Column#1, 3) - └─TableScan_12 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3333.33 cop[tikv] gt(Column#1, 3) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a1 >= 3; id count task operator info Union_8 6666.67 root ├─TableReader_11 3333.33 root data:Selection_10 -│ └─Selection_10 3333.33 cop ge(Column#1, 3) -│ └─TableScan_9 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3333.33 cop[tikv] ge(Column#1, 3) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3333.33 root data:Selection_13 - └─Selection_13 3333.33 cop ge(Column#1, 3) - └─TableScan_12 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3333.33 cop[tikv] ge(Column#1, 3) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a1 < 3 and a1 > 3; id count task operator info TableDual_6 0.00 root rows:0 @@ -3628,30 +3628,30 @@ explain select * from t2; id count task operator info Union_10 50000.00 root ├─TableReader_12 10000.00 root data:TableScan_11 -│ └─TableScan_11 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_11 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_14 10000.00 root data:TableScan_13 -│ └─TableScan_13 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_13 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 10000.00 root data:TableScan_15 -│ └─TableScan_15 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_15 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_18 10000.00 root data:TableScan_17 -│ └─TableScan_17 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_17 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_20 10000.00 root data:TableScan_19 - └─TableScan_19 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_19 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a < 801 and a > 200; id count task operator info Union_10 1000.00 root ├─TableReader_13 250.00 root data:Selection_12 -│ └─Selection_12 250.00 cop gt(Column#1, 200), lt(Column#1, 801) -│ └─TableScan_11 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 250.00 cop[tikv] gt(Column#1, 200), lt(Column#1, 801) +│ └─TableScan_11 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 250.00 root data:Selection_15 -│ └─Selection_15 250.00 cop gt(Column#1, 200), lt(Column#1, 801) -│ └─TableScan_14 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 250.00 cop[tikv] gt(Column#1, 200), lt(Column#1, 801) +│ └─TableScan_14 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 250.00 root data:Selection_18 -│ └─Selection_18 250.00 cop gt(Column#1, 200), lt(Column#1, 801) -│ └─TableScan_17 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 250.00 cop[tikv] gt(Column#1, 200), lt(Column#1, 801) +│ └─TableScan_17 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 250.00 root data:Selection_21 - └─Selection_21 250.00 cop gt(Column#1, 200), lt(Column#1, 801) - └─TableScan_20 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 250.00 cop[tikv] gt(Column#1, 200), lt(Column#1, 801) + └─TableScan_20 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a < 801 and a > 800; id count task operator info TableDual_6 0.00 root rows:0 @@ -3659,56 +3659,56 @@ explain select * from t2 where a > 600; id count task operator info Union_8 6666.67 root ├─TableReader_11 3333.33 root data:Selection_10 -│ └─Selection_10 3333.33 cop gt(Column#1, 600) -│ └─TableScan_9 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3333.33 cop[tikv] gt(Column#1, 600) +│ └─TableScan_9 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3333.33 root data:Selection_13 - └─Selection_13 3333.33 cop gt(Column#1, 600) - └─TableScan_12 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3333.33 cop[tikv] gt(Column#1, 600) + └─TableScan_12 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a > 600 and b = 1; id count task operator info Union_8 6.67 root ├─TableReader_11 3.33 root data:Selection_10 -│ └─Selection_10 3.33 cop eq(Column#2, 1), gt(Column#1, 600) -│ └─TableScan_9 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3.33 cop[tikv] eq(Column#2, 1), gt(Column#1, 600) +│ └─TableScan_9 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3.33 root data:Selection_13 - └─Selection_13 3.33 cop eq(Column#2, 1), gt(Column#1, 600) - └─TableScan_12 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3.33 cop[tikv] eq(Column#2, 1), gt(Column#1, 600) + └─TableScan_12 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a > 600 and b = 4; id count task operator info Union_8 6.67 root ├─TableReader_11 3.33 root data:Selection_10 -│ └─Selection_10 3.33 cop eq(Column#2, 4), gt(Column#1, 600) -│ └─TableScan_9 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3.33 cop[tikv] eq(Column#2, 4), gt(Column#1, 600) +│ └─TableScan_9 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3.33 root data:Selection_13 - └─Selection_13 3.33 cop eq(Column#2, 4), gt(Column#1, 600) - └─TableScan_12 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3.33 cop[tikv] eq(Column#2, 4), gt(Column#1, 600) + └─TableScan_12 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a > 600 and b = 5; id count task operator info Union_8 6.67 root ├─TableReader_11 3.33 root data:Selection_10 -│ └─Selection_10 3.33 cop eq(Column#2, 5), gt(Column#1, 600) -│ └─TableScan_9 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3.33 cop[tikv] eq(Column#2, 5), gt(Column#1, 600) +│ └─TableScan_9 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3.33 root data:Selection_13 - └─Selection_13 3.33 cop eq(Column#2, 5), gt(Column#1, 600) - └─TableScan_12 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3.33 cop[tikv] eq(Column#2, 5), gt(Column#1, 600) + └─TableScan_12 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where b = 5; id count task operator info Union_11 50.00 root ├─TableReader_14 10.00 root data:Selection_13 -│ └─Selection_13 10.00 cop eq(Column#2, 5) -│ └─TableScan_12 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 10.00 cop[tikv] eq(Column#2, 5) +│ └─TableScan_12 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_17 10.00 root data:Selection_16 -│ └─Selection_16 10.00 cop eq(Column#2, 5) -│ └─TableScan_15 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_16 10.00 cop[tikv] eq(Column#2, 5) +│ └─TableScan_15 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 10.00 root data:Selection_19 -│ └─Selection_19 10.00 cop eq(Column#2, 5) -│ └─TableScan_18 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 10.00 cop[tikv] eq(Column#2, 5) +│ └─TableScan_18 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_23 10.00 root data:Selection_22 -│ └─Selection_22 10.00 cop eq(Column#2, 5) -│ └─TableScan_21 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_22 10.00 cop[tikv] eq(Column#2, 5) +│ └─TableScan_21 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_26 10.00 root data:Selection_25 - └─Selection_25 10.00 cop eq(Column#2, 5) - └─TableScan_24 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_25 10.00 cop[tikv] eq(Column#2, 5) + └─TableScan_24 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo flush status; update t2 set b = 100 where b = 6; show status like 'Handler_read_rnd_next'; @@ -3754,213 +3754,213 @@ explain select * from t2; id count task operator info Union_10 50000.00 root ├─TableReader_12 10000.00 root data:TableScan_11 -│ └─TableScan_11 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_11 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_14 10000.00 root data:TableScan_13 -│ └─TableScan_13 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_13 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 10000.00 root data:TableScan_15 -│ └─TableScan_15 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_15 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_18 10000.00 root data:TableScan_17 -│ └─TableScan_17 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_17 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_20 10000.00 root data:TableScan_19 - └─TableScan_19 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_19 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a = 101; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 101) - └─TableScan_6 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 101) + └─TableScan_6 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a = 550; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 550) - └─TableScan_6 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 550) + └─TableScan_6 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a = 833; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 833) - └─TableScan_6 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 833) + └─TableScan_6 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where (a = 100 OR a = 900); id count task operator info Union_8 40.00 root ├─TableReader_11 20.00 root data:Selection_10 -│ └─Selection_10 20.00 cop or(eq(Column#1, 100), eq(Column#1, 900)) -│ └─TableScan_9 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 20.00 cop[tikv] or(eq(Column#1, 100), eq(Column#1, 900)) +│ └─TableScan_9 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 20.00 root data:Selection_13 - └─Selection_13 20.00 cop or(eq(Column#1, 100), eq(Column#1, 900)) - └─TableScan_12 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 20.00 cop[tikv] or(eq(Column#1, 100), eq(Column#1, 900)) + └─TableScan_12 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where (a > 100 AND a < 600); id count task operator info Union_9 750.00 root ├─TableReader_12 250.00 root data:Selection_11 -│ └─Selection_11 250.00 cop gt(Column#1, 100), lt(Column#1, 600) -│ └─TableScan_10 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 250.00 cop[tikv] gt(Column#1, 100), lt(Column#1, 600) +│ └─TableScan_10 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 250.00 root data:Selection_14 -│ └─Selection_14 250.00 cop gt(Column#1, 100), lt(Column#1, 600) -│ └─TableScan_13 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 250.00 cop[tikv] gt(Column#1, 100), lt(Column#1, 600) +│ └─TableScan_13 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 250.00 root data:Selection_17 - └─Selection_17 250.00 cop gt(Column#1, 100), lt(Column#1, 600) - └─TableScan_16 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 250.00 cop[tikv] gt(Column#1, 100), lt(Column#1, 600) + └─TableScan_16 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where b = 4; id count task operator info Union_11 50.00 root ├─IndexLookUp_17 10.00 root -│ ├─IndexScan_15 10.00 cop table:t2, partition:p0, index:b, range:[4,4], keep order:false, stats:pseudo -│ └─TableScan_16 10.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 10.00 cop[tikv] table:t2, partition:p0, index:b, range:[4,4], keep order:false, stats:pseudo +│ └─TableScan_16 10.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 10.00 root -│ ├─IndexScan_21 10.00 cop table:t2, partition:p1, index:b, range:[4,4], keep order:false, stats:pseudo -│ └─TableScan_22 10.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 10.00 cop[tikv] table:t2, partition:p1, index:b, range:[4,4], keep order:false, stats:pseudo +│ └─TableScan_22 10.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 10.00 root -│ ├─IndexScan_27 10.00 cop table:t2, partition:p2, index:b, range:[4,4], keep order:false, stats:pseudo -│ └─TableScan_28 10.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 10.00 cop[tikv] table:t2, partition:p2, index:b, range:[4,4], keep order:false, stats:pseudo +│ └─TableScan_28 10.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 10.00 root -│ ├─IndexScan_33 10.00 cop table:t2, partition:p3, index:b, range:[4,4], keep order:false, stats:pseudo -│ └─TableScan_34 10.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 10.00 cop[tikv] table:t2, partition:p3, index:b, range:[4,4], keep order:false, stats:pseudo +│ └─TableScan_34 10.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 10.00 root - ├─IndexScan_39 10.00 cop table:t2, partition:p4, index:b, range:[4,4], keep order:false, stats:pseudo - └─TableScan_40 10.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 10.00 cop[tikv] table:t2, partition:p4, index:b, range:[4,4], keep order:false, stats:pseudo + └─TableScan_40 10.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo explain select * from t2 where b = 6; id count task operator info Union_11 50.00 root ├─IndexLookUp_17 10.00 root -│ ├─IndexScan_15 10.00 cop table:t2, partition:p0, index:b, range:[6,6], keep order:false, stats:pseudo -│ └─TableScan_16 10.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 10.00 cop[tikv] table:t2, partition:p0, index:b, range:[6,6], keep order:false, stats:pseudo +│ └─TableScan_16 10.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 10.00 root -│ ├─IndexScan_21 10.00 cop table:t2, partition:p1, index:b, range:[6,6], keep order:false, stats:pseudo -│ └─TableScan_22 10.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 10.00 cop[tikv] table:t2, partition:p1, index:b, range:[6,6], keep order:false, stats:pseudo +│ └─TableScan_22 10.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 10.00 root -│ ├─IndexScan_27 10.00 cop table:t2, partition:p2, index:b, range:[6,6], keep order:false, stats:pseudo -│ └─TableScan_28 10.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 10.00 cop[tikv] table:t2, partition:p2, index:b, range:[6,6], keep order:false, stats:pseudo +│ └─TableScan_28 10.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 10.00 root -│ ├─IndexScan_33 10.00 cop table:t2, partition:p3, index:b, range:[6,6], keep order:false, stats:pseudo -│ └─TableScan_34 10.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 10.00 cop[tikv] table:t2, partition:p3, index:b, range:[6,6], keep order:false, stats:pseudo +│ └─TableScan_34 10.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 10.00 root - ├─IndexScan_39 10.00 cop table:t2, partition:p4, index:b, range:[6,6], keep order:false, stats:pseudo - └─TableScan_40 10.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 10.00 cop[tikv] table:t2, partition:p4, index:b, range:[6,6], keep order:false, stats:pseudo + └─TableScan_40 10.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo explain select * from t2 where b in (1,3,5); id count task operator info Union_11 150.00 root ├─IndexLookUp_17 30.00 root -│ ├─IndexScan_15 30.00 cop table:t2, partition:p0, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo -│ └─TableScan_16 30.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 30.00 cop[tikv] table:t2, partition:p0, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo +│ └─TableScan_16 30.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 30.00 root -│ ├─IndexScan_21 30.00 cop table:t2, partition:p1, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo -│ └─TableScan_22 30.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 30.00 cop[tikv] table:t2, partition:p1, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo +│ └─TableScan_22 30.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 30.00 root -│ ├─IndexScan_27 30.00 cop table:t2, partition:p2, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo -│ └─TableScan_28 30.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 30.00 cop[tikv] table:t2, partition:p2, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo +│ └─TableScan_28 30.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 30.00 root -│ ├─IndexScan_33 30.00 cop table:t2, partition:p3, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo -│ └─TableScan_34 30.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 30.00 cop[tikv] table:t2, partition:p3, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo +│ └─TableScan_34 30.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 30.00 root - ├─IndexScan_39 30.00 cop table:t2, partition:p4, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo - └─TableScan_40 30.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 30.00 cop[tikv] table:t2, partition:p4, index:b, range:[1,1], [3,3], [5,5], keep order:false, stats:pseudo + └─TableScan_40 30.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo explain select * from t2 where b in (2,4,6); id count task operator info Union_11 150.00 root ├─IndexLookUp_17 30.00 root -│ ├─IndexScan_15 30.00 cop table:t2, partition:p0, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo -│ └─TableScan_16 30.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 30.00 cop[tikv] table:t2, partition:p0, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo +│ └─TableScan_16 30.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 30.00 root -│ ├─IndexScan_21 30.00 cop table:t2, partition:p1, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo -│ └─TableScan_22 30.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 30.00 cop[tikv] table:t2, partition:p1, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo +│ └─TableScan_22 30.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 30.00 root -│ ├─IndexScan_27 30.00 cop table:t2, partition:p2, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo -│ └─TableScan_28 30.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 30.00 cop[tikv] table:t2, partition:p2, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo +│ └─TableScan_28 30.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 30.00 root -│ ├─IndexScan_33 30.00 cop table:t2, partition:p3, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo -│ └─TableScan_34 30.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 30.00 cop[tikv] table:t2, partition:p3, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo +│ └─TableScan_34 30.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 30.00 root - ├─IndexScan_39 30.00 cop table:t2, partition:p4, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo - └─TableScan_40 30.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 30.00 cop[tikv] table:t2, partition:p4, index:b, range:[2,2], [4,4], [6,6], keep order:false, stats:pseudo + └─TableScan_40 30.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo explain select * from t2 where b in (7,8,9); id count task operator info Union_11 150.00 root ├─IndexLookUp_17 30.00 root -│ ├─IndexScan_15 30.00 cop table:t2, partition:p0, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo -│ └─TableScan_16 30.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 30.00 cop[tikv] table:t2, partition:p0, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo +│ └─TableScan_16 30.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 30.00 root -│ ├─IndexScan_21 30.00 cop table:t2, partition:p1, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo -│ └─TableScan_22 30.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 30.00 cop[tikv] table:t2, partition:p1, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo +│ └─TableScan_22 30.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 30.00 root -│ ├─IndexScan_27 30.00 cop table:t2, partition:p2, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo -│ └─TableScan_28 30.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 30.00 cop[tikv] table:t2, partition:p2, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo +│ └─TableScan_28 30.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 30.00 root -│ ├─IndexScan_33 30.00 cop table:t2, partition:p3, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo -│ └─TableScan_34 30.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 30.00 cop[tikv] table:t2, partition:p3, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo +│ └─TableScan_34 30.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 30.00 root - ├─IndexScan_39 30.00 cop table:t2, partition:p4, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo - └─TableScan_40 30.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 30.00 cop[tikv] table:t2, partition:p4, index:b, range:[7,7], [8,8], [9,9], keep order:false, stats:pseudo + └─TableScan_40 30.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo explain select * from t2 where b > 5; id count task operator info Union_11 16666.67 root ├─TableReader_14 3333.33 root data:Selection_13 -│ └─Selection_13 3333.33 cop gt(Column#2, 5) -│ └─TableScan_12 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_13 3333.33 cop[tikv] gt(Column#2, 5) +│ └─TableScan_12 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_20 3333.33 root data:Selection_19 -│ └─Selection_19 3333.33 cop gt(Column#2, 5) -│ └─TableScan_18 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 3333.33 cop[tikv] gt(Column#2, 5) +│ └─TableScan_18 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_26 3333.33 root data:Selection_25 -│ └─Selection_25 3333.33 cop gt(Column#2, 5) -│ └─TableScan_24 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_25 3333.33 cop[tikv] gt(Column#2, 5) +│ └─TableScan_24 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_32 3333.33 root data:Selection_31 -│ └─Selection_31 3333.33 cop gt(Column#2, 5) -│ └─TableScan_30 10000.00 cop table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_31 3333.33 cop[tikv] gt(Column#2, 5) +│ └─TableScan_30 10000.00 cop[tikv] table:t2, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_38 3333.33 root data:Selection_37 - └─Selection_37 3333.33 cop gt(Column#2, 5) - └─TableScan_36 10000.00 cop table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_37 3333.33 cop[tikv] gt(Column#2, 5) + └─TableScan_36 10000.00 cop[tikv] table:t2, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where b > 5 and b < 8; id count task operator info Union_11 1250.00 root ├─IndexLookUp_17 250.00 root -│ ├─IndexScan_15 250.00 cop table:t2, partition:p0, index:b, range:(5,8), keep order:false, stats:pseudo -│ └─TableScan_16 250.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 250.00 cop[tikv] table:t2, partition:p0, index:b, range:(5,8), keep order:false, stats:pseudo +│ └─TableScan_16 250.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 250.00 root -│ ├─IndexScan_21 250.00 cop table:t2, partition:p1, index:b, range:(5,8), keep order:false, stats:pseudo -│ └─TableScan_22 250.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 250.00 cop[tikv] table:t2, partition:p1, index:b, range:(5,8), keep order:false, stats:pseudo +│ └─TableScan_22 250.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 250.00 root -│ ├─IndexScan_27 250.00 cop table:t2, partition:p2, index:b, range:(5,8), keep order:false, stats:pseudo -│ └─TableScan_28 250.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 250.00 cop[tikv] table:t2, partition:p2, index:b, range:(5,8), keep order:false, stats:pseudo +│ └─TableScan_28 250.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 250.00 root -│ ├─IndexScan_33 250.00 cop table:t2, partition:p3, index:b, range:(5,8), keep order:false, stats:pseudo -│ └─TableScan_34 250.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 250.00 cop[tikv] table:t2, partition:p3, index:b, range:(5,8), keep order:false, stats:pseudo +│ └─TableScan_34 250.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 250.00 root - ├─IndexScan_39 250.00 cop table:t2, partition:p4, index:b, range:(5,8), keep order:false, stats:pseudo - └─TableScan_40 250.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 250.00 cop[tikv] table:t2, partition:p4, index:b, range:(5,8), keep order:false, stats:pseudo + └─TableScan_40 250.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo explain select * from t2 where b > 5 and b < 7; id count task operator info Union_11 1250.00 root ├─IndexLookUp_17 250.00 root -│ ├─IndexScan_15 250.00 cop table:t2, partition:p0, index:b, range:(5,7), keep order:false, stats:pseudo -│ └─TableScan_16 250.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 250.00 cop[tikv] table:t2, partition:p0, index:b, range:(5,7), keep order:false, stats:pseudo +│ └─TableScan_16 250.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 250.00 root -│ ├─IndexScan_21 250.00 cop table:t2, partition:p1, index:b, range:(5,7), keep order:false, stats:pseudo -│ └─TableScan_22 250.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 250.00 cop[tikv] table:t2, partition:p1, index:b, range:(5,7), keep order:false, stats:pseudo +│ └─TableScan_22 250.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 250.00 root -│ ├─IndexScan_27 250.00 cop table:t2, partition:p2, index:b, range:(5,7), keep order:false, stats:pseudo -│ └─TableScan_28 250.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 250.00 cop[tikv] table:t2, partition:p2, index:b, range:(5,7), keep order:false, stats:pseudo +│ └─TableScan_28 250.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 250.00 root -│ ├─IndexScan_33 250.00 cop table:t2, partition:p3, index:b, range:(5,7), keep order:false, stats:pseudo -│ └─TableScan_34 250.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 250.00 cop[tikv] table:t2, partition:p3, index:b, range:(5,7), keep order:false, stats:pseudo +│ └─TableScan_34 250.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 250.00 root - ├─IndexScan_39 250.00 cop table:t2, partition:p4, index:b, range:(5,7), keep order:false, stats:pseudo - └─TableScan_40 250.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 250.00 cop[tikv] table:t2, partition:p4, index:b, range:(5,7), keep order:false, stats:pseudo + └─TableScan_40 250.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo explain select * from t2 where b > 0 and b < 5; id count task operator info Union_11 1250.00 root ├─IndexLookUp_17 250.00 root -│ ├─IndexScan_15 250.00 cop table:t2, partition:p0, index:b, range:(0,5), keep order:false, stats:pseudo -│ └─TableScan_16 250.00 cop table:t2, partition:p0, keep order:false, stats:pseudo +│ ├─IndexScan_15 250.00 cop[tikv] table:t2, partition:p0, index:b, range:(0,5), keep order:false, stats:pseudo +│ └─TableScan_16 250.00 cop[tikv] table:t2, partition:p0, keep order:false, stats:pseudo ├─IndexLookUp_23 250.00 root -│ ├─IndexScan_21 250.00 cop table:t2, partition:p1, index:b, range:(0,5), keep order:false, stats:pseudo -│ └─TableScan_22 250.00 cop table:t2, partition:p1, keep order:false, stats:pseudo +│ ├─IndexScan_21 250.00 cop[tikv] table:t2, partition:p1, index:b, range:(0,5), keep order:false, stats:pseudo +│ └─TableScan_22 250.00 cop[tikv] table:t2, partition:p1, keep order:false, stats:pseudo ├─IndexLookUp_29 250.00 root -│ ├─IndexScan_27 250.00 cop table:t2, partition:p2, index:b, range:(0,5), keep order:false, stats:pseudo -│ └─TableScan_28 250.00 cop table:t2, partition:p2, keep order:false, stats:pseudo +│ ├─IndexScan_27 250.00 cop[tikv] table:t2, partition:p2, index:b, range:(0,5), keep order:false, stats:pseudo +│ └─TableScan_28 250.00 cop[tikv] table:t2, partition:p2, keep order:false, stats:pseudo ├─IndexLookUp_35 250.00 root -│ ├─IndexScan_33 250.00 cop table:t2, partition:p3, index:b, range:(0,5), keep order:false, stats:pseudo -│ └─TableScan_34 250.00 cop table:t2, partition:p3, keep order:false, stats:pseudo +│ ├─IndexScan_33 250.00 cop[tikv] table:t2, partition:p3, index:b, range:(0,5), keep order:false, stats:pseudo +│ └─TableScan_34 250.00 cop[tikv] table:t2, partition:p3, keep order:false, stats:pseudo └─IndexLookUp_41 250.00 root - ├─IndexScan_39 250.00 cop table:t2, partition:p4, index:b, range:(0,5), keep order:false, stats:pseudo - └─TableScan_40 250.00 cop table:t2, partition:p4, keep order:false, stats:pseudo + ├─IndexScan_39 250.00 cop[tikv] table:t2, partition:p4, index:b, range:(0,5), keep order:false, stats:pseudo + └─TableScan_40 250.00 cop[tikv] table:t2, partition:p4, keep order:false, stats:pseudo flush status; update t2 set a = 111 where b = 10; show status like 'Handler_read_rnd_next'; @@ -4012,7 +4012,7 @@ id count task operator info Union_8 10001.00 root ├─Projection_9 10000.00 root 1 │ └─TableReader_11 10000.00 root data:TableScan_10 -│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─Projection_12 1.00 root 2 └─TableDual_13 1.00 root rows:1 drop table t1; @@ -4033,23 +4033,23 @@ insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); explain select * from t1 where a=0; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 0) - └─TableScan_6 10000.00 cop table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 0) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a=0; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 0) - └─TableScan_6 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 0) + └─TableScan_6 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a=0xFE; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 254) - └─TableScan_6 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 254) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a=0xFE; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, 254) - └─TableScan_6 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, 254) + └─TableScan_6 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a > 0xFE AND a <= 0xFF; id count task operator info TableDual_6 0.00 root rows:0 @@ -4057,69 +4057,69 @@ explain select * from t2 where a > 0xFE AND a <= 0xFF; id count task operator info Union_9 750.00 root ├─TableReader_12 250.00 root data:Selection_11 -│ └─Selection_11 250.00 cop gt(Column#1, 254), le(Column#1, 255) -│ └─TableScan_10 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 250.00 cop[tikv] gt(Column#1, 254), le(Column#1, 255) +│ └─TableScan_10 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 250.00 root data:Selection_14 -│ └─Selection_14 250.00 cop gt(Column#1, 254), le(Column#1, 255) -│ └─TableScan_13 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 250.00 cop[tikv] gt(Column#1, 254), le(Column#1, 255) +│ └─TableScan_13 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 250.00 root data:Selection_17 - └─Selection_17 250.00 cop gt(Column#1, 254), le(Column#1, 255) - └─TableScan_16 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 250.00 cop[tikv] gt(Column#1, 254), le(Column#1, 255) + └─TableScan_16 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a >= 0xFE AND a <= 0xFF; id count task operator info TableReader_8 250.00 root data:Selection_7 -└─Selection_7 250.00 cop ge(Column#1, 254), le(Column#1, 255) - └─TableScan_6 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 250.00 cop[tikv] ge(Column#1, 254), le(Column#1, 255) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a >= 0xFE AND a <= 0xFF; id count task operator info Union_9 750.00 root ├─TableReader_12 250.00 root data:Selection_11 -│ └─Selection_11 250.00 cop ge(Column#1, 254), le(Column#1, 255) -│ └─TableScan_10 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 250.00 cop[tikv] ge(Column#1, 254), le(Column#1, 255) +│ └─TableScan_10 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 250.00 root data:Selection_14 -│ └─Selection_14 250.00 cop ge(Column#1, 254), le(Column#1, 255) -│ └─TableScan_13 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 250.00 cop[tikv] ge(Column#1, 254), le(Column#1, 255) +│ └─TableScan_13 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 250.00 root data:Selection_17 - └─Selection_17 250.00 cop ge(Column#1, 254), le(Column#1, 255) - └─TableScan_16 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 250.00 cop[tikv] ge(Column#1, 254), le(Column#1, 255) + └─TableScan_16 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a < 64 AND a >= 63; id count task operator info TableReader_8 250.00 root data:Selection_7 -└─Selection_7 250.00 cop ge(Column#1, 63), lt(Column#1, 64) - └─TableScan_6 10000.00 cop table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 250.00 cop[tikv] ge(Column#1, 63), lt(Column#1, 64) + └─TableScan_6 10000.00 cop[tikv] table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a < 64 AND a >= 63; id count task operator info Union_9 750.00 root ├─TableReader_12 250.00 root data:Selection_11 -│ └─Selection_11 250.00 cop ge(Column#1, 63), lt(Column#1, 64) -│ └─TableScan_10 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 250.00 cop[tikv] ge(Column#1, 63), lt(Column#1, 64) +│ └─TableScan_10 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 250.00 root data:Selection_14 -│ └─Selection_14 250.00 cop ge(Column#1, 63), lt(Column#1, 64) -│ └─TableScan_13 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 250.00 cop[tikv] ge(Column#1, 63), lt(Column#1, 64) +│ └─TableScan_13 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 250.00 root data:Selection_17 - └─Selection_17 250.00 cop ge(Column#1, 63), lt(Column#1, 64) - └─TableScan_16 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 250.00 cop[tikv] ge(Column#1, 63), lt(Column#1, 64) + └─TableScan_16 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a <= 64 AND a >= 63; id count task operator info Union_8 500.00 root ├─TableReader_11 250.00 root data:Selection_10 -│ └─Selection_10 250.00 cop ge(Column#1, 63), le(Column#1, 64) -│ └─TableScan_9 10000.00 cop table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 250.00 cop[tikv] ge(Column#1, 63), le(Column#1, 64) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 250.00 root data:Selection_13 - └─Selection_13 250.00 cop ge(Column#1, 63), le(Column#1, 64) - └─TableScan_12 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 250.00 cop[tikv] ge(Column#1, 63), le(Column#1, 64) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t2 where a <= 64 AND a >= 63; id count task operator info Union_9 750.00 root ├─TableReader_12 250.00 root data:Selection_11 -│ └─Selection_11 250.00 cop ge(Column#1, 63), le(Column#1, 64) -│ └─TableScan_10 10000.00 cop table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 250.00 cop[tikv] ge(Column#1, 63), le(Column#1, 64) +│ └─TableScan_10 10000.00 cop[tikv] table:t2, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 250.00 root data:Selection_14 -│ └─Selection_14 250.00 cop ge(Column#1, 63), le(Column#1, 64) -│ └─TableScan_13 10000.00 cop table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 250.00 cop[tikv] ge(Column#1, 63), le(Column#1, 64) +│ └─TableScan_13 10000.00 cop[tikv] table:t2, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 250.00 root data:Selection_17 - └─Selection_17 250.00 cop ge(Column#1, 63), le(Column#1, 64) - └─TableScan_16 10000.00 cop table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 250.00 cop[tikv] ge(Column#1, 63), le(Column#1, 64) + └─TableScan_16 10000.00 cop[tikv] table:t2, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo drop table t1; drop table t2; create table t1(a bigint unsigned not null) partition by range(a+0) ( @@ -4135,48 +4135,48 @@ a >= 2305561538531885056-10 and a <= 2305561538531885056-8; id count task operator info Union_10 1000.00 root ├─TableReader_13 250.00 root data:Selection_12 -│ └─Selection_12 250.00 cop ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) -│ └─TableScan_11 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 250.00 cop[tikv] ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 250.00 root data:Selection_15 -│ └─Selection_15 250.00 cop ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) -│ └─TableScan_14 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 250.00 cop[tikv] ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 250.00 root data:Selection_18 -│ └─Selection_18 250.00 cop ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) -│ └─TableScan_17 10000.00 cop table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 250.00 cop[tikv] ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 250.00 root data:Selection_21 - └─Selection_21 250.00 cop ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) - └─TableScan_20 10000.00 cop table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 250.00 cop[tikv] ge(Column#1, 2305561538531885046), le(Column#1, 2305561538531885048) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a > 0xFFFFFFFFFFFFFFEC and a < 0xFFFFFFFFFFFFFFEE; id count task operator info Union_10 1000.00 root ├─TableReader_13 250.00 root data:Selection_12 -│ └─Selection_12 250.00 cop gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) -│ └─TableScan_11 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 250.00 cop[tikv] gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 250.00 root data:Selection_15 -│ └─Selection_15 250.00 cop gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) -│ └─TableScan_14 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 250.00 cop[tikv] gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 250.00 root data:Selection_18 -│ └─Selection_18 250.00 cop gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) -│ └─TableScan_17 10000.00 cop table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 250.00 cop[tikv] gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 250.00 root data:Selection_21 - └─Selection_21 250.00 cop gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) - └─TableScan_20 10000.00 cop table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 250.00 cop[tikv] gt(Column#1, 18446744073709551596), lt(Column#1, 18446744073709551598) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a>=0 and a <= 0xFFFFFFFFFFFFFFFF; id count task operator info Union_10 1000.00 root ├─TableReader_13 250.00 root data:Selection_12 -│ └─Selection_12 250.00 cop ge(Column#1, 0), le(Column#1, 18446744073709551615) -│ └─TableScan_11 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 250.00 cop[tikv] ge(Column#1, 0), le(Column#1, 18446744073709551615) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 250.00 root data:Selection_15 -│ └─Selection_15 250.00 cop ge(Column#1, 0), le(Column#1, 18446744073709551615) -│ └─TableScan_14 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 250.00 cop[tikv] ge(Column#1, 0), le(Column#1, 18446744073709551615) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 250.00 root data:Selection_18 -│ └─Selection_18 250.00 cop ge(Column#1, 0), le(Column#1, 18446744073709551615) -│ └─TableScan_17 10000.00 cop table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 250.00 cop[tikv] ge(Column#1, 0), le(Column#1, 18446744073709551615) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 250.00 root data:Selection_21 - └─Selection_21 250.00 cop ge(Column#1, 0), le(Column#1, 18446744073709551615) - └─TableScan_20 10000.00 cop table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 250.00 cop[tikv] ge(Column#1, 0), le(Column#1, 18446744073709551615) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo drop table t1; create table t1 (a bigint) partition by range(a+0) ( partition p1 values less than (-1000), @@ -4189,17 +4189,17 @@ explain select * from t1 where a>-2 and a <=0; id count task operator info Union_10 1000.00 root ├─TableReader_13 250.00 root data:Selection_12 -│ └─Selection_12 250.00 cop gt(Column#1, -2), le(Column#1, 0) -│ └─TableScan_11 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 250.00 cop[tikv] gt(Column#1, -2), le(Column#1, 0) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_16 250.00 root data:Selection_15 -│ └─Selection_15 250.00 cop gt(Column#1, -2), le(Column#1, 0) -│ └─TableScan_14 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 250.00 cop[tikv] gt(Column#1, -2), le(Column#1, 0) +│ └─TableScan_14 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_19 250.00 root data:Selection_18 -│ └─Selection_18 250.00 cop gt(Column#1, -2), le(Column#1, 0) -│ └─TableScan_17 10000.00 cop table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_18 250.00 cop[tikv] gt(Column#1, -2), le(Column#1, 0) +│ └─TableScan_17 10000.00 cop[tikv] table:t1, partition:p3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 250.00 root data:Selection_21 - └─Selection_21 250.00 cop gt(Column#1, -2), le(Column#1, 0) - └─TableScan_20 10000.00 cop table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 250.00 cop[tikv] gt(Column#1, -2), le(Column#1, 0) + └─TableScan_20 10000.00 cop[tikv] table:t1, partition:p4, range:[-inf,+inf], keep order:false, stats:pseudo drop table t1; CREATE TABLE t1 ( recdate DATETIME NOT NULL ) PARTITION BY RANGE( TO_DAYS(recdate) ) ( @@ -4214,11 +4214,11 @@ explain select * from t1 where recdate < '2007-03-08 00:00:00'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#1, 2007-03-08 00:00:00.000000) -│ └─TableScan_9 10000.00 cop table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#1, 2007-03-08 00:00:00.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#1, 2007-03-08 00:00:00.000000) - └─TableScan_12 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#1, 2007-03-08 00:00:00.000000) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo drop table t1; CREATE TABLE t1 ( recdate DATETIME NOT NULL ) PARTITION BY RANGE( YEAR(recdate) ) ( @@ -4233,11 +4233,11 @@ explain select * from t1 where recdate < '2006-01-01 00:00:00'; id count task operator info Union_8 6646.67 root ├─TableReader_11 3323.33 root data:Selection_10 -│ └─Selection_10 3323.33 cop lt(Column#1, 2006-01-01 00:00:00.000000) -│ └─TableScan_9 10000.00 cop table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 3323.33 cop[tikv] lt(Column#1, 2006-01-01 00:00:00.000000) +│ └─TableScan_9 10000.00 cop[tikv] table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 3323.33 root data:Selection_13 - └─Selection_13 3323.33 cop lt(Column#1, 2006-01-01 00:00:00.000000) - └─TableScan_12 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 3323.33 cop[tikv] lt(Column#1, 2006-01-01 00:00:00.000000) + └─TableScan_12 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo drop table t1; create table t0 (a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); @@ -4252,26 +4252,26 @@ explain select * from t1 where a between 10 and 13; id count task operator info Union_9 750.00 root ├─TableReader_12 250.00 root data:Selection_11 -│ └─Selection_11 250.00 cop ge(Column#1, 10), le(Column#1, 13) -│ └─TableScan_10 10000.00 cop table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 250.00 cop[tikv] ge(Column#1, 10), le(Column#1, 13) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 250.00 root data:Selection_14 -│ └─Selection_14 250.00 cop ge(Column#1, 10), le(Column#1, 13) -│ └─TableScan_13 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 250.00 cop[tikv] ge(Column#1, 10), le(Column#1, 13) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 250.00 root data:Selection_17 - └─Selection_17 250.00 cop ge(Column#1, 10), le(Column#1, 13) - └─TableScan_16 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 250.00 cop[tikv] ge(Column#1, 10), le(Column#1, 13) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo explain select * from t1 where a between 10 and 10+33; id count task operator info Union_9 750.00 root ├─TableReader_12 250.00 root data:Selection_11 -│ └─Selection_11 250.00 cop ge(Column#1, 10), le(Column#1, 43) -│ └─TableScan_10 10000.00 cop table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_11 250.00 cop[tikv] ge(Column#1, 10), le(Column#1, 43) +│ └─TableScan_10 10000.00 cop[tikv] table:t1, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_15 250.00 root data:Selection_14 -│ └─Selection_14 250.00 cop ge(Column#1, 10), le(Column#1, 43) -│ └─TableScan_13 10000.00 cop table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_14 250.00 cop[tikv] ge(Column#1, 10), le(Column#1, 43) +│ └─TableScan_13 10000.00 cop[tikv] table:t1, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_18 250.00 root data:Selection_17 - └─Selection_17 250.00 cop ge(Column#1, 10), le(Column#1, 43) - └─TableScan_16 10000.00 cop table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_17 250.00 cop[tikv] ge(Column#1, 10), le(Column#1, 43) + └─TableScan_16 10000.00 cop[tikv] table:t1, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo drop table t0, t1; drop table if exists t; create table t(a timestamp) partition by range(unix_timestamp(a)) (partition p0 values less than(unix_timestamp('2019-02-16 14:20:00')), partition p1 values less than (maxvalue)); @@ -4279,8 +4279,8 @@ explain select * from t where a between timestamp'2019-02-16 14:19:00' and times id count task operator info Union_8 500.00 root ├─TableReader_11 250.00 root data:Selection_10 -│ └─Selection_10 250.00 cop ge(Column#1, 2019-02-16 14:19:00), le(Column#1, 2019-02-16 14:21:00) -│ └─TableScan_9 10000.00 cop table:t, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_10 250.00 cop[tikv] ge(Column#1, 2019-02-16 14:19:00), le(Column#1, 2019-02-16 14:21:00) +│ └─TableScan_9 10000.00 cop[tikv] table:t, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 250.00 root data:Selection_13 - └─Selection_13 250.00 cop ge(Column#1, 2019-02-16 14:19:00), le(Column#1, 2019-02-16 14:21:00) - └─TableScan_12 10000.00 cop table:t, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_13 250.00 cop[tikv] ge(Column#1, 2019-02-16 14:19:00), le(Column#1, 2019-02-16 14:21:00) + └─TableScan_12 10000.00 cop[tikv] table:t, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/select.result b/cmd/explaintest/r/select.result index 5a48a8a8ee655..06a403678bad8 100644 --- a/cmd/explaintest/r/select.result +++ b/cmd/explaintest/r/select.result @@ -243,8 +243,8 @@ explain select a, c from t1 use index(idx) order by a limit 5; id count task operator info TopN_7 5.00 root Column#1:asc, offset:0, count:5 └─IndexReader_15 5.00 root index:TopN_14 - └─TopN_14 5.00 cop Column#1:asc, offset:0, count:5 - └─IndexScan_13 10000.00 cop table:t1, index:b, c, range:[NULL,+inf], keep order:false, stats:pseudo + └─TopN_14 5.00 cop[tikv] Column#1:asc, offset:0, count:5 + └─IndexScan_13 10000.00 cop[tikv] table:t1, index:b, c, range:[NULL,+inf], keep order:false, stats:pseudo select c, a from t1 use index(idx) order by a limit 5; c a 3 1 @@ -258,8 +258,8 @@ explain select count(a) from t; id count task operator info StreamAgg_20 1.00 root funcs:count(Column#8) └─IndexReader_21 1.00 root index:StreamAgg_8 - └─StreamAgg_8 1.00 cop funcs:count(Column#1) - └─IndexScan_19 10000.00 cop table:t, index:a, b, c, range:[NULL,+inf], keep order:false, stats:pseudo + └─StreamAgg_8 1.00 cop[tikv] funcs:count(Column#1) + └─IndexScan_19 10000.00 cop[tikv] table:t, index:a, b, c, range:[NULL,+inf], keep order:false, stats:pseudo select count(a) from t; count(a) 0 @@ -269,8 +269,8 @@ id count task operator info HashAgg_7 8000.00 root group by:Column#2, funcs:firstrow(Column#2) └─StreamAgg_22 8000.00 root group by:Column#9, funcs:firstrow(Column#8) └─IndexReader_23 8000.00 root index:StreamAgg_11 - └─StreamAgg_11 8000.00 cop group by:Column#1, funcs:firstrow(Column#2) - └─IndexScan_21 10000.00 cop table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo + └─StreamAgg_11 8000.00 cop[tikv] group by:Column#1, funcs:firstrow(Column#2) + └─IndexScan_21 10000.00 cop[tikv] table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo select distinct b from t group by a; b 0 @@ -278,8 +278,8 @@ explain select count(b) from t group by a; id count task operator info StreamAgg_19 8000.00 root group by:Column#10, funcs:count(Column#9) └─IndexReader_20 8000.00 root index:StreamAgg_8 - └─StreamAgg_8 8000.00 cop group by:Column#1, funcs:count(Column#2) - └─IndexScan_18 10000.00 cop table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo + └─StreamAgg_8 8000.00 cop[tikv] group by:Column#1, funcs:count(Column#2) + └─IndexScan_18 10000.00 cop[tikv] table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo select count(b) from t group by a; count(b) 1 @@ -288,9 +288,9 @@ explain select count(a) from t where b>0 group by a, b; id count task operator info StreamAgg_25 2666.67 root group by:Column#11, Column#12, funcs:count(Column#10) └─IndexReader_26 2666.67 root index:StreamAgg_9 - └─StreamAgg_9 2666.67 cop group by:Column#1, Column#2, funcs:count(Column#1) - └─Selection_24 3333.33 cop gt(Column#2, 0) - └─IndexScan_23 10000.00 cop table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo + └─StreamAgg_9 2666.67 cop[tikv] group by:Column#1, Column#2, funcs:count(Column#1) + └─Selection_24 3333.33 cop[tikv] gt(Column#2, 0) + └─IndexScan_23 10000.00 cop[tikv] table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo select count(a) from t where b>0 group by a, b; count(a) 3 @@ -302,9 +302,9 @@ id count task operator info Projection_7 2666.67 root Column#5 └─StreamAgg_36 2666.67 root group by:Column#19, Column#20, funcs:count(Column#17), firstrow(Column#19) └─IndexReader_37 2666.67 root index:StreamAgg_34 - └─StreamAgg_34 2666.67 cop group by:Column#1, Column#2, funcs:count(Column#1) - └─Selection_28 3333.33 cop gt(Column#2, 0) - └─IndexScan_27 10000.00 cop table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo + └─StreamAgg_34 2666.67 cop[tikv] group by:Column#1, Column#2, funcs:count(Column#1) + └─Selection_28 3333.33 cop[tikv] gt(Column#2, 0) + └─IndexScan_27 10000.00 cop[tikv] table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo select count(a) from t where b>0 group by a, b order by a; count(a) 3 @@ -317,9 +317,9 @@ Projection_9 1.00 root Column#5 └─Limit_15 1.00 root offset:0, count:1 └─StreamAgg_44 1.00 root group by:Column#19, Column#20, funcs:count(Column#17), firstrow(Column#19) └─IndexReader_45 1.00 root index:StreamAgg_40 - └─StreamAgg_40 1.00 cop group by:Column#1, Column#2, funcs:count(Column#1) - └─Selection_43 1.25 cop gt(Column#2, 0) - └─IndexScan_42 3.75 cop table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo + └─StreamAgg_40 1.00 cop[tikv] group by:Column#1, Column#2, funcs:count(Column#1) + └─Selection_43 1.25 cop[tikv] gt(Column#2, 0) + └─IndexScan_42 3.75 cop[tikv] table:t, index:a, b, c, range:[NULL,+inf], keep order:true, stats:pseudo select count(a) from t where b>0 group by a, b order by a limit 1; count(a) 3 @@ -330,16 +330,16 @@ id count task operator info HashLeftJoin_10 155937656.25 root CARTESIAN left outer join, inner:HashLeftJoin_17, left cond:[eq(Column#6, 1)] ├─HashLeftJoin_11 12487.50 root left outer join, inner:TableReader_16, equal:[eq(Column#2, Column#5)] │ ├─TableReader_13 10000.00 root data:TableScan_12 -│ │ └─TableScan_12 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +│ │ └─TableScan_12 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo │ └─TableReader_16 9990.00 root data:Selection_15 -│ └─Selection_15 9990.00 cop not(isnull(Column#5)) -│ └─TableScan_14 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_15 9990.00 cop[tikv] not(isnull(Column#5)) +│ └─TableScan_14 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo └─HashLeftJoin_17 12487.50 root left outer join, inner:TableReader_22, equal:[eq(Column#8, Column#11)] ├─TableReader_19 10000.00 root data:TableScan_18 - │ └─TableScan_18 10000.00 cop table:t3, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_18 10000.00 cop[tikv] table:t3, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_22 9990.00 root data:Selection_21 - └─Selection_21 9990.00 cop not(isnull(Column#11)) - └─TableScan_20 10000.00 cop table:t4, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_21 9990.00 cop[tikv] not(isnull(Column#11)) + └─TableScan_20 10000.00 cop[tikv] table:t4, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a bigint primary key, b bigint); desc select * from t where a = 1; @@ -360,24 +360,24 @@ insert into th values (-1,-1),(-2,-2),(-3,-3),(-4,-4),(-5,-5),(-6,-6),(-7,-7),(- desc select * from th where a=-2; id count task operator info TableReader_8 10.00 root data:Selection_7 -└─Selection_7 10.00 cop eq(Column#1, -2) - └─TableScan_6 10000.00 cop table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo +└─Selection_7 10.00 cop[tikv] eq(Column#1, -2) + └─TableScan_6 10000.00 cop[tikv] table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo desc select * from th; id count task operator info Union_8 30000.00 root ├─TableReader_10 10000.00 root data:TableScan_9 -│ └─TableScan_9 10000.00 cop table:th, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_9 10000.00 cop[tikv] table:th, partition:p0, range:[-inf,+inf], keep order:false, stats:pseudo ├─TableReader_12 10000.00 root data:TableScan_11 -│ └─TableScan_11 10000.00 cop table:th, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_11 10000.00 cop[tikv] table:th, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_14 10000.00 root data:TableScan_13 - └─TableScan_13 10000.00 cop table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_13 10000.00 cop[tikv] table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo desc select * from th partition (p2,p1); id count task operator info Union_7 20000.00 root ├─TableReader_9 10000.00 root data:TableScan_8 -│ └─TableScan_8 10000.00 cop table:th, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_8 10000.00 cop[tikv] table:th, partition:p1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_11 10000.00 root data:TableScan_10 - └─TableScan_10 10000.00 cop table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_10 10000.00 cop[tikv] table:th, partition:p2, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int, b int); explain select a != any (select a from t t2) from t t1; @@ -385,21 +385,21 @@ id count task operator info Projection_8 10000.00 root and(or(or(gt(Column#9, 1), ne(Column#1, Column#8)), if(ne(Column#10, 0), NULL, 0)), and(ne(Column#11, 0), if(isnull(Column#1), NULL, 1))) └─HashLeftJoin_9 10000.00 root CARTESIAN inner join, inner:StreamAgg_16 ├─TableReader_12 10000.00 root data:TableScan_11 - │ └─TableScan_11 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_11 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─StreamAgg_16 1.00 root funcs:firstrow(Column#0), count(distinct Column#0), sum(Column#0), count(1) └─Projection_26 10000.00 root Column#4, Column#4, cast(isnull(Column#4)) └─TableReader_23 10000.00 root data:TableScan_22 - └─TableScan_22 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_22 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain select a = all (select a from t t2) from t t1; id count task operator info Projection_8 10000.00 root or(and(and(le(Column#9, 1), eq(Column#1, Column#8)), if(ne(Column#10, 0), NULL, 1)), or(eq(Column#11, 0), if(isnull(Column#1), NULL, 0))) └─HashLeftJoin_9 10000.00 root CARTESIAN inner join, inner:StreamAgg_16 ├─TableReader_12 10000.00 root data:TableScan_11 - │ └─TableScan_11 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_11 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─StreamAgg_16 1.00 root funcs:firstrow(Column#0), count(distinct Column#0), sum(Column#0), count(1) └─Projection_26 10000.00 root Column#4, Column#4, cast(isnull(Column#4)) └─TableReader_23 10000.00 root data:TableScan_22 - └─TableScan_22 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_22 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int, b int); drop table if exists s; @@ -410,18 +410,18 @@ Projection_9 10000.00 root Column#8 └─HashLeftJoin_10 10000.00 root left outer semi join, inner:Projection_14, equal:[eq(Column#10, Column#11)], other cond:eq(cast(Column#1), cast(Column#4)) ├─Projection_11 10000.00 root Column#1, Column#2, cast(Column#2) │ └─TableReader_13 10000.00 root data:TableScan_12 - │ └─TableScan_12 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_12 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo └─Projection_14 10000.00 root Column#4, Column#5, cast(Column#5) └─TableReader_16 10000.00 root data:TableScan_15 - └─TableScan_15 10000.00 cop table:s, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_15 10000.00 cop[tikv] table:s, range:[-inf,+inf], keep order:false, stats:pseudo explain select a in (select a+b from t t2 where t2.b = t1.b) from t t1; id count task operator info Projection_7 10000.00 root Column#8 └─HashLeftJoin_8 10000.00 root left outer semi join, inner:TableReader_12, equal:[eq(Column#2, Column#5)], other cond:eq(Column#1, plus(Column#4, Column#5)) ├─TableReader_10 10000.00 root data:TableScan_9 - │ └─TableScan_9 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_9 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_12 10000.00 root data:TableScan_11 - └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo drop table t; create table t(a int not null, b int); explain select a in (select a from t t2 where t2.b = t1.b) from t t1; @@ -429,9 +429,9 @@ id count task operator info Projection_7 10000.00 root Column#8 └─HashLeftJoin_8 10000.00 root left outer semi join, inner:TableReader_12, equal:[eq(Column#2, Column#5) eq(Column#1, Column#4)] ├─TableReader_10 10000.00 root data:TableScan_9 - │ └─TableScan_9 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo + │ └─TableScan_9 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_12 10000.00 root data:TableScan_11 - └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo explain select 1 from (select sleep(1)) t; id count task operator info Projection_4 1.00 root 1 @@ -445,18 +445,18 @@ Projection_8 10000.00 root Column#4 └─Sort_4 10000.00 root Column#5:asc └─Projection_9 10000.00 root Column#4, rand() └─TableReader_7 10000.00 root data:TableScan_6 - └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select a, b from t order by abs(2); id count task operator info TableReader_8 10000.00 root data:TableScan_7 -└─TableScan_7 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo +└─TableScan_7 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select a from t order by abs(rand())+1; id count task operator info Projection_8 10000.00 root Column#4 └─Sort_4 10000.00 root Column#5:asc └─Projection_9 10000.00 root Column#4, plus(abs(rand()), 1) └─TableReader_7 10000.00 root data:TableScan_6 - └─TableScan_6 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t1; create table t1(a int, b int); drop table if exists t2; @@ -465,11 +465,11 @@ explain select * from t1 where t1.a in (select t2.a as a from t2 where t2.b > t1 id count task operator info HashLeftJoin_10 7984.01 root semi join, inner:TableReader_16, equal:[eq(Column#1, Column#4)], other cond:gt(Column#5, Column#2) ├─TableReader_13 9980.01 root data:Selection_12 -│ └─Selection_12 9980.01 cop not(isnull(Column#1)), not(isnull(Column#2)) -│ └─TableScan_11 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_12 9980.01 cop[tikv] not(isnull(Column#1)), not(isnull(Column#2)) +│ └─TableScan_11 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_16 9980.01 root data:Selection_15 - └─Selection_15 9980.01 cop not(isnull(Column#4)), not(isnull(Column#5)) - └─TableScan_14 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Selection_15 9980.01 cop[tikv] not(isnull(Column#4)), not(isnull(Column#5)) + └─TableScan_14 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo drop table t; CREATE TABLE t (id int(10) unsigned NOT NULL AUTO_INCREMENT, i int(10) unsigned DEFAULT NULL, @@ -482,4 +482,4 @@ Projection_7 10000.00 root minus(Column#7, Column#3) └─Window_8 10000.00 root row_number() over(partition by Column#2) └─Sort_11 10000.00 root Column#2:asc └─TableReader_10 10000.00 root data:TableScan_9 - └─TableScan_9 10000.00 cop table:t, range:[0,+inf], keep order:false, stats:pseudo + └─TableScan_9 10000.00 cop[tikv] table:t, range:[0,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/subquery.result b/cmd/explaintest/r/subquery.result index 17b22116af423..120d66e915b56 100644 --- a/cmd/explaintest/r/subquery.result +++ b/cmd/explaintest/r/subquery.result @@ -8,9 +8,9 @@ explain select * from t1 where t1.a in (select t1.b + t2.b from t2); id count task operator info HashLeftJoin_8 8000.00 root CARTESIAN semi join, inner:TableReader_12, other cond:eq(Column#1, plus(Column#2, Column#5)) ├─TableReader_10 10000.00 root data:TableScan_9 -│ └─TableScan_9 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─TableScan_9 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─TableReader_12 10000.00 root data:TableScan_11 - └─TableScan_11 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_11 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int primary key, b int, c int, d int, index idx(b,c,d)); insert into t values(1,1,1,1),(2,2,2,2),(3,2,2,2),(4,2,2,2),(5,2,2,2); @@ -20,10 +20,10 @@ id count task operator info Projection_11 5.00 root Column#15 └─Apply_13 5.00 root CARTESIAN left outer semi join, inner:StreamAgg_22, other cond:eq(Column#3, Column#13) ├─TableReader_15 5.00 root data:TableScan_14 - │ └─TableScan_14 5.00 cop table:t, range:[-inf,+inf], keep order:false + │ └─TableScan_14 5.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false └─StreamAgg_22 1.00 root funcs:count(1) └─IndexMergeJoin_29 0.50 root inner join, inner:TableReader_27, outer key:Column#5, inner key:Column#9 ├─IndexReader_35 1.00 root index:IndexScan_34 - │ └─IndexScan_34 1.00 cop table:s, index:b, c, d, range: decided by [eq(Column#6, 1) eq(Column#7, 1) eq(Column#8, Column#1)], keep order:false + │ └─IndexScan_34 1.00 cop[tikv] table:s, index:b, c, d, range: decided by [eq(Column#6, 1) eq(Column#7, 1) eq(Column#8, Column#1)], keep order:false └─TableReader_27 1.00 root data:TableScan_26 - └─TableScan_26 1.00 cop table:t1, range: decided by [Column#5], keep order:true + └─TableScan_26 1.00 cop[tikv] table:t1, range: decided by [Column#5], keep order:true diff --git a/cmd/explaintest/r/topn_push_down.result b/cmd/explaintest/r/topn_push_down.result index efe1cb54853de..71d7061e001e8 100644 --- a/cmd/explaintest/r/topn_push_down.result +++ b/cmd/explaintest/r/topn_push_down.result @@ -173,17 +173,17 @@ Projection_13 0.00 root Column#47 ├─TopN_110 0.00 root Column#47:asc, offset:0, count:5 │ └─IndexMergeJoin_49 0.00 root inner join, inner:IndexLookUp_47, outer key:Column#1, inner key:Column#41 │ ├─IndexLookUp_85 0.00 root - │ │ ├─Selection_83 0.00 cop eq(Column#4, 18), eq(Column#5, 1) - │ │ │ └─IndexScan_81 10.00 cop table:tr, index:shop_identy, trade_status, business_type, trade_pay_status, trade_type, delivery_type, source, biz_date, range:[810094178,810094178], keep order:false, stats:pseudo - │ │ └─Selection_84 0.00 cop eq(Column#21, 32314), eq(Column#3, 2) - │ │ └─TableScan_82 0.00 cop table:tr, keep order:false, stats:pseudo + │ │ ├─Selection_83 0.00 cop[tikv] eq(Column#4, 18), eq(Column#5, 1) + │ │ │ └─IndexScan_81 10.00 cop[tikv] table:tr, index:shop_identy, trade_status, business_type, trade_pay_status, trade_type, delivery_type, source, biz_date, range:[810094178,810094178], keep order:false, stats:pseudo + │ │ └─Selection_84 0.00 cop[tikv] eq(Column#21, 32314), eq(Column#3, 2) + │ │ └─TableScan_82 0.00 cop[tikv] table:tr, keep order:false, stats:pseudo │ └─IndexLookUp_47 0.03 root - │ ├─IndexScan_44 1.25 cop table:te, index:trade_id, range: decided by [eq(Column#41, Column#1)], keep order:true, stats:pseudo - │ └─Selection_46 0.03 cop ge(Column#47, 2018-04-23 00:00:00.000000), le(Column#47, 2018-04-23 23:59:59.000000) - │ └─TableScan_45 1.25 cop table:te, keep order:false, stats:pseudo + │ ├─IndexScan_44 1.25 cop[tikv] table:te, index:trade_id, range: decided by [eq(Column#41, Column#1)], keep order:true, stats:pseudo + │ └─Selection_46 0.03 cop[tikv] ge(Column#47, 2018-04-23 00:00:00.000000), le(Column#47, 2018-04-23 23:59:59.000000) + │ └─TableScan_45 1.25 cop[tikv] table:te, keep order:false, stats:pseudo └─IndexReader_102 1.25 root index:Selection_101 - └─Selection_101 1.25 cop not(isnull(Column#97)) - └─IndexScan_100 1.25 cop table:p, index:relate_id, range: decided by [eq(Column#97, Column#1)], keep order:false, stats:pseudo + └─Selection_101 1.25 cop[tikv] not(isnull(Column#97)) + └─IndexScan_100 1.25 cop[tikv] table:p, index:relate_id, range: decided by [eq(Column#97, Column#1)], keep order:false, stats:pseudo desc select 1 as a from dual order by a limit 1; id count task operator info Projection_6 1.00 root 1 @@ -196,27 +196,27 @@ desc select * from t1 where t1.a in (select t2.a as a from t2 where t2.b > t1.b id count task operator info Apply_15 9990.00 root semi join, inner:Selection_19, equal:[eq(Column#1, Column#4)] ├─TableReader_18 9990.00 root data:Selection_17 -│ └─Selection_17 9990.00 cop not(isnull(Column#1)) -│ └─TableScan_16 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_17 9990.00 cop[tikv] not(isnull(Column#1)) +│ └─TableScan_16 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─Selection_19 0.80 root not(isnull(Column#4)) └─Limit_20 1.00 root offset:0, count:1 └─TableReader_26 1.00 root data:Limit_25 - └─Limit_25 1.00 cop offset:0, count:1 - └─Selection_24 1.00 cop gt(Column#5, Column#2) - └─TableScan_23 1.25 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Limit_25 1.00 cop[tikv] offset:0, count:1 + └─Selection_24 1.00 cop[tikv] gt(Column#5, Column#2) + └─TableScan_23 1.25 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo desc select * from t1 where t1.a in (select a from (select t2.a as a, t1.b as b from t2 where t2.b > t1.b) x order by b limit 1); id count task operator info Apply_17 9990.00 root semi join, inner:Selection_21, equal:[eq(Column#1, Column#9)] ├─TableReader_20 9990.00 root data:Selection_19 -│ └─Selection_19 9990.00 cop not(isnull(Column#1)) -│ └─TableScan_18 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo +│ └─Selection_19 9990.00 cop[tikv] not(isnull(Column#1)) +│ └─TableScan_18 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo └─Selection_21 0.80 root not(isnull(Column#9)) └─Projection_22 1.00 root Column#4, Column#2 └─Limit_23 1.00 root offset:0, count:1 └─TableReader_29 1.00 root data:Limit_28 - └─Limit_28 1.00 cop offset:0, count:1 - └─Selection_27 1.00 cop gt(Column#5, Column#2) - └─TableScan_26 1.25 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo + └─Limit_28 1.00 cop[tikv] offset:0, count:1 + └─Selection_27 1.00 cop[tikv] gt(Column#5, Column#2) + └─TableScan_26 1.25 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo drop table if exists t; create table t(a int not null, index idx(a)); explain select /*+ TIDB_INLJ(t2) */ * from t t1 join t t2 on t1.a = t2.a limit 5; @@ -224,49 +224,49 @@ id count task operator info Limit_11 5.00 root offset:0, count:5 └─IndexMergeJoin_19 5.00 root inner join, inner:IndexReader_17, outer key:Column#1, inner key:Column#3 ├─IndexReader_25 4.00 root index:IndexScan_24 - │ └─IndexScan_24 4.00 cop table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_24 4.00 cop[tikv] table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_17 1.25 root index:IndexScan_16 - └─IndexScan_16 1.25 cop table:t2, index:a, range: decided by [eq(Column#3, Column#1)], keep order:true, stats:pseudo + └─IndexScan_16 1.25 cop[tikv] table:t2, index:a, range: decided by [eq(Column#3, Column#1)], keep order:true, stats:pseudo explain select /*+ TIDB_INLJ(t2) */ * from t t1 left join t t2 on t1.a = t2.a where t2.a is null limit 5; id count task operator info Limit_12 5.00 root offset:0, count:5 └─Selection_13 5.00 root isnull(Column#3) └─IndexMergeJoin_21 5.00 root left outer join, inner:IndexReader_19, outer key:Column#1, inner key:Column#3 ├─IndexReader_27 4.00 root index:IndexScan_26 - │ └─IndexScan_26 4.00 cop table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_26 4.00 cop[tikv] table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_19 1.25 root index:IndexScan_18 - └─IndexScan_18 1.25 cop table:t2, index:a, range: decided by [eq(Column#3, Column#1)], keep order:true, stats:pseudo + └─IndexScan_18 1.25 cop[tikv] table:t2, index:a, range: decided by [eq(Column#3, Column#1)], keep order:true, stats:pseudo explain select /*+ TIDB_SMJ(t1, t2) */ * from t t1 join t t2 on t1.a = t2.a limit 5; id count task operator info Limit_11 5.00 root offset:0, count:5 └─MergeJoin_12 5.00 root inner join, left key:Column#1, right key:Column#3 ├─IndexReader_15 4.00 root index:IndexScan_14 - │ └─IndexScan_14 4.00 cop table:t1, index:a, range:[NULL,+inf], keep order:true, stats:pseudo + │ └─IndexScan_14 4.00 cop[tikv] table:t1, index:a, range:[NULL,+inf], keep order:true, stats:pseudo └─IndexReader_17 4.00 root index:IndexScan_16 - └─IndexScan_16 4.00 cop table:t2, index:a, range:[NULL,+inf], keep order:true, stats:pseudo + └─IndexScan_16 4.00 cop[tikv] table:t2, index:a, range:[NULL,+inf], keep order:true, stats:pseudo explain select /*+ TIDB_SMJ(t1, t2) */ * from t t1 left join t t2 on t1.a = t2.a where t2.a is null limit 5; id count task operator info Limit_12 5.00 root offset:0, count:5 └─Selection_13 5.00 root isnull(Column#3) └─MergeJoin_14 5.00 root left outer join, left key:Column#1, right key:Column#3 ├─IndexReader_17 4.00 root index:IndexScan_16 - │ └─IndexScan_16 4.00 cop table:t1, index:a, range:[NULL,+inf], keep order:true, stats:pseudo + │ └─IndexScan_16 4.00 cop[tikv] table:t1, index:a, range:[NULL,+inf], keep order:true, stats:pseudo └─IndexReader_19 4.00 root index:IndexScan_18 - └─IndexScan_18 4.00 cop table:t2, index:a, range:[NULL,+inf], keep order:true, stats:pseudo + └─IndexScan_18 4.00 cop[tikv] table:t2, index:a, range:[NULL,+inf], keep order:true, stats:pseudo explain select /*+ TIDB_HJ(t1, t2) */ * from t t1 join t t2 on t1.a = t2.a limit 5; id count task operator info Limit_11 5.00 root offset:0, count:5 └─HashLeftJoin_31 5.00 root inner join, inner:IndexReader_40, equal:[eq(Column#1, Column#3)] ├─IndexReader_36 4.00 root index:IndexScan_35 - │ └─IndexScan_35 4.00 cop table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_35 4.00 cop[tikv] table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_40 10000.00 root index:IndexScan_39 - └─IndexScan_39 10000.00 cop table:t2, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + └─IndexScan_39 10000.00 cop[tikv] table:t2, index:a, range:[NULL,+inf], keep order:false, stats:pseudo explain select /*+ TIDB_HJ(t1, t2) */ * from t t1 left join t t2 on t1.a = t2.a where t2.a is null limit 5; id count task operator info Limit_12 5.00 root offset:0, count:5 └─Selection_13 5.00 root isnull(Column#3) └─HashLeftJoin_24 5.00 root left outer join, inner:IndexReader_32, equal:[eq(Column#1, Column#3)] ├─IndexReader_28 4.00 root index:IndexScan_27 - │ └─IndexScan_27 4.00 cop table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + │ └─IndexScan_27 4.00 cop[tikv] table:t1, index:a, range:[NULL,+inf], keep order:false, stats:pseudo └─IndexReader_32 10000.00 root index:IndexScan_31 - └─IndexScan_31 10000.00 cop table:t2, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + └─IndexScan_31 10000.00 cop[tikv] table:t2, index:a, range:[NULL,+inf], keep order:false, stats:pseudo diff --git a/cmd/explaintest/r/tpch.result b/cmd/explaintest/r/tpch.result index 694a4c8bd3df1..9505342bf4ed0 100644 --- a/cmd/explaintest/r/tpch.result +++ b/cmd/explaintest/r/tpch.result @@ -123,9 +123,9 @@ Sort_6 2.94 root Column#26:asc, Column#27:asc └─Projection_8 2.94 root Column#9, Column#10, Column#18, Column#19, Column#20, Column#21, Column#22, Column#23, Column#24, Column#25 └─HashAgg_14 2.94 root group by:Column#49, Column#50, funcs:sum(Column#36), sum(Column#37), sum(Column#38), sum(Column#39), avg(Column#40, Column#41), avg(Column#42, Column#43), avg(Column#44, Column#45), count(Column#46), firstrow(Column#49), firstrow(Column#50) └─TableReader_15 2.94 root data:HashAgg_9 - └─HashAgg_9 2.94 cop group by:Column#10, Column#9, funcs:sum(Column#5), sum(Column#6), sum(mul(Column#6, minus(1, Column#7))), sum(mul(mul(Column#6, minus(1, Column#7)), plus(1, Column#8))), count(Column#5), sum(Column#5), count(Column#6), sum(Column#6), count(Column#7), sum(Column#7), count(1) - └─Selection_13 293795345.00 cop le(Column#11, 1998-08-15) - └─TableScan_12 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + └─HashAgg_9 2.94 cop[tikv] group by:Column#10, Column#9, funcs:sum(Column#5), sum(Column#6), sum(mul(Column#6, minus(1, Column#7))), sum(mul(mul(Column#6, minus(1, Column#7)), plus(1, Column#8))), count(Column#5), sum(Column#5), count(Column#6), sum(Column#6), count(Column#7), sum(Column#7), count(1) + └─Selection_13 293795345.00 cop[tikv] le(Column#11, 1998-08-15) + └─TableScan_12 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false /* Q2 Minimum Cost Supplier Query This query finds which supplier should be selected to place an order for a given part in a given region. @@ -190,31 +190,31 @@ Projection_37 100.00 root Column#15, Column#11, Column#24, Column#1, Column#3, C │ │ ├─HashRightJoin_63 100000.00 root inner join, inner:HashRightJoin_76, equal:[eq(Column#23, Column#13)] │ │ │ ├─HashRightJoin_76 5.00 root inner join, inner:TableReader_81, equal:[eq(Column#27, Column#25)] │ │ │ │ ├─TableReader_81 1.00 root data:Selection_80 - │ │ │ │ │ └─Selection_80 1.00 cop eq(Column#28, "ASIA") - │ │ │ │ │ └─TableScan_79 5.00 cop table:region, range:[-inf,+inf], keep order:false + │ │ │ │ │ └─Selection_80 1.00 cop[tikv] eq(Column#28, "ASIA") + │ │ │ │ │ └─TableScan_79 5.00 cop[tikv] table:region, range:[-inf,+inf], keep order:false │ │ │ │ └─TableReader_78 25.00 root data:TableScan_77 - │ │ │ │ └─TableScan_77 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ │ │ └─TableScan_77 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ │ │ └─TableReader_83 500000.00 root data:TableScan_82 - │ │ │ └─TableScan_82 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ │ │ └─TableScan_82 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false │ │ └─TableReader_85 40000000.00 root data:TableScan_84 - │ │ └─TableScan_84 40000000.00 cop table:partsupp, range:[-inf,+inf], keep order:false + │ │ └─TableScan_84 40000000.00 cop[tikv] table:partsupp, range:[-inf,+inf], keep order:false │ └─TableReader_53 0.02 root data:Selection_52 - │ └─Selection_52 0.02 cop eq(Column#6, 30), like(Column#5, "%STEEL", 92) - │ └─TableScan_51 0.02 cop table:part, range: decided by [Column#17], keep order:true + │ └─Selection_52 0.02 cop[tikv] eq(Column#6, 30), like(Column#5, "%STEEL", 92) + │ └─TableScan_51 0.02 cop[tikv] table:part, range: decided by [Column#17], keep order:true └─Selection_89 6524008.35 root not(isnull(Column#50)) └─HashAgg_92 8155010.44 root group by:Column#30, funcs:min(Column#33), firstrow(Column#30) └─HashRightJoin_96 8155010.44 root inner join, inner:HashRightJoin_98, equal:[eq(Column#36, Column#31)] ├─HashRightJoin_98 100000.00 root inner join, inner:HashRightJoin_111, equal:[eq(Column#43, Column#39)] │ ├─HashRightJoin_111 5.00 root inner join, inner:TableReader_116, equal:[eq(Column#47, Column#45)] │ │ ├─TableReader_116 1.00 root data:Selection_115 - │ │ │ └─Selection_115 1.00 cop eq(Column#48, "ASIA") - │ │ │ └─TableScan_114 5.00 cop table:region, range:[-inf,+inf], keep order:false + │ │ │ └─Selection_115 1.00 cop[tikv] eq(Column#48, "ASIA") + │ │ │ └─TableScan_114 5.00 cop[tikv] table:region, range:[-inf,+inf], keep order:false │ │ └─TableReader_113 25.00 root data:TableScan_112 - │ │ └─TableScan_112 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ └─TableScan_112 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ └─TableReader_118 500000.00 root data:TableScan_117 - │ └─TableScan_117 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ └─TableScan_117 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false └─TableReader_120 40000000.00 root data:TableScan_119 - └─TableScan_119 40000000.00 cop table:partsupp, range:[-inf,+inf], keep order:false + └─TableScan_119 40000000.00 cop[tikv] table:partsupp, range:[-inf,+inf], keep order:false /* Q3 Shipping Priority Query This query retrieves the 10 unshipped orders with the highest value. @@ -256,15 +256,15 @@ Projection_14 10.00 root Column#18, Column#35, Column#13, Column#16 └─IndexHashJoin_37 91515927.49 root inner join, inner:IndexLookUp_28, outer key:Column#9, inner key:Column#18 ├─HashRightJoin_68 22592975.51 root inner join, inner:TableReader_74, equal:[eq(Column#1, Column#10)] │ ├─TableReader_74 1498236.00 root data:Selection_73 - │ │ └─Selection_73 1498236.00 cop eq(Column#7, "AUTOMOBILE") - │ │ └─TableScan_72 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + │ │ └─Selection_73 1498236.00 cop[tikv] eq(Column#7, "AUTOMOBILE") + │ │ └─TableScan_72 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false │ └─TableReader_71 36870000.00 root data:Selection_70 - │ └─Selection_70 36870000.00 cop lt(Column#13, 1995-03-13 00:00:00.000000) - │ └─TableScan_69 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + │ └─Selection_70 36870000.00 cop[tikv] lt(Column#13, 1995-03-13 00:00:00.000000) + │ └─TableScan_69 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false └─IndexLookUp_28 2.20 root - ├─IndexScan_25 4.05 cop table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#18, Column#9)], keep order:false - └─Selection_27 2.20 cop gt(Column#28, 1995-03-13 00:00:00.000000) - └─TableScan_26 4.05 cop table:lineitem, keep order:false + ├─IndexScan_25 4.05 cop[tikv] table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#18, Column#9)], keep order:false + └─Selection_27 2.20 cop[tikv] gt(Column#28, 1995-03-13 00:00:00.000000) + └─TableScan_26 4.05 cop[tikv] table:lineitem, keep order:false /* Q4 Order Priority Checking Query This query determines how well the order priority system is working and gives an assessment of customer satisfaction. @@ -300,12 +300,12 @@ Sort_10 1.00 root Column#44:asc └─HashAgg_15 1.00 root group by:Column#6, funcs:count(1), firstrow(Column#6) └─IndexHashJoin_29 2340750.00 root semi join, inner:IndexLookUp_20, outer key:Column#1, inner key:Column#10 ├─TableReader_41 2925937.50 root data:Selection_40 - │ └─Selection_40 2925937.50 cop ge(Column#5, 1995-01-01 00:00:00.000000), lt(Column#5, 1995-04-01) - │ └─TableScan_39 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + │ └─Selection_40 2925937.50 cop[tikv] ge(Column#5, 1995-01-01 00:00:00.000000), lt(Column#5, 1995-04-01) + │ └─TableScan_39 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false └─IndexLookUp_20 3.24 root - ├─IndexScan_17 4.05 cop table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#10, Column#1)], keep order:false - └─Selection_19 3.24 cop lt(Column#21, Column#22) - └─TableScan_18 4.05 cop table:lineitem, keep order:false + ├─IndexScan_17 4.05 cop[tikv] table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#10, Column#1)], keep order:false + └─Selection_19 3.24 cop[tikv] lt(Column#21, Column#22) + └─TableScan_18 4.05 cop[tikv] table:lineitem, keep order:false /* Q5 Local Supplier Volume Query This query lists the revenue volume done through local suppliers. @@ -353,19 +353,19 @@ Sort_23 5.00 root Column#51:desc │ │ ├─HashRightJoin_57 100000.00 root inner join, inner:HashRightJoin_70, equal:[eq(Column#42, Column#38)] │ │ │ ├─HashRightJoin_70 5.00 root inner join, inner:TableReader_75, equal:[eq(Column#46, Column#44)] │ │ │ │ ├─TableReader_75 1.00 root data:Selection_74 - │ │ │ │ │ └─Selection_74 1.00 cop eq(Column#47, "MIDDLE EAST") - │ │ │ │ │ └─TableScan_73 5.00 cop table:region, range:[-inf,+inf], keep order:false + │ │ │ │ │ └─Selection_74 1.00 cop[tikv] eq(Column#47, "MIDDLE EAST") + │ │ │ │ │ └─TableScan_73 5.00 cop[tikv] table:region, range:[-inf,+inf], keep order:false │ │ │ │ └─TableReader_72 25.00 root data:TableScan_71 - │ │ │ │ └─TableScan_71 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ │ │ └─TableScan_71 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ │ │ └─TableReader_77 500000.00 root data:TableScan_76 - │ │ │ └─TableScan_76 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ │ │ └─TableScan_76 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false │ │ └─TableReader_79 300005811.00 root data:TableScan_78 - │ │ └─TableScan_78 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ │ └─TableScan_78 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false │ └─TableReader_47 0.15 root data:Selection_46 - │ └─Selection_46 0.15 cop ge(Column#13, 1994-01-01 00:00:00.000000), lt(Column#13, 1995-01-01) - │ └─TableScan_45 0.19 cop table:orders, range: decided by [Column#18], keep order:true + │ └─Selection_46 0.15 cop[tikv] ge(Column#13, 1994-01-01 00:00:00.000000), lt(Column#13, 1995-01-01) + │ └─TableScan_45 0.19 cop[tikv] table:orders, range: decided by [Column#18], keep order:true └─TableReader_84 7500000.00 root data:TableScan_83 - └─TableScan_83 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + └─TableScan_83 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false /* Q6 Forecasting Revenue Change Query This query quantifies the amount of revenue increase that would have resulted from eliminating certain companywide @@ -390,9 +390,9 @@ and l_quantity < 24; id count task operator info StreamAgg_20 1.00 root funcs:sum(Column#21) └─TableReader_21 1.00 root data:StreamAgg_9 - └─StreamAgg_9 1.00 cop funcs:sum(mul(Column#6, Column#7)) - └─Selection_19 3713857.91 cop ge(Column#11, 1994-01-01 00:00:00.000000), ge(Column#7, 0.05), le(Column#7, 0.07), lt(Column#11, 1995-01-01), lt(Column#5, 24) - └─TableScan_18 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + └─StreamAgg_9 1.00 cop[tikv] funcs:sum(mul(Column#6, Column#7)) + └─Selection_19 3713857.91 cop[tikv] ge(Column#11, 1994-01-01 00:00:00.000000), ge(Column#7, 0.05), le(Column#7, 0.07), lt(Column#11, 1995-01-01), lt(Column#5, 24) + └─TableScan_18 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false /* Q7 Volume Shipping Query This query determines the value of goods shipped between certain nations to help in the re-negotiation of shipping @@ -454,20 +454,20 @@ Sort_22 769.96 root Column#55:asc, Column#56:asc, Column#57:asc │ │ ├─HashRightJoin_66 24465505.20 root inner join, inner:HashRightJoin_79, equal:[eq(Column#1, Column#10)] │ │ │ ├─HashRightJoin_79 40000.00 root inner join, inner:TableReader_84, equal:[eq(Column#42, Column#4)] │ │ │ │ ├─TableReader_84 2.00 root data:Selection_83 - │ │ │ │ │ └─Selection_83 2.00 cop or(eq(Column#43, "JAPAN"), eq(Column#43, "INDIA")) - │ │ │ │ │ └─TableScan_82 25.00 cop table:n1, range:[-inf,+inf], keep order:false + │ │ │ │ │ └─Selection_83 2.00 cop[tikv] or(eq(Column#43, "JAPAN"), eq(Column#43, "INDIA")) + │ │ │ │ │ └─TableScan_82 25.00 cop[tikv] table:n1, range:[-inf,+inf], keep order:false │ │ │ │ └─TableReader_81 500000.00 root data:TableScan_80 - │ │ │ │ └─TableScan_80 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ │ │ │ └─TableScan_80 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false │ │ │ └─TableReader_87 91446230.29 root data:Selection_86 - │ │ │ └─Selection_86 91446230.29 cop ge(Column#18, 1995-01-01 00:00:00.000000), le(Column#18, 1996-12-31 00:00:00.000000) - │ │ │ └─TableScan_85 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ │ │ └─Selection_86 91446230.29 cop[tikv] ge(Column#18, 1995-01-01 00:00:00.000000), le(Column#18, 1996-12-31 00:00:00.000000) + │ │ │ └─TableScan_85 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false │ │ └─TableReader_58 1.00 root data:TableScan_57 - │ │ └─TableScan_57 1.00 cop table:orders, range: decided by [Column#8], keep order:true + │ │ └─TableScan_57 1.00 cop[tikv] table:orders, range: decided by [Column#8], keep order:true │ └─TableReader_91 7500000.00 root data:TableScan_90 - │ └─TableScan_90 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + │ └─TableScan_90 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false └─TableReader_94 2.00 root data:Selection_93 - └─Selection_93 2.00 cop or(eq(Column#47, "INDIA"), eq(Column#47, "JAPAN")) - └─TableScan_92 25.00 cop table:n2, range:[-inf,+inf], keep order:false + └─Selection_93 2.00 cop[tikv] or(eq(Column#47, "INDIA"), eq(Column#47, "JAPAN")) + └─TableScan_92 25.00 cop[tikv] table:n2, range:[-inf,+inf], keep order:false /* Q8 National Market Share Query This query determines how the market share of a given nation within a given region has changed over two years for @@ -529,25 +529,25 @@ Sort_29 719.02 root Column#67:asc │ │ │ │ ├─HashRightJoin_88 1500000.00 root inner join, inner:HashRightJoin_101, equal:[eq(Column#51, Column#46)] │ │ │ │ │ ├─HashRightJoin_101 5.00 root inner join, inner:TableReader_106, equal:[eq(Column#59, Column#53)] │ │ │ │ │ │ ├─TableReader_106 1.00 root data:Selection_105 - │ │ │ │ │ │ │ └─Selection_105 1.00 cop eq(Column#60, "ASIA") - │ │ │ │ │ │ │ └─TableScan_104 5.00 cop table:region, range:[-inf,+inf], keep order:false + │ │ │ │ │ │ │ └─Selection_105 1.00 cop[tikv] eq(Column#60, "ASIA") + │ │ │ │ │ │ │ └─TableScan_104 5.00 cop[tikv] table:region, range:[-inf,+inf], keep order:false │ │ │ │ │ │ └─TableReader_103 25.00 root data:TableScan_102 - │ │ │ │ │ │ └─TableScan_102 25.00 cop table:n1, range:[-inf,+inf], keep order:false + │ │ │ │ │ │ └─TableScan_102 25.00 cop[tikv] table:n1, range:[-inf,+inf], keep order:false │ │ │ │ │ └─TableReader_108 7500000.00 root data:TableScan_107 - │ │ │ │ │ └─TableScan_107 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + │ │ │ │ │ └─TableScan_107 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false │ │ │ │ └─TableReader_111 22413367.93 root data:Selection_110 - │ │ │ │ └─Selection_110 22413367.93 cop ge(Column#38, 1995-01-01 00:00:00.000000), le(Column#38, 1996-12-31 00:00:00.000000) - │ │ │ │ └─TableScan_109 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + │ │ │ │ └─Selection_110 22413367.93 cop[tikv] ge(Column#38, 1995-01-01 00:00:00.000000), le(Column#38, 1996-12-31 00:00:00.000000) + │ │ │ │ └─TableScan_109 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false │ │ │ └─IndexLookUp_74 4.05 root - │ │ │ ├─IndexScan_72 4.05 cop table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#17, Column#34)], keep order:false - │ │ │ └─TableScan_73 4.05 cop table:lineitem, keep order:false + │ │ │ ├─IndexScan_72 4.05 cop[tikv] table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#17, Column#34)], keep order:false + │ │ │ └─TableScan_73 4.05 cop[tikv] table:lineitem, keep order:false │ │ └─TableReader_116 61674.00 root data:Selection_115 - │ │ └─Selection_115 61674.00 cop eq(Column#5, "SMALL PLATED COPPER") - │ │ └─TableScan_114 10000000.00 cop table:part, range:[-inf,+inf], keep order:false + │ │ └─Selection_115 61674.00 cop[tikv] eq(Column#5, "SMALL PLATED COPPER") + │ │ └─TableScan_114 10000000.00 cop[tikv] table:part, range:[-inf,+inf], keep order:false │ └─TableReader_118 500000.00 root data:TableScan_117 - │ └─TableScan_117 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ └─TableScan_117 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false └─TableReader_120 25.00 root data:TableScan_119 - └─TableScan_119 25.00 cop table:n2, range:[-inf,+inf], keep order:false + └─TableScan_119 25.00 cop[tikv] table:n2, range:[-inf,+inf], keep order:false /* Q9 Product Type Profit Measure Query This query determines how much profit is made on a given line of parts, broken out by supplier nation and year. @@ -602,18 +602,18 @@ Sort_25 2406.00 root Column#57:asc, Column#58:desc │ │ ├─HashRightJoin_79 300005811.00 root inner join, inner:HashRightJoin_90, equal:[eq(Column#10, Column#19)] │ │ │ ├─HashRightJoin_90 500000.00 root inner join, inner:TableReader_94, equal:[eq(Column#49, Column#13)] │ │ │ │ ├─TableReader_94 25.00 root data:TableScan_93 - │ │ │ │ │ └─TableScan_93 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ │ │ │ └─TableScan_93 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ │ │ │ └─TableReader_92 500000.00 root data:TableScan_91 - │ │ │ │ └─TableScan_91 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ │ │ │ └─TableScan_91 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false │ │ │ └─TableReader_96 300005811.00 root data:TableScan_95 - │ │ │ └─TableScan_95 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ │ │ └─TableScan_95 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false │ │ └─TableReader_99 8000000.00 root data:Selection_98 - │ │ └─Selection_98 8000000.00 cop like(Column#2, "%dim%", 92) - │ │ └─TableScan_97 10000000.00 cop table:part, range:[-inf,+inf], keep order:false + │ │ └─Selection_98 8000000.00 cop[tikv] like(Column#2, "%dim%", 92) + │ │ └─TableScan_97 10000000.00 cop[tikv] table:part, range:[-inf,+inf], keep order:false │ └─TableReader_101 75000000.00 root data:TableScan_100 - │ └─TableScan_100 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + │ └─TableScan_100 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false └─TableReader_103 40000000.00 root data:TableScan_102 - └─TableScan_102 40000000.00 cop table:partsupp, range:[-inf,+inf], keep order:false + └─TableScan_102 40000000.00 cop[tikv] table:partsupp, range:[-inf,+inf], keep order:false /* Q10 Returned Item Reporting Query The query identifies customers who might be having problems with the parts that are shipped to them. @@ -666,16 +666,16 @@ Projection_17 20.00 root Column#1, Column#2, Column#39, Column#6, Column#36, Col ├─HashLeftJoin_43 3017307.69 root inner join, inner:TableReader_62, equal:[eq(Column#1, Column#10)] │ ├─HashRightJoin_55 7500000.00 root inner join, inner:TableReader_59, equal:[eq(Column#35, Column#4)] │ │ ├─TableReader_59 25.00 root data:TableScan_58 - │ │ │ └─TableScan_58 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ │ └─TableScan_58 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ │ └─TableReader_57 7500000.00 root data:TableScan_56 - │ │ └─TableScan_56 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + │ │ └─TableScan_56 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false │ └─TableReader_62 3017307.69 root data:Selection_61 - │ └─Selection_61 3017307.69 cop ge(Column#13, 1993-08-01 00:00:00.000000), lt(Column#13, 1993-11-01) - │ └─TableScan_60 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + │ └─Selection_61 3017307.69 cop[tikv] ge(Column#13, 1993-08-01 00:00:00.000000), lt(Column#13, 1993-11-01) + │ └─TableScan_60 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false └─IndexLookUp_36 1.00 root - ├─IndexScan_33 4.05 cop table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#18, Column#9)], keep order:true - └─Selection_35 1.00 cop eq(Column#26, "R") - └─TableScan_34 4.05 cop table:lineitem, keep order:false + ├─IndexScan_33 4.05 cop[tikv] table:lineitem, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#18, Column#9)], keep order:true + └─Selection_35 1.00 cop[tikv] eq(Column#26, "R") + └─TableScan_34 4.05 cop[tikv] table:lineitem, keep order:false /* Q11 Important Stock Identification Query This query finds the most important subset of suppliers' stock in a given nation. @@ -720,12 +720,12 @@ Projection_57 1304801.67 root Column#1, Column#18 └─HashRightJoin_67 1631002.09 root inner join, inner:HashRightJoin_80, equal:[eq(Column#7, Column#2)] ├─HashRightJoin_80 20000.00 root inner join, inner:TableReader_85, equal:[eq(Column#14, Column#10)] │ ├─TableReader_85 1.00 root data:Selection_84 - │ │ └─Selection_84 1.00 cop eq(Column#15, "MOZAMBIQUE") - │ │ └─TableScan_83 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ └─Selection_84 1.00 cop[tikv] eq(Column#15, "MOZAMBIQUE") + │ │ └─TableScan_83 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ └─TableReader_82 500000.00 root data:TableScan_81 - │ └─TableScan_81 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ └─TableScan_81 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false └─TableReader_87 40000000.00 root data:TableScan_86 - └─TableScan_86 40000000.00 cop table:partsupp, range:[-inf,+inf], keep order:false + └─TableScan_86 40000000.00 cop[tikv] table:partsupp, range:[-inf,+inf], keep order:false /* Q12 Shipping Modes and Order Priority Query This query determines whether selecting less expensive modes of shipping is negatively affecting the critical-priority @@ -772,10 +772,10 @@ Sort_9 1.00 root Column#29:asc └─Projection_40 10023369.01 root cast(case(or(eq(Column#6, "1-URGENT"), eq(Column#6, "2-HIGH")), 1, 0)), cast(case(and(ne(Column#6, "1-URGENT"), ne(Column#6, "2-HIGH")), 1, 0)), Column#24, Column#24 └─IndexMergeJoin_22 10023369.01 root inner join, inner:TableReader_20, outer key:Column#10, inner key:Column#1 ├─TableReader_36 10023369.01 root data:Selection_35 - │ └─Selection_35 10023369.01 cop ge(Column#22, 1997-01-01 00:00:00.000000), in(Column#24, "RAIL", "FOB"), lt(Column#20, Column#21), lt(Column#21, Column#22), lt(Column#22, 1998-01-01) - │ └─TableScan_34 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ └─Selection_35 10023369.01 cop[tikv] ge(Column#22, 1997-01-01 00:00:00.000000), in(Column#24, "RAIL", "FOB"), lt(Column#20, Column#21), lt(Column#21, Column#22), lt(Column#22, 1998-01-01) + │ └─TableScan_34 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false └─TableReader_20 1.00 root data:TableScan_19 - └─TableScan_19 1.00 cop table:orders, range: decided by [Column#10], keep order:true + └─TableScan_19 1.00 cop[tikv] table:orders, range: decided by [Column#10], keep order:true /* Q13 Customer Distribution Query This query seeks relationships between customers and the size of their orders. @@ -812,10 +812,10 @@ Sort_9 7500000.00 root Column#23:desc, Column#22:desc └─HashAgg_17 7500000.00 root group by:Column#1, funcs:count(Column#9) └─HashLeftJoin_20 60000000.00 root left outer join, inner:TableReader_25, equal:[eq(Column#1, Column#10)] ├─TableReader_22 7500000.00 root data:TableScan_21 - │ └─TableScan_21 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + │ └─TableScan_21 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false └─TableReader_25 60000000.00 root data:Selection_24 - └─Selection_24 60000000.00 cop not(like(Column#17, "%pending%deposits%", 92)) - └─TableScan_23 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + └─Selection_24 60000000.00 cop[tikv] not(like(Column#17, "%pending%deposits%", 92)) + └─TableScan_23 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false /* Q14 Promotion Effect Query This query monitors the market response to a promotion such as TV advertisements or a special campaign. @@ -843,10 +843,10 @@ Projection_8 1.00 root div(mul(100.00, Column#27), Column#28) └─Projection_41 4121984.49 root case(like(Column#22, "PROMO%", 92), mul(Column#6, minus(1, Column#7)), 0), mul(Column#6, minus(1, Column#7)) └─IndexMergeJoin_36 4121984.49 root inner join, inner:TableReader_34, outer key:Column#2, inner key:Column#18 ├─TableReader_27 4121984.49 root data:Selection_26 - │ └─Selection_26 4121984.49 cop ge(Column#11, 1996-12-01 00:00:00.000000), lt(Column#11, 1997-01-01) - │ └─TableScan_25 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ └─Selection_26 4121984.49 cop[tikv] ge(Column#11, 1996-12-01 00:00:00.000000), lt(Column#11, 1997-01-01) + │ └─TableScan_25 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false └─TableReader_34 1.00 root data:TableScan_33 - └─TableScan_33 1.00 cop table:part, range: decided by [Column#2], keep order:true + └─TableScan_33 1.00 cop[tikv] table:part, range: decided by [Column#2], keep order:true /* Q15 Top Supplier Query This query determines the top supplier so it can be rewarded, given more business, or identified for special recognition. @@ -933,13 +933,13 @@ Sort_13 3863988.24 root Column#28:desc, Column#25:asc, Column#26:asc, Column#27: └─HashLeftJoin_30 3863988.24 root anti semi join, inner:TableReader_57, equal:[eq(Column#2, Column#16)] ├─IndexMergeJoin_38 4829985.30 root inner join, inner:IndexReader_36, outer key:Column#7, inner key:Column#1 │ ├─TableReader_50 1200618.43 root data:Selection_49 - │ │ └─Selection_49 1200618.43 cop in(Column#12, 48, 19, 12, 4, 41, 7, 21, 39), ne(Column#10, "Brand#34"), not(like(Column#11, "LARGE BRUSHED%", 92)) - │ │ └─TableScan_48 10000000.00 cop table:part, range:[-inf,+inf], keep order:false + │ │ └─Selection_49 1200618.43 cop[tikv] in(Column#12, 48, 19, 12, 4, 41, 7, 21, 39), ne(Column#10, "Brand#34"), not(like(Column#11, "LARGE BRUSHED%", 92)) + │ │ └─TableScan_48 10000000.00 cop[tikv] table:part, range:[-inf,+inf], keep order:false │ └─IndexReader_36 4.02 root index:IndexScan_35 - │ └─IndexScan_35 4.02 cop table:partsupp, index:PS_PARTKEY, PS_SUPPKEY, range: decided by [eq(Column#1, Column#7)], keep order:true + │ └─IndexScan_35 4.02 cop[tikv] table:partsupp, index:PS_PARTKEY, PS_SUPPKEY, range: decided by [eq(Column#1, Column#7)], keep order:true └─TableReader_57 400000.00 root data:Selection_56 - └─Selection_56 400000.00 cop like(Column#22, "%Customer%Complaints%", 92) - └─TableScan_55 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + └─Selection_56 400000.00 cop[tikv] like(Column#22, "%Customer%Complaints%", 92) + └─TableScan_55 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false /* Q17 Small-Quantity-Order Revenue Query This query determines how much average yearly revenue would be lost if orders were no longer filled for small @@ -975,14 +975,14 @@ Projection_16 1.00 root div(Column#46, 7.0) └─HashRightJoin_53 293773.83 root inner join, inner:HashRightJoin_37, equal:[eq(Column#18, Column#28)], other cond:lt(Column#5, mul(0.2, Column#44)) ├─HashRightJoin_37 293773.83 root inner join, inner:TableReader_42, equal:[eq(Column#18, Column#2)] │ ├─TableReader_42 9736.49 root data:Selection_41 - │ │ └─Selection_41 9736.49 cop eq(Column#21, "Brand#44"), eq(Column#24, "WRAP PKG") - │ │ └─TableScan_40 10000000.00 cop table:part, range:[-inf,+inf], keep order:false + │ │ └─Selection_41 9736.49 cop[tikv] eq(Column#21, "Brand#44"), eq(Column#24, "WRAP PKG") + │ │ └─TableScan_40 10000000.00 cop[tikv] table:part, range:[-inf,+inf], keep order:false │ └─TableReader_39 300005811.00 root data:TableScan_38 - │ └─TableScan_38 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ └─TableScan_38 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false └─HashAgg_47 9943040.00 root group by:Column#53, funcs:avg(Column#50, Column#51), firstrow(Column#53) └─TableReader_48 9943040.00 root data:HashAgg_43 - └─HashAgg_43 9943040.00 cop group by:Column#28, funcs:count(Column#31), sum(Column#31) - └─TableScan_46 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + └─HashAgg_43 9943040.00 cop[tikv] group by:Column#28, funcs:count(Column#31), sum(Column#31) + └─TableScan_46 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false /* Q18 Large Volume Customer Query The Large Volume Customer Query ranks customers based on their having placed a large quantity order. Large @@ -1033,16 +1033,16 @@ Projection_24 100.00 root Column#2, Column#1, Column#9, Column#13, Column#12, Co ├─HashLeftJoin_48 59251097.60 root inner join, inner:Selection_65, equal:[eq(Column#9, Column#35)] │ ├─HashRightJoin_60 75000000.00 root inner join, inner:TableReader_64, equal:[eq(Column#1, Column#10)] │ │ ├─TableReader_64 7500000.00 root data:TableScan_63 - │ │ │ └─TableScan_63 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + │ │ │ └─TableScan_63 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false │ │ └─TableReader_62 75000000.00 root data:TableScan_61 - │ │ └─TableScan_61 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + │ │ └─TableScan_61 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false │ └─Selection_65 59251097.60 root gt(Column#52, 314) │ └─HashAgg_72 74063872.00 root group by:Column#68, funcs:sum(Column#66), firstrow(Column#68) │ └─TableReader_73 74063872.00 root data:HashAgg_66 - │ └─HashAgg_66 74063872.00 cop group by:Column#35, funcs:sum(Column#39) - │ └─TableScan_71 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ └─HashAgg_66 74063872.00 cop[tikv] group by:Column#35, funcs:sum(Column#39) + │ └─TableScan_71 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false └─TableReader_81 300005811.00 root data:TableScan_80 - └─TableScan_80 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + └─TableScan_80 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false /* Q19 Discounted Revenue Query The Discounted Revenue Query reports the gross discounted revenue attributed to the sale of selected parts handled @@ -1093,11 +1093,11 @@ StreamAgg_13 1.00 root funcs:sum(Column#0) └─Projection_46 6286493.79 root mul(Column#6, minus(1, Column#7)) └─IndexMergeJoin_41 6286493.79 root inner join, inner:TableReader_39, outer key:Column#2, inner key:Column#18, other cond:or(and(and(eq(Column#21, "Brand#52"), in(Column#24, "SM CASE", "SM BOX", "SM PACK", "SM PKG")), and(ge(Column#5, 4), and(le(Column#5, 14), le(Column#23, 5)))), or(and(and(eq(Column#21, "Brand#11"), in(Column#24, "MED BAG", "MED BOX", "MED PKG", "MED PACK")), and(ge(Column#5, 18), and(le(Column#5, 28), le(Column#23, 10)))), and(and(eq(Column#21, "Brand#51"), in(Column#24, "LG CASE", "LG BOX", "LG PACK", "LG PKG")), and(ge(Column#5, 29), and(le(Column#5, 39), le(Column#23, 15)))))) ├─TableReader_29 6286493.79 root data:Selection_28 - │ └─Selection_28 6286493.79 cop eq(Column#14, "DELIVER IN PERSON"), in(Column#15, "AIR", "AIR REG"), or(and(ge(Column#5, 4), le(Column#5, 14)), or(and(ge(Column#5, 18), le(Column#5, 28)), and(ge(Column#5, 29), le(Column#5, 39)))) - │ └─TableScan_27 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + │ └─Selection_28 6286493.79 cop[tikv] eq(Column#14, "DELIVER IN PERSON"), in(Column#15, "AIR", "AIR REG"), or(and(ge(Column#5, 4), le(Column#5, 14)), or(and(ge(Column#5, 18), le(Column#5, 28)), and(ge(Column#5, 29), le(Column#5, 39)))) + │ └─TableScan_27 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false └─TableReader_39 0.80 root data:Selection_38 - └─Selection_38 0.80 cop ge(Column#23, 1), or(and(eq(Column#21, "Brand#52"), and(in(Column#24, "SM CASE", "SM BOX", "SM PACK", "SM PKG"), le(Column#23, 5))), or(and(eq(Column#21, "Brand#11"), and(in(Column#24, "MED BAG", "MED BOX", "MED PKG", "MED PACK"), le(Column#23, 10))), and(eq(Column#21, "Brand#51"), and(in(Column#24, "LG CASE", "LG BOX", "LG PACK", "LG PKG"), le(Column#23, 15))))) - └─TableScan_37 1.00 cop table:part, range: decided by [Column#2], keep order:true + └─Selection_38 0.80 cop[tikv] ge(Column#23, 1), or(and(eq(Column#21, "Brand#52"), and(in(Column#24, "SM CASE", "SM BOX", "SM PACK", "SM PKG"), le(Column#23, 5))), or(and(eq(Column#21, "Brand#11"), and(in(Column#24, "MED BAG", "MED BOX", "MED PKG", "MED PACK"), le(Column#23, 10))), and(eq(Column#21, "Brand#51"), and(in(Column#24, "LG CASE", "LG BOX", "LG PACK", "LG PKG"), le(Column#23, 15))))) + └─TableScan_37 1.00 cop[tikv] table:part, range: decided by [Column#2], keep order:true /* Q20 Potential Part Promotion Query The Potential Part Promotion Query identifies suppliers in a particular nation having selected parts that may be candidates @@ -1150,10 +1150,10 @@ Sort_28 20000.00 root Column#48:asc └─HashRightJoin_32 20000.00 root inner join, inner:HashRightJoin_45, equal:[eq(Column#1, Column#13)] ├─HashRightJoin_45 20000.00 root inner join, inner:TableReader_50, equal:[eq(Column#8, Column#4)] │ ├─TableReader_50 1.00 root data:Selection_49 - │ │ └─Selection_49 1.00 cop eq(Column#9, "ALGERIA") - │ │ └─TableScan_48 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ └─Selection_49 1.00 cop[tikv] eq(Column#9, "ALGERIA") + │ │ └─TableScan_48 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ └─TableReader_47 500000.00 root data:TableScan_46 - │ └─TableScan_46 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ └─TableScan_46 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false └─HashAgg_53 64006.34 root group by:Column#13, funcs:firstrow(Column#13) └─Projection_54 64006.34 root Column#12, Column#13, Column#14, Column#18, mul(0.5, Column#45) └─Selection_55 64006.34 root gt(cast(Column#14), mul(0.5, Column#45)) @@ -1161,14 +1161,14 @@ Sort_28 20000.00 root Column#48:asc └─HashLeftJoin_61 9711455.06 root left outer join, inner:TableReader_90, equal:[eq(Column#12, Column#29) eq(Column#13, Column#30)] ├─IndexHashJoin_73 321865.05 root inner join, inner:IndexLookUp_65, outer key:Column#18, inner key:Column#12 │ ├─TableReader_85 80007.93 root data:Selection_84 - │ │ └─Selection_84 80007.93 cop like(Column#19, "green%", 92) - │ │ └─TableScan_83 10000000.00 cop table:part, range:[-inf,+inf], keep order:false + │ │ └─Selection_84 80007.93 cop[tikv] like(Column#19, "green%", 92) + │ │ └─TableScan_83 10000000.00 cop[tikv] table:part, range:[-inf,+inf], keep order:false │ └─IndexLookUp_65 4.02 root - │ ├─IndexScan_63 4.02 cop table:partsupp, index:PS_PARTKEY, PS_SUPPKEY, range: decided by [eq(Column#12, Column#18)], keep order:false - │ └─TableScan_64 4.02 cop table:partsupp, keep order:false + │ ├─IndexScan_63 4.02 cop[tikv] table:partsupp, index:PS_PARTKEY, PS_SUPPKEY, range: decided by [eq(Column#12, Column#18)], keep order:false + │ └─TableScan_64 4.02 cop[tikv] table:partsupp, keep order:false └─TableReader_90 44189356.65 root data:Selection_89 - └─Selection_89 44189356.65 cop ge(Column#38, 1993-01-01 00:00:00.000000), lt(Column#38, 1994-01-01) - └─TableScan_88 300005811.00 cop table:lineitem, range:[-inf,+inf], keep order:false + └─Selection_89 44189356.65 cop[tikv] ge(Column#38, 1993-01-01 00:00:00.000000), lt(Column#38, 1994-01-01) + └─TableScan_88 300005811.00 cop[tikv] table:lineitem, range:[-inf,+inf], keep order:false /* Q21 Suppliers Who Kept Orders Waiting Query This query identifies certain suppliers who were not able to ship required parts in a timely manner. @@ -1227,23 +1227,23 @@ Projection_25 1.00 root Column#2, Column#104 │ │ ├─HashRightJoin_98 12232752.60 root inner join, inner:HashRightJoin_111, equal:[eq(Column#1, Column#10)] │ │ │ ├─HashRightJoin_111 20000.00 root inner join, inner:TableReader_116, equal:[eq(Column#34, Column#4)] │ │ │ │ ├─TableReader_116 1.00 root data:Selection_115 - │ │ │ │ │ └─Selection_115 1.00 cop eq(Column#35, "EGYPT") - │ │ │ │ │ └─TableScan_114 25.00 cop table:nation, range:[-inf,+inf], keep order:false + │ │ │ │ │ └─Selection_115 1.00 cop[tikv] eq(Column#35, "EGYPT") + │ │ │ │ │ └─TableScan_114 25.00 cop[tikv] table:nation, range:[-inf,+inf], keep order:false │ │ │ │ └─TableReader_113 500000.00 root data:TableScan_112 - │ │ │ │ └─TableScan_112 500000.00 cop table:supplier, range:[-inf,+inf], keep order:false + │ │ │ │ └─TableScan_112 500000.00 cop[tikv] table:supplier, range:[-inf,+inf], keep order:false │ │ │ └─TableReader_119 240004648.80 root data:Selection_118 - │ │ │ └─Selection_118 240004648.80 cop gt(Column#20, Column#19) - │ │ │ └─TableScan_117 300005811.00 cop table:l1, range:[-inf,+inf], keep order:false + │ │ │ └─Selection_118 240004648.80 cop[tikv] gt(Column#20, Column#19) + │ │ │ └─TableScan_117 300005811.00 cop[tikv] table:l1, range:[-inf,+inf], keep order:false │ │ └─TableReader_90 0.80 root data:Selection_89 - │ │ └─Selection_89 0.80 cop eq(Column#27, "F") - │ │ └─TableScan_88 1.00 cop table:orders, range: decided by [Column#8], keep order:true + │ │ └─Selection_89 0.80 cop[tikv] eq(Column#27, "F") + │ │ └─TableScan_88 1.00 cop[tikv] table:orders, range: decided by [Column#8], keep order:true │ └─IndexLookUp_73 4.05 root - │ ├─IndexScan_71 4.05 cop table:l2, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#38, Column#8)], keep order:false - │ └─TableScan_72 4.05 cop table:l2, keep order:false + │ ├─IndexScan_71 4.05 cop[tikv] table:l2, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#38, Column#8)], keep order:false + │ └─TableScan_72 4.05 cop[tikv] table:l2, keep order:false └─IndexLookUp_39 3.24 root - ├─IndexScan_36 4.05 cop table:l3, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#71, Column#8)], keep order:false - └─Selection_38 3.24 cop gt(Column#83, Column#82) - └─TableScan_37 4.05 cop table:l3, keep order:false + ├─IndexScan_36 4.05 cop[tikv] table:l3, index:L_ORDERKEY, L_LINENUMBER, range: decided by [eq(Column#71, Column#8)], keep order:false + └─Selection_38 3.24 cop[tikv] gt(Column#83, Column#82) + └─TableScan_37 4.05 cop[tikv] table:l3, keep order:false /* Q22 Global Sales Opportunity Query The Global Sales Opportunity Query identifies geographies where there are customers who may be likely to make a @@ -1298,7 +1298,7 @@ Sort_32 1.00 root Column#41:asc └─HashLeftJoin_39 0.00 root anti semi join, inner:TableReader_45, equal:[eq(Column#1, Column#20)] ├─Selection_40 0.00 root in(substring(Column#5, 1, 2), "20", "40", "22", "30", "39", "42", "21") │ └─TableReader_43 0.00 root data:Selection_42 - │ └─Selection_42 0.00 cop gt(Column#6, NULL) - │ └─TableScan_41 7500000.00 cop table:customer, range:[-inf,+inf], keep order:false + │ └─Selection_42 0.00 cop[tikv] gt(Column#6, NULL) + │ └─TableScan_41 7500000.00 cop[tikv] table:customer, range:[-inf,+inf], keep order:false └─TableReader_45 75000000.00 root data:TableScan_44 - └─TableScan_44 75000000.00 cop table:orders, range:[-inf,+inf], keep order:false + └─TableScan_44 75000000.00 cop[tikv] table:orders, range:[-inf,+inf], keep order:false diff --git a/cmd/explaintest/r/window_function.result b/cmd/explaintest/r/window_function.result index 73f3afe27df5e..42cafee53fce2 100644 --- a/cmd/explaintest/r/window_function.result +++ b/cmd/explaintest/r/window_function.result @@ -7,45 +7,45 @@ id count task operator info Projection_7 10000.00 root Column#7 └─Window_8 10000.00 root sum(cast(Column#1)) over() └─IndexReader_12 10000.00 root index:IndexScan_11 - └─IndexScan_11 10000.00 cop table:t, index:a, range:[NULL,+inf], keep order:false, stats:pseudo + └─IndexScan_11 10000.00 cop[tikv] table:t, index:a, range:[NULL,+inf], keep order:false, stats:pseudo explain select sum(a) over(partition by a) from t; id count task operator info Projection_7 10000.00 root Column#7 └─Window_8 10000.00 root sum(cast(Column#1)) over(partition by Column#1) └─IndexReader_10 10000.00 root index:IndexScan_9 - └─IndexScan_9 10000.00 cop table:t, index:a, range:[NULL,+inf], keep order:true, stats:pseudo + └─IndexScan_9 10000.00 cop[tikv] table:t, index:a, range:[NULL,+inf], keep order:true, stats:pseudo explain select sum(a) over(partition by a order by b) from t; id count task operator info Projection_7 10000.00 root Column#8 └─Window_8 10000.00 root sum(cast(Column#1)) over(partition by Column#1 order by Column#2 asc range between unbounded preceding and current row) └─Sort_11 10000.00 root Column#1:asc, Column#2:asc └─TableReader_10 10000.00 root data:TableScan_9 - └─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_9 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select sum(a) over(partition by a order by b rows unbounded preceding) from t; id count task operator info Projection_7 10000.00 root Column#8 └─Window_8 10000.00 root sum(cast(Column#1)) over(partition by Column#1 order by Column#2 asc rows between unbounded preceding and current row) └─Sort_11 10000.00 root Column#1:asc, Column#2:asc └─TableReader_10 10000.00 root data:TableScan_9 - └─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_9 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select sum(a) over(partition by a order by b rows between 1 preceding and 1 following) from t; id count task operator info Projection_7 10000.00 root Column#8 └─Window_8 10000.00 root sum(cast(Column#1)) over(partition by Column#1 order by Column#2 asc rows between 1 preceding and 1 following) └─Sort_11 10000.00 root Column#1:asc, Column#2:asc └─TableReader_10 10000.00 root data:TableScan_9 - └─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_9 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select sum(a) over(partition by a order by b range between 1 preceding and 1 following) from t; id count task operator info Projection_7 10000.00 root Column#8 └─Window_8 10000.00 root sum(cast(Column#1)) over(partition by Column#1 order by Column#2 asc range between 1 preceding and 1 following) └─Sort_11 10000.00 root Column#1:asc, Column#2:asc └─TableReader_10 10000.00 root data:TableScan_9 - └─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_9 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo explain select sum(a) over(partition by a order by c range between interval '2:30' minute_second preceding and interval '2:30' minute_second following) from t; id count task operator info Projection_7 10000.00 root Column#8 └─Window_8 10000.00 root sum(cast(Column#1)) over(partition by Column#1 order by Column#3 asc range between interval "2:30" "MINUTE_SECOND" preceding and interval "2:30" "MINUTE_SECOND" following) └─Sort_11 10000.00 root Column#1:asc, Column#3:asc └─TableReader_10 10000.00 root data:TableScan_9 - └─TableScan_9 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo + └─TableScan_9 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index 0b0506c8c364d..959b053b4bf38 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -379,19 +379,19 @@ func (p *LogicalJoin) setPreferredJoinType(hintInfo *tableHintInfo) { } } -func (p *DataSource) setPreferredStoreType(hintInfo *tableHintInfo) { +func (ds *DataSource) setPreferredStoreType(hintInfo *tableHintInfo) { if hintInfo == nil { return } var alias *hintTableInfo - if len(p.TableAsName.L) != 0 { - alias = &hintTableInfo{name: *p.TableAsName, selectOffset: p.SelectBlockOffset()} + if len(ds.TableAsName.L) != 0 { + alias = &hintTableInfo{name: *ds.TableAsName, selectOffset: ds.SelectBlockOffset()} } else { - alias = extractTableAlias(p) + alias = extractTableAlias(ds) } if hintInfo.ifPreferTiFlash(alias) { - p.preferStoreType |= preferTiFlash + ds.preferStoreType |= preferTiFlash } } From 43c9668bebc791b249d97afc942458373399ef5d Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Mon, 30 Sep 2019 17:13:18 +0800 Subject: [PATCH 4/9] address comments --- planner/core/common_plans.go | 4 ++-- planner/core/logical_plan_builder.go | 8 ++++++-- planner/core/logical_plans.go | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 61c8c84c4702d..9e188332f2159 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -702,9 +702,9 @@ func (e *Explain) explainPlanInRowFormat(p Plan, taskType, indent string, isLast var storeType string switch x.StoreType { case kv.TiKV: - storeType = "tikv" + storeType = HintTiKV case kv.TiFlash: - storeType = "tiflash" + storeType = HintTiFlash default: storeType = "unknown" } diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index 959b053b4bf38..0b7fce20aad7d 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -72,6 +72,10 @@ const ( HintAggToCop = "agg_to_cop" // HintReadFromStorage is hint enforce some tables read from specific type of storage. HintReadFromStorage = "read_from_storage" + // HintTiFlash is a label represents the tiflash storage type. + HintTiFlash = "tiflash" + // HintTiKV is a label represents the tikv storage type. + HintTiKV = "tikv" ) const ( @@ -388,7 +392,7 @@ func (ds *DataSource) setPreferredStoreType(hintInfo *tableHintInfo) { if len(ds.TableAsName.L) != 0 { alias = &hintTableInfo{name: *ds.TableAsName, selectOffset: ds.SelectBlockOffset()} } else { - alias = extractTableAlias(ds) + alias = &hintTableInfo{name: ds.tableInfo.Name, selectOffset: ds.SelectBlockOffset()} } if hintInfo.ifPreferTiFlash(alias) { ds.preferStoreType |= preferTiFlash @@ -2029,7 +2033,7 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, nodeType n }) } case HintReadFromStorage: - if hint.StoreType.L == "tiflash" { + if hint.StoreType.L == HintTiFlash { tiflashTables = tableNames2HintTableInfo(hint.Tables, b.hintProcessor, nodeType, currentLevel) } default: diff --git a/planner/core/logical_plans.go b/planner/core/logical_plans.go index 055690a857ede..bf5188a981a7c 100644 --- a/planner/core/logical_plans.go +++ b/planner/core/logical_plans.go @@ -102,7 +102,10 @@ const ( preferMergeJoin preferHashAgg preferStreamAgg - preferTiKV +) + +const ( + preferTiKV = 1 << iota preferTiFlash ) From 6c86dcec963ebdb7b7e3bab2bee69f1ee857f084 Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Tue, 8 Oct 2019 12:04:43 +0800 Subject: [PATCH 5/9] address comments --- planner/core/common_plans.go | 4 ++-- planner/core/find_best_task.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 9e188332f2159..61c8c84c4702d 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -702,9 +702,9 @@ func (e *Explain) explainPlanInRowFormat(p Plan, taskType, indent string, isLast var storeType string switch x.StoreType { case kv.TiKV: - storeType = HintTiKV + storeType = "tikv" case kv.TiFlash: - storeType = HintTiFlash + storeType = "tiflash" default: storeType = "unknown" } diff --git a/planner/core/find_best_task.go b/planner/core/find_best_task.go index 6e666d2db83aa..6620a2cc5b48e 100644 --- a/planner/core/find_best_task.go +++ b/planner/core/find_best_task.go @@ -1019,7 +1019,6 @@ func (ds *DataSource) getOriginalPhysicalTableScan(prop *property.PhysicalProper Ranges: path.ranges, AccessCondition: path.accessConds, filterCondition: path.tableFilters, - StoreType: kv.TiKV, }.Init(ds.ctx, ds.blockOffset) if ds.preferStoreType&preferTiFlash != 0 { ts.StoreType = kv.TiFlash From 264cccb2501965338b5340e549b24e691649622f Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Tue, 8 Oct 2019 14:19:22 +0800 Subject: [PATCH 6/9] fix ci --- planner/core/logical_plan_builder.go | 1 + 1 file changed, 1 insertion(+) diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index 167792a370ce0..fc05e9df0e0ea 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -2047,6 +2047,7 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, nodeType n indexNestedLoopJoinTables: INLJTables, hashJoinTables: hashJoinTables, indexHintList: indexHintList, + flashTables: tiflashTables, aggHints: aggHints, }) } From f9f8380c20454478b1fef379d9b0b407712227b1 Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Tue, 8 Oct 2019 14:42:17 +0800 Subject: [PATCH 7/9] address comments --- planner/core/exhaust_physical_plans.go | 2 +- planner/core/task.go | 28 +++++++++++++++----------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/planner/core/exhaust_physical_plans.go b/planner/core/exhaust_physical_plans.go index 1fd642a86f3bc..13afa6278bff2 100644 --- a/planner/core/exhaust_physical_plans.go +++ b/planner/core/exhaust_physical_plans.go @@ -464,7 +464,7 @@ func (p *LogicalJoin) getIndexJoinByOuterIdx(prop *property.PhysicalProperty, ou } ds, isDataSource := innerChild.(*DataSource) us, isUnionScan := innerChild.(*LogicalUnionScan) - if (!isDataSource && !isUnionScan) || (isDataSource && ds.preferStoreType&preferTiFlash != 0) { + if (!isDataSource && !isUnionScan) || ds.preferStoreType&preferTiFlash != 0 { return nil } if isUnionScan { diff --git a/planner/core/task.go b/planner/core/task.go index 85b58c3f44c87..545e38a20f800 100644 --- a/planner/core/task.go +++ b/planner/core/task.go @@ -999,12 +999,7 @@ func (p *PhysicalStreamAgg) attach2Task(tasks ...task) task { inputRows := t.count() if cop, ok := t.(*copTask); ok { // copToFlash means whether the cop task is run on flash storage - copToFlash := false - if cop.tablePlan != nil { - if ts, ok := cop.tablePlan.(*PhysicalTableScan); ok { - copToFlash = ts.StoreType == kv.TiFlash - } - } + copToFlash := isFlashCopTask(cop) partialAgg, finalAgg := p.newPartialAggregate(copToFlash) if partialAgg != nil { if cop.tablePlan != nil { @@ -1060,17 +1055,26 @@ func (p *PhysicalHashAgg) cpuCostDivisor(hasDistinct bool) (float64, float64) { return math.Min(float64(finalCon), float64(partialCon)), float64(finalCon + partialCon) } +func isFlashCopTask(cop *copTask) bool { + if cop.tablePlan == nil { + return false + } + tp := cop.tablePlan + for len(tp.Children()) > 0 { + tp = tp.Children()[0] + } + if ts, ok := tp.(*PhysicalTableScan); ok { + return ts.StoreType == kv.TiFlash + } + return false +} + func (p *PhysicalHashAgg) attach2Task(tasks ...task) task { t := tasks[0].copy() inputRows := t.count() if cop, ok := t.(*copTask); ok { // copToFlash means whether the cop task is running on flash storage - copToFlash := false - if cop.tablePlan != nil { - if ts, ok := cop.tablePlan.(*PhysicalTableScan); ok { - copToFlash = ts.StoreType == kv.TiFlash - } - } + copToFlash := isFlashCopTask(cop) partialAgg, finalAgg := p.newPartialAggregate(copToFlash) if partialAgg != nil { if cop.tablePlan != nil { From d5809192122ffbdc446816d3ec0ea8483bfec849 Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Tue, 8 Oct 2019 15:05:21 +0800 Subject: [PATCH 8/9] fix ci --- planner/core/exhaust_physical_plans.go | 8 +++++++- planner/core/testdata/integration_suite_out.json | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/planner/core/exhaust_physical_plans.go b/planner/core/exhaust_physical_plans.go index 13afa6278bff2..5cb2a3ed67774 100644 --- a/planner/core/exhaust_physical_plans.go +++ b/planner/core/exhaust_physical_plans.go @@ -464,7 +464,7 @@ func (p *LogicalJoin) getIndexJoinByOuterIdx(prop *property.PhysicalProperty, ou } ds, isDataSource := innerChild.(*DataSource) us, isUnionScan := innerChild.(*LogicalUnionScan) - if (!isDataSource && !isUnionScan) || ds.preferStoreType&preferTiFlash != 0 { + if (!isDataSource && !isUnionScan) || (isDataSource && ds.preferStoreType&preferTiFlash != 0) { return nil } if isUnionScan { @@ -473,6 +473,12 @@ func (p *LogicalJoin) getIndexJoinByOuterIdx(prop *property.PhysicalProperty, ou if !isDataSource { return nil } + // If one of the union scan children is a TiFlash table, then we can't choose index join. + for _, child := range us.Children() { + if ds, ok := child.(*DataSource); ok && ds.preferStoreType&preferTiFlash != 0 { + return nil + } + } } var avgInnerRowCnt float64 if outerChild.statsInfo().RowCount > 0 { diff --git a/planner/core/testdata/integration_suite_out.json b/planner/core/testdata/integration_suite_out.json index 14cb156fccd8e..f89881a048a1a 100644 --- a/planner/core/testdata/integration_suite_out.json +++ b/planner/core/testdata/integration_suite_out.json @@ -52,12 +52,12 @@ "Plan": [ "HashLeftJoin_8 9990.00 root inner join, inner:Selection_13, equal:[eq(Column#1, Column#4)]", "├─TableReader_12 9990.00 root data:Selection_11", - "│ └─Selection_11 9990.00 cop not(isnull(Column#1))", - "│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", + "│ └─Selection_11 9990.00 cop[tikv] not(isnull(Column#1))", + "│ └─TableScan_10 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo", "└─Selection_13 7992.00 root from_unixtime(cast(Column#5))", " └─TableReader_16 9990.00 root data:Selection_15", - " └─Selection_15 9990.00 cop not(isnull(Column#4))", - " └─TableScan_14 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo" + " └─Selection_15 9990.00 cop[tikv] not(isnull(Column#4))", + " └─TableScan_14 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo" ] } ] From e0f347b51913ce957e7b16c80e427544d781c8be Mon Sep 17 00:00:00 2001 From: lzmhhh123 Date: Fri, 11 Oct 2019 11:30:44 +0800 Subject: [PATCH 9/9] address comment --- planner/core/common_plans.go | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/planner/core/common_plans.go b/planner/core/common_plans.go index 61c8c84c4702d..93d0e5bba7bad 100644 --- a/planner/core/common_plans.go +++ b/planner/core/common_plans.go @@ -671,7 +671,10 @@ func (e *Explain) RenderResult() error { switch strings.ToLower(e.Format) { case ast.ExplainFormatROW: e.explainedPlans = map[int]bool{} - e.explainPlanInRowFormat(e.TargetPlan, "root", "", true) + err := e.explainPlanInRowFormat(e.TargetPlan, "root", "", true) + if err != nil { + return err + } case ast.ExplainFormatDOT: e.prepareDotInfo(e.TargetPlan.(PhysicalPlan)) default: @@ -681,7 +684,7 @@ func (e *Explain) RenderResult() error { } // explainPlanInRowFormat generates explain information for root-tasks. -func (e *Explain) explainPlanInRowFormat(p Plan, taskType, indent string, isLastChild bool) { +func (e *Explain) explainPlanInRowFormat(p Plan, taskType, indent string, isLastChild bool) (err error) { e.prepareOperatorInfo(p, taskType, indent, isLastChild) e.explainedPlans[p.ID()] = true @@ -693,7 +696,10 @@ func (e *Explain) explainPlanInRowFormat(p Plan, taskType, indent string, isLast if e.explainedPlans[child.ID()] { continue } - e.explainPlanInRowFormat(child, taskType, childIndent, i == len(physPlan.Children())-1) + err = e.explainPlanInRowFormat(child, taskType, childIndent, i == len(physPlan.Children())-1) + if err != nil { + return + } } } @@ -706,42 +712,44 @@ func (e *Explain) explainPlanInRowFormat(p Plan, taskType, indent string, isLast case kv.TiFlash: storeType = "tiflash" default: - storeType = "unknown" + err = errors.Errorf("the store type %v is unknown", x.StoreType) + return } - e.explainPlanInRowFormat(x.tablePlan, "cop["+storeType+"]", childIndent, true) + err = e.explainPlanInRowFormat(x.tablePlan, "cop["+storeType+"]", childIndent, true) case *PhysicalIndexReader: - e.explainPlanInRowFormat(x.indexPlan, "cop[tikv]", childIndent, true) + err = e.explainPlanInRowFormat(x.indexPlan, "cop[tikv]", childIndent, true) case *PhysicalIndexLookUpReader: - e.explainPlanInRowFormat(x.indexPlan, "cop[tikv]", childIndent, false) - e.explainPlanInRowFormat(x.tablePlan, "cop[tikv]", childIndent, true) + err = e.explainPlanInRowFormat(x.indexPlan, "cop[tikv]", childIndent, false) + err = e.explainPlanInRowFormat(x.tablePlan, "cop[tikv]", childIndent, true) case *PhysicalIndexMergeReader: for i := 0; i < len(x.partialPlans); i++ { if x.tablePlan == nil && i == len(x.partialPlans)-1 { - e.explainPlanInRowFormat(x.partialPlans[i], "cop[tikv]", childIndent, true) + err = e.explainPlanInRowFormat(x.partialPlans[i], "cop[tikv]", childIndent, true) } else { - e.explainPlanInRowFormat(x.partialPlans[i], "cop[tikv]", childIndent, false) + err = e.explainPlanInRowFormat(x.partialPlans[i], "cop[tikv]", childIndent, false) } } if x.tablePlan != nil { - e.explainPlanInRowFormat(x.tablePlan, "cop[tikv]", childIndent, true) + err = e.explainPlanInRowFormat(x.tablePlan, "cop[tikv]", childIndent, true) } case *Insert: if x.SelectPlan != nil { - e.explainPlanInRowFormat(x.SelectPlan, "root", childIndent, true) + err = e.explainPlanInRowFormat(x.SelectPlan, "root", childIndent, true) } case *Update: if x.SelectPlan != nil { - e.explainPlanInRowFormat(x.SelectPlan, "root", childIndent, true) + err = e.explainPlanInRowFormat(x.SelectPlan, "root", childIndent, true) } case *Delete: if x.SelectPlan != nil { - e.explainPlanInRowFormat(x.SelectPlan, "root", childIndent, true) + err = e.explainPlanInRowFormat(x.SelectPlan, "root", childIndent, true) } case *Execute: if x.Plan != nil { - e.explainPlanInRowFormat(x.Plan, "root", childIndent, true) + err = e.explainPlanInRowFormat(x.Plan, "root", childIndent, true) } } + return } // prepareOperatorInfo generates the following information for every plan: