Skip to content

Commit

Permalink
fix explain test
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Oct 30, 2018
1 parent e788281 commit fe1370c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/explaintest/r/explain_easy.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ insert into t2 values(1, 0), (2, 1);
create table t3 (a bigint, b bigint, c bigint, d bigint);
create table t4 (a int, b int, c int, index idx(a, b), primary key(a));
set @@session.tidb_opt_agg_push_down = 1;
set @@session.tidb_opt_insubq_to_join_and_agg=1;
explain select * from t3 where exists (select s.a from t3 s having sum(s.a) = t3.a );
id count task operator info
Projection_12 8000.00 root test.t3.a, test.t3.b, test.t3.c, test.t3.d
Expand Down Expand Up @@ -452,3 +453,4 @@ Projection_4 2666.67 root test.t.a
└─Selection_6 2666.67 cop gt(test.t.a, 0)
└─TableScan_5 3333.33 cop table:t, range:(0,+inf], keep order:false, stats:pseudo
drop table if exists t;
set @@session.tidb_opt_insubq_to_join_and_agg=1;
2 changes: 2 additions & 0 deletions cmd/explaintest/r/explain_easy_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ load stats 's/explain_easy_stats_t3.json';
create table index_prune(a bigint(20) NOT NULL, b bigint(20) NOT NULL, c tinyint(4) NOT NULL, primary key(a, b), index idx_b_c_a(b, c, a));
load stats 's/explain_easy_stats_index_prune.json';
set @@session.tidb_opt_agg_push_down = 1;
set @@session.tidb_opt_insubq_to_join_and_agg=1;
explain select * from t3 where exists (select s.a from t3 s having sum(s.a) = t3.a );
id count task operator info
Projection_12 1600.00 root test.t3.a, test.t3.b, test.t3.c, test.t3.d
Expand Down Expand Up @@ -190,3 +191,4 @@ explain select * from index_prune WHERE a = 1010010404050976781 AND b = 26467085
id count task operator info
Point_Get_1 1.00 root table:index_prune, index:a b
drop table if exists t1, t2, t3, index_prune;
set @@session.tidb_opt_insubq_to_join_and_agg=1;
2 changes: 2 additions & 0 deletions cmd/explaintest/t/explain_easy.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ create table t3 (a bigint, b bigint, c bigint, d bigint);
create table t4 (a int, b int, c int, index idx(a, b), primary key(a));

set @@session.tidb_opt_agg_push_down = 1;
set @@session.tidb_opt_insubq_to_join_and_agg=1;

explain select * from t3 where exists (select s.a from t3 s having sum(s.a) = t3.a );
explain select * from t1;
Expand Down Expand Up @@ -99,3 +100,4 @@ explain select * from t where _tidb_rowid > 0;
explain select a, _tidb_rowid from t where a > 0;
explain select * from t where _tidb_rowid > 0 and a > 0;
drop table if exists t;
set @@session.tidb_opt_insubq_to_join_and_agg=1;
2 changes: 2 additions & 0 deletions cmd/explaintest/t/explain_easy_stats.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ load stats 's/explain_easy_stats_t3.json';
create table index_prune(a bigint(20) NOT NULL, b bigint(20) NOT NULL, c tinyint(4) NOT NULL, primary key(a, b), index idx_b_c_a(b, c, a));
load stats 's/explain_easy_stats_index_prune.json';
set @@session.tidb_opt_agg_push_down = 1;
set @@session.tidb_opt_insubq_to_join_and_agg=1;


explain select * from t3 where exists (select s.a from t3 s having sum(s.a) = t3.a );
Expand Down Expand Up @@ -56,3 +57,4 @@ explain select * from index_prune WHERE a = 1010010404050976781 AND b = 26467085
explain select * from index_prune WHERE a = 1010010404050976781 AND b = 26467085526790 GROUP BY b ORDER BY a limit 1;

drop table if exists t1, t2, t3, index_prune;
set @@session.tidb_opt_insubq_to_join_and_agg=1;

0 comments on commit fe1370c

Please sign in to comment.