Skip to content

Commit

Permalink
explaintest: use a separate database for each case
Browse files Browse the repository at this point in the history
  • Loading branch information
Defined2014 committed Aug 28, 2023
1 parent 2163271 commit 28538ba
Show file tree
Hide file tree
Showing 33 changed files with 508 additions and 545 deletions.
15 changes: 7 additions & 8 deletions cmd/explaintest/r/black_list.result
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
set tidb_cost_model_version=1;
use test;
drop table if exists t;
create table t (a int);
explain format = 'brief' select * from t where a < 1;
id estRows task access object operator info
TableReader 3323.33 root data:Selection
└─Selection 3323.33 cop[tikv] lt(test.t.a, 1)
└─Selection 3323.33 cop[tikv] lt(black_list.t.a, 1)
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
insert into mysql.opt_rule_blacklist values('predicate_push_down');
admin reload opt_rule_blacklist;

explain format = 'brief' select * from t where a < 1;
id estRows task access object operator info
Selection 8000.00 root lt(test.t.a, 1)
Selection 8000.00 root lt(black_list.t.a, 1)
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
delete from mysql.opt_rule_blacklist where name='predicate_push_down';
Expand All @@ -21,14 +20,14 @@ admin reload opt_rule_blacklist;
explain format = 'brief' select * from t where a < 1;
id estRows task access object operator info
TableReader 3323.33 root data:Selection
└─Selection 3323.33 cop[tikv] lt(test.t.a, 1)
└─Selection 3323.33 cop[tikv] lt(black_list.t.a, 1)
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
insert into mysql.expr_pushdown_blacklist values('<', 'tikv,tiflash,tidb', 'for test');
admin reload expr_pushdown_blacklist;

explain format = 'brief' select * from t where a < 1;
id estRows task access object operator info
Selection 8000.00 root lt(test.t.a, 1)
Selection 8000.00 root lt(black_list.t.a, 1)
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
delete from mysql.expr_pushdown_blacklist where name='<' and store_type = 'tikv,tiflash,tidb' and reason = 'for test';
Expand All @@ -37,14 +36,14 @@ admin reload expr_pushdown_blacklist;
explain format = 'brief' select * from t where a < 1;
id estRows task access object operator info
TableReader 3323.33 root data:Selection
└─Selection 3323.33 cop[tikv] lt(test.t.a, 1)
└─Selection 3323.33 cop[tikv] lt(black_list.t.a, 1)
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
insert into mysql.expr_pushdown_blacklist values('lt', 'tikv,tiflash,tidb', 'for test');
admin reload expr_pushdown_blacklist;

explain format = 'brief' select * from t where a < 1;
id estRows task access object operator info
Selection 8000.00 root lt(test.t.a, 1)
Selection 8000.00 root lt(black_list.t.a, 1)
└─TableReader 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
delete from mysql.expr_pushdown_blacklist where name='lt' and store_type = 'tikv,tiflash,tidb' and reason = 'for test';
Expand All @@ -53,5 +52,5 @@ admin reload expr_pushdown_blacklist;
explain format = 'brief' select * from t where a < 1;
id estRows task access object operator info
TableReader 3323.33 root data:Selection
└─Selection 3323.33 cop[tikv] lt(test.t.a, 1)
└─Selection 3323.33 cop[tikv] lt(black_list.t.a, 1)
└─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo
2 changes: 0 additions & 2 deletions cmd/explaintest/r/collation_agg_func_disabled.result
Original file line number Diff line number Diff line change
Expand Up @@ -298,5 +298,3 @@ StreamAgg 1.00 root funcs:max(Column#8)->Column#6
select max(d collate utf8mb4_bin) from tt;
max(d collate utf8mb4_bin)
{"c": "c"}
drop database collation_agg_func;
use test
2 changes: 0 additions & 2 deletions cmd/explaintest/r/collation_agg_func_enabled.result
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,3 @@ StreamAgg 1.00 root funcs:max(Column#8)->Column#6
select max(d collate utf8mb4_bin) from tt;
max(d collate utf8mb4_bin)
{"c": "c"}
drop database collation_agg_func;
use test
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,3 @@ Projection 80000000.00 root is_ipv4(cast(collation_check_use_collation.t0.c1, v
│ └─TableFullScan 10000.00 cop[tikv] table:t0 keep order:false, stats:pseudo
└─TableReader(Probe) 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
use test
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,3 @@ Projection 80000000.00 root is_ipv4(cast(collation_check_use_collation.t0.c1, v
│ └─TableFullScan 10000.00 cop[tikv] table:t0 keep order:false, stats:pseudo
└─TableReader(Probe) 10000.00 root data:TableFullScan
└─TableFullScan 10000.00 cop[tikv] table:t1 keep order:false, stats:pseudo
use test
1 change: 0 additions & 1 deletion cmd/explaintest/r/collation_misc_disabled.result
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,3 @@ binary binary 63 Yes Yes 1
ascii_bin ascii 65 Yes Yes 1
utf8_bin utf8 83 Yes Yes 1
gbk_bin gbk 87 Yes Yes 1
use test;
1 change: 0 additions & 1 deletion cmd/explaintest/r/collation_misc_enabled.result
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,3 @@ utf8mb4_0900_bin utf8mb4 309 Yes 1
utf8mb4_bin utf8mb4 46 Yes Yes 1
utf8mb4_general_ci utf8mb4 45 Yes 1
utf8mb4_unicode_ci utf8mb4 224 Yes 1
use test;
Loading

0 comments on commit 28538ba

Please sign in to comment.