Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 3.1: port tiflash support from master to release3.1 #14537

Merged
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
49b9bb0
planner: split avg to count and sum for TableReader cop task (#11926)
lzmhhh123 Sep 2, 2019
c32ba61
*: add max/avg cop response time for TableReader, IndexReader and Ind…
lzmhhh123 Sep 11, 2019
07b1b29
tikv: make region request can send to flash store (#11652)
lzmhhh123 Sep 25, 2019
7fc76d6
executor: support table reader executor read from tiflash. (#12371)
lzmhhh123 Sep 27, 2019
3e2b38e
planner: support a hint to read from tiflash in planner (#12479)
lzmhhh123 Oct 11, 2019
1955cb5
fix test
lzmhhh123 Jan 17, 2020
7d88032
planner: fix wrong request data type when pushing down avg aggfuncs (…
wshwsh12 Sep 6, 2019
5e430b8
fix test
lzmhhh123 Jan 17, 2020
cfdff94
planner: do not convert filter to range for table scan with tiflash (…
lzmhhh123 Oct 14, 2019
5216314
planner: fix wrong full range for table scan in tiflash (#12756)
lzmhhh123 Oct 16, 2019
e1e20eb
tikv: retry region request when tiflash store not found (#12928)
lzmhhh123 Oct 28, 2019
bfc0481
*: Support LOCK/UNLOCK TABLES feature (#10343)
crazycs520 Jun 18, 2019
4310725
*: add admin cleanup table lock syntax support (#10423)
crazycs520 Jul 10, 2019
ba7777a
ddl: fix race in table lock config (#10848)
crazycs520 Jun 20, 2019
4a24368
lock: add delay clean table lock when session close (#11038)
crazycs520 Jul 4, 2019
4fc82fa
*: support the TiFlash replica of table (#12453)
crazycs520 Oct 29, 2019
f8657bd
*: refactor cost model formulas and constants (#10581)
eurekaka Aug 7, 2019
38d99c3
*: replace cost model factor constants with system variable (#12367)
eurekaka Sep 30, 2019
507d057
planner: support cost model for tiflash table scan (#12868)
lzmhhh123 Oct 29, 2019
bac96d7
planner: fix bug cost model for tiflash do not work (#13111)
lzmhhh123 Nov 4, 2019
67b66c7
planner, session: add isolation read with engine type (#12997)
lzmhhh123 Nov 1, 2019
12a9adf
planner: make hint `read_from_storage` take effect for tikv (#13578)
lzmhhh123 Nov 20, 2019
35fe5a3
planner: do not push keep descending order to tiflash (#13572)
lzmhhh123 Dec 2, 2019
df87a51
planner: prune cop task for tiflash (#13131)
windtalker Nov 7, 2019
38e586d
coprocessor: fix wrong cop task range for tiflash. (#13292)
lzmhhh123 Nov 8, 2019
1cc0836
tikv: do not refresh TiFlash work index when region is refreshed in c…
lzmhhh123 Dec 26, 2019
239a94d
planner: do not filter access paths by isolation read for `mysql.Syst…
lzmhhh123 Jan 6, 2020
11923c3
planner: fix some select condition do not filter by tiflash (#14502)
lzmhhh123 Jan 16, 2020
c9c4951
fix test
lzmhhh123 Jan 19, 2020
c270a98
fix test
lzmhhh123 Jan 19, 2020
c33ca6f
fix fmt
lzmhhh123 Jan 19, 2020
f3b9175
change parser
lzmhhh123 Feb 3, 2020
e08c970
coprocessor: add ddl schema version in request (#14317)
lzmhhh123 Jan 8, 2020
43c5b6c
change kvproto ver
lzmhhh123 Feb 3, 2020
d7221f3
fix explaintest
lzmhhh123 Feb 3, 2020
af91cf8
delete cascades integration_test
lzmhhh123 Feb 3, 2020
ed07b2a
fix tidy
lzmhhh123 Feb 3, 2020
dc57231
config: add server level isolation read config (#14440)
lzmhhh123 Jan 19, 2020
de5735a
test: fix random "IsolationRead" fails (#14615)
lzmhhh123 Feb 5, 2020
786a38c
planner: make the read storage hint not force plan (#14644)
lzmhhh123 Feb 10, 2020
a204416
fix test
lzmhhh123 Feb 11, 2020
5d4c7af
infoschema: add table_tiflash_replica table to check table tiflash re…
crazycs520 Feb 13, 2020
501334f
infosync: refactor info sync, part of (#12580),(#13899)
crazycs520 Feb 13, 2020
23410f5
*: add tiflash replica sync progress #14713
crazycs520 Feb 13, 2020
e6229a7
*: support partition table in tiflash #14735
crazycs520 Feb 13, 2020
0a46fbb
Merge branch 'release-3.1' of https://github.com/pingcap/tidb into ch…
crazycs520 Feb 13, 2020
fc0fa50
ddl: fix create table with like bug when refer table has tiflash repl…
crazycs520 Feb 13, 2020
6d3fe23
fix test
lzmhhh123 Feb 14, 2020
4bca8a2
planner: set the partition id to table id in DAG request (#14745)
lzmhhh123 Feb 14, 2020
e1bd735
coprocessor: let tiflash split range task consistent with tikv (#14710)
lzmhhh123 Feb 14, 2020
a7f0e0d
fix test
lzmhhh123 Feb 14, 2020
ebaaff0
fix filter
lzmhhh123 Feb 14, 2020
efc964d
plugin: support logging rejected connection attempts in audit log (#1…
lysu Feb 5, 2020
938b921
fix
lzmhhh123 Feb 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions bindinfo/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(test.t1.id, test.t2.id)]",
"├─TableReader_12 9990.00 root data:Selection_11",
"│ └─Selection_11 9990.00 cop not(isnull(test.t1.id))",
"│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"│ └─Selection_11 9990.00 cop[tikv] not(isnull(test.t1.id))",
"│ └─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(test.t2.id))",
" └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
" └─Selection_14 9990.00 cop[tikv] not(isnull(test.t2.id))",
" └─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:test.t1.id, right key:test.t2.id",
"├─Sort_11 9990.00 root test.t1.id:asc",
"│ └─TableReader_10 9990.00 root data:Selection_9",
"│ └─Selection_9 9990.00 cop not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"│ └─Selection_9 9990.00 cop[tikv] not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"└─Sort_15 9990.00 root test.t2.id:asc",
" └─TableReader_14 9990.00 root data:Selection_13",
" └─Selection_13 9990.00 cop not(isnull(test.t2.id))",
" └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
" └─Selection_13 9990.00 cop[tikv] not(isnull(test.t2.id))",
" └─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")
Expand All @@ -356,12 +356,12 @@ func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) {
"MergeJoin_7 12487.50 root inner join, left key:test.t1.id, right key:test.t2.id",
"├─Sort_11 9990.00 root test.t1.id:asc",
"│ └─TableReader_10 9990.00 root data:Selection_9",
"│ └─Selection_9 9990.00 cop not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"│ └─Selection_9 9990.00 cop[tikv] not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"└─Sort_15 9990.00 root test.t2.id:asc",
" └─TableReader_14 9990.00 root data:Selection_13",
" └─Selection_13 9990.00 cop not(isnull(test.t2.id))",
" └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
" └─Selection_13 9990.00 cop[tikv] not(isnull(test.t2.id))",
" └─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)
Expand All @@ -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(test.t1.id, test.t2.id)]",
"├─TableReader_12 9990.00 root data:Selection_11",
"│ └─Selection_11 9990.00 cop not(isnull(test.t1.id))",
"│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"│ └─Selection_11 9990.00 cop[tikv] not(isnull(test.t1.id))",
"│ └─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(test.t2.id))",
" └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
" └─Selection_14 9990.00 cop[tikv] not(isnull(test.t2.id))",
" └─TableScan_13 10000.00 cop[tikv] table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
))
}

Expand All @@ -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(test.t1.id, test.t2.id)]",
"├─TableReader_12 9990.00 root data:Selection_11",
"│ └─Selection_11 9990.00 cop not(isnull(test.t1.id))",
"│ └─TableScan_10 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"│ └─Selection_11 9990.00 cop[tikv] not(isnull(test.t1.id))",
"│ └─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(test.t2.id))",
" └─TableScan_13 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
" └─Selection_14 9990.00 cop[tikv] not(isnull(test.t2.id))",
" └─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:test.t1.id, right key:test.t2.id",
"├─Sort_11 9990.00 root test.t1.id:asc",
"│ └─TableReader_10 9990.00 root data:Selection_9",
"│ └─Selection_9 9990.00 cop not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"│ └─Selection_9 9990.00 cop[tikv] not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"└─Sort_15 9990.00 root test.t2.id:asc",
" └─TableReader_14 9990.00 root data:Selection_13",
" └─Selection_13 9990.00 cop not(isnull(test.t2.id))",
" └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
" └─Selection_13 9990.00 cop[tikv] not(isnull(test.t2.id))",
" └─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")
Expand All @@ -417,12 +417,12 @@ func (s *testSuite) TestExplain(c *C) {
"MergeJoin_7 12487.50 root inner join, left key:test.t1.id, right key:test.t2.id",
"├─Sort_11 9990.00 root test.t1.id:asc",
"│ └─TableReader_10 9990.00 root data:Selection_9",
"│ └─Selection_9 9990.00 cop not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"│ └─Selection_9 9990.00 cop[tikv] not(isnull(test.t1.id))",
"│ └─TableScan_8 10000.00 cop[tikv] table:t1, range:[-inf,+inf], keep order:false, stats:pseudo",
"└─Sort_15 9990.00 root test.t2.id:asc",
" └─TableReader_14 9990.00 root data:Selection_13",
" └─Selection_13 9990.00 cop not(isnull(test.t2.id))",
" └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
" └─Selection_13 9990.00 cop[tikv] not(isnull(test.t2.id))",
" └─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")
Expand Down
27 changes: 13 additions & 14 deletions cmd/explaintest/r/access_path_selection.result
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ 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
IndexLookUp_7 3323.33 root
├─IndexScan_5 3323.33 cop table:access_path_selection, index:b, range:[-inf,3), keep order:false, stats:pseudo
└─TableScan_6 3323.33 cop table:access_path_selection, keep order:false, stats:pseudo
IndexReader_10 3323.33 root index:Selection_9
└─Selection_9 3323.33 cop[tikv] lt(test.access_path_selection.b, 3)
└─IndexScan_8 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(test.access_path_selection.b, 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(test.access_path_selection.b, 3)
└─IndexScan_9 3323.33 cop[tikv] table:access_path_selection, index:a, b, range:[-inf,3), keep order:false, stats:pseudo
CREATE TABLE `outdated_statistics` (
`a` int,
`b` int,
Expand All @@ -40,19 +40,18 @@ insert into outdated_statistics values (1, 3, 3);
analyze table outdated_statistics index idx_ab;
explain select * from outdated_statistics where a=1 and b=1 and c=1;
id count task operator info
IndexLookUp_11 0.00 root
├─IndexScan_8 1.00 cop table:outdated_statistics, index:a, b, range:[1 1,1 1], keep order:false
└─Selection_10 0.00 cop eq(test.outdated_statistics.c, 1)
└─TableScan_9 1.00 cop table:outdated_statistics, keep order:false
TableReader_7 0.00 root data:Selection_6
└─Selection_6 0.00 cop[tikv] eq(test.outdated_statistics.a, 1), eq(test.outdated_statistics.b, 1), eq(test.outdated_statistics.c, 1)
└─TableScan_5 6.00 cop[tikv] table:outdated_statistics, range:[-inf,+inf], keep order:false
explain select a, b from access_path_selection order by _tidb_rowid;
id count task operator info
Projection_5 10000.00 root test.access_path_selection.a, test.access_path_selection.b
└─TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop table:access_path_selection, range:[-inf,+inf], keep order:true, stats:pseudo
└─TableScan_10 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(test.access_path_selection._tidb_rowid)
└─Limit_17 1.00 root offset:0, count:1
└─TableReader_42 1.00 root data:Limit_41
└─Limit_41 1.00 cop offset:0, count:1
└─TableScan_40 1.25 cop table:access_path_selection, range:[-inf,+inf], keep order:true, desc, stats:pseudo
└─Limit_41 1.00 cop[tikv] offset:0, count:1
└─TableScan_40 1.25 cop[tikv] table:access_path_selection, range:[-inf,+inf], keep order:true, desc, stats:pseudo
57 changes: 57 additions & 0 deletions cmd/explaintest/r/access_tiflash.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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_16 1.00 root funcs:avg(col_0, col_1)
└─IndexReader_17 1.00 root index:StreamAgg_8
└─StreamAgg_8 1.00 cop[tikv] funcs:avg(test.t.a)
└─IndexScan_15 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(col_0, col_1)
└─TableReader_17 1.00 root data:StreamAgg_8
└─StreamAgg_8 1.00 cop[tiflash] funcs:count(test.t.a), sum(test.t.a)
└─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(col_0)
└─TableReader_17 1.00 root data:StreamAgg_8
└─StreamAgg_8 1.00 cop[tiflash] funcs:sum(test.t.a)
└─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(col_0)
└─TableReader_17 1.00 root data:StreamAgg_8
└─StreamAgg_8 1.00 cop[tiflash] funcs:sum(plus(test.t.a, 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(col_0)
└─TableReader_17 1.00 root data:StreamAgg_8
└─StreamAgg_8 1.00 cop[tiflash] funcs:sum(isnull(test.t.a))
└─TableScan_15 10000.00 cop[tiflash] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
create table tt(a int, b int, primary key(a));
desc select * from tt where (tt.a > 1 and tt.a < 20) or (tt.a >= 30 and tt.a < 55);
id count task operator info
TableReader_6 44.00 root data:TableScan_5
└─TableScan_5 44.00 cop[tikv] table:tt, range:(1,20), [30,55), keep order:false, stats:pseudo
desc select /*+ read_from_storage(tiflash[tt]) */ * from tt where (tt.a > 1 and tt.a < 20) or (tt.a >= 30 and tt.a < 55);
id count task operator info
TableReader_7 44.00 root data:Selection_6
└─Selection_6 44.00 cop[tiflash] or(and(gt(test.tt.a, 1), lt(test.tt.a, 20)), and(ge(test.tt.a, 30), lt(test.tt.a, 55)))
└─TableScan_5 44.00 cop[tiflash] table:tt, range:[-inf,+inf], keep order:false, stats:pseudo
drop table if exists ttt;
create table ttt (a int, primary key (a desc));
desc select * from ttt order by ttt.a desc;
id count task operator info
TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop[tikv] table:ttt, range:[-inf,+inf], keep order:true, desc, stats:pseudo
desc select /*+ read_from_storage(tiflash[ttt]) */ * from ttt order by ttt.a desc;
id count task operator info
Sort_4 10000.00 root test.ttt.a:desc
└─TableReader_8 10000.00 root data:TableScan_7
└─TableScan_7 10000.00 cop[tiflash] table:ttt, range:[-inf,+inf], keep order:false, stats:pseudo
desc select /*+ read_from_storage(tiflash[ttt]) */ * from ttt order by ttt.a;
id count task operator info
TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop[tiflash] table:ttt, range:[-inf,+inf], keep order:true, stats:pseudo
22 changes: 11 additions & 11 deletions cmd/explaintest/r/black_list.result
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,53 @@ 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(test.t.a, 1)
└─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─Selection_6 3323.33 cop[tikv] lt(test.t.a, 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;

explain select * from t where a < 1;
id count task operator info
Selection_5 8000.00 root lt(test.t.a, 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(test.t.a, 1)
└─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─Selection_6 3323.33 cop[tikv] lt(test.t.a, 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;

explain select * from t where a < 1;
id count task operator info
Selection_5 8000.00 root lt(test.t.a, 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(test.t.a, 1)
└─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─Selection_6 3323.33 cop[tikv] lt(test.t.a, 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;

explain select * from t where a < 1;
id count task operator info
Selection_5 8000.00 root lt(test.t.a, 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(test.t.a, 1)
└─TableScan_5 10000.00 cop table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─Selection_6 3323.33 cop[tikv] lt(test.t.a, 1)
└─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
29 changes: 29 additions & 0 deletions cmd/explaintest/r/explain-non-select-stmt.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use test;
drop table if exists t;
create table t(a bigint, b bigint);
explain insert into t values(1, 1);
id count task operator info
Insert_1 N/A root N/A
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[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[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[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[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
Loading