Skip to content

Commit

Permalink
planner: distinguish FullScan and the RangeScan in explain/desc info (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsqlu authored Feb 24, 2020
1 parent d9eab62 commit 3399f4b
Show file tree
Hide file tree
Showing 44 changed files with 2,514 additions and 2,369 deletions.
18 changes: 9 additions & 9 deletions cmd/explaintest/r/access_path_selection.result
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,38 @@ 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[tikv] table:access_path_selection, index:a, range:[-inf,3), keep order:false, stats:pseudo
IndexReader_6 3323.33 root index:IndexRangeScan_5
└─IndexRangeScan_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[tikv] table:access_path_selection, index:a, b, range:[-inf,3), keep order:false, stats:pseudo
IndexReader_6 3323.33 root index:IndexRangeScan_5
└─IndexRangeScan_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
TableReader_7 3323.33 root data:Selection_6
└─Selection_6 3323.33 cop[tikv] lt(test.access_path_selection.b, 3)
└─TableScan_5 10000.00 cop[tikv] table:access_path_selection, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_5 10000.00 cop[tikv] table:access_path_selection, 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[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
└─IndexRangeScan_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 test.access_path_selection.a, test.access_path_selection.b
└─TableReader_13 3333.33 root data:Selection_12
└─Selection_12 3333.33 cop[tikv] gt(test.access_path_selection.a, 10)
└─TableScan_11 10000.00 cop[tikv] table:access_path_selection, range:[-inf,+inf], keep order:true, stats:pseudo
└─TableFullScan_11 10000.00 cop[tikv] table:access_path_selection, 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)->Column#4
└─Limit_17 1.00 root offset:0, count:1
└─TableReader_27 1.00 root data:Limit_26
└─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
└─TableFullScan_25 1.25 cop[tikv] table:access_path_selection, 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#18)->Column#4
└─TableReader_29 1.00 root data:StreamAgg_8
└─StreamAgg_8 1.00 cop[tikv] funcs:count(1)->Column#18
└─TableScan_24 10000.00 cop[tikv] table:access_path_selection, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_24 10000.00 cop[tikv] table:access_path_selection, keep order:false, stats:pseudo
20 changes: 10 additions & 10 deletions cmd/explaintest/r/black_list.result
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,52 @@ 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[tikv] lt(test.t.a, 1)
└─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_5 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 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[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_7 10000.00 root data:TableFullScan_6
└─TableFullScan_6 10000.00 cop[tikv] table:t, 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[tikv] lt(test.t.a, 1)
└─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_5 10000.00 cop[tikv] table:t, 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[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_7 10000.00 root data:TableFullScan_6
└─TableFullScan_6 10000.00 cop[tikv] table:t, 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[tikv] lt(test.t.a, 1)
└─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_5 10000.00 cop[tikv] table:t, 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[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_7 10000.00 root data:TableFullScan_6
└─TableFullScan_6 10000.00 cop[tikv] table:t, 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[tikv] lt(test.t.a, 1)
└─TableScan_5 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_5 10000.00 cop[tikv] table:t, keep order:false, stats:pseudo
12 changes: 6 additions & 6 deletions cmd/explaintest/r/explain-non-select-stmt.result
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ 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
└─TableReader_7 10000.00 root data:TableFullScan_6
└─TableFullScan_6 10000.00 cop[tikv] table:t, keep order:false, stats:pseudo
explain delete from t where a > 100;
id count task operator info
Delete_4 N/A root N/A
└─TableReader_8 3333.33 root data:Selection_7
└─Selection_7 3333.33 cop[tikv] gt(test.t.a, 100)
└─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_6 10000.00 cop[tikv] table:t, keep order:false, stats:pseudo
explain update t set b = 100 where a = 200;
id count task operator info
Update_4 N/A root N/A
└─TableReader_8 10.00 root data:Selection_7
└─Selection_7 10.00 cop[tikv] eq(test.t.a, 200)
└─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableFullScan_6 10000.00 cop[tikv] table:t, 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 test.t.a, 100->Column#6
└─TableReader_7 10000.00 root data:TableScan_6
└─TableScan_6 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_7 10000.00 root data:TableFullScan_6
└─TableFullScan_6 10000.00 cop[tikv] table:t, keep order:false, stats:pseudo
8 changes: 4 additions & 4 deletions cmd/explaintest/r/explain.result
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ explain select group_concat(a) from t group by id;
id count task operator info
StreamAgg_8 8000.00 root group by:Column#6, funcs:group_concat(Column#5, ",")->Column#4
└─Projection_18 10000.00 root cast(test.t.a)->Column#5, test.t.id
└─TableReader_15 10000.00 root data:TableScan_14
└─TableScan_14 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:true, stats:pseudo
└─TableReader_15 10000.00 root data:TableFullScan_14
└─TableFullScan_14 10000.00 cop[tikv] table:t, 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#7, funcs:group_concat(Column#5, Column#6, ",")->Column#4
└─Projection_18 10000.00 root cast(test.t.a)->Column#5, cast(test.t.b)->Column#6, test.t.id
└─TableReader_15 10000.00 root data:TableScan_14
└─TableScan_14 10000.00 cop[tikv] table:t, range:[-inf,+inf], keep order:true, stats:pseudo
└─TableReader_15 10000.00 root data:TableFullScan_14
└─TableFullScan_14 10000.00 cop[tikv] table:t, keep order:true, stats:pseudo
drop table t;
Loading

0 comments on commit 3399f4b

Please sign in to comment.