Slide 25
Slide 25 text
Copyright ©2022 PingCAP. All Rights Reserved.
mysql> explain select min(id) from t1;
+--------------------------------------+-------------+-------------------------------------+-----------------------------------+
| id | estRows | task | access object | operator info |
+--------------------------------------+------------+--------------------------------------+-----------------------------------+
| StreamAgg_10 | 1.00 | root | | funcs:min(test.t1.id)->Column#6 |
| └─Limit_15 | 1.00 | root | | offset:0, count:1 |
| └─IndexReader_25 | 1.00 | root | | index:Limit_24 |
| └─Limit_24 | 1.00 | cop[tikv] | | offset:0, count:1 |
| └─IndexFullScan_23 | 1.00 | cop[tikv] | table:t1, index:t1_ind_id(id) | keep order:true |
+--------------------------------------+------------+--------------------------------------+-----------------------------------+
mysql> explain select min(c1) from t1;
+-----------------------------+----------------------------+-----------------------------+---------------------------------------+
| id | estRows | task | access object | operator info |
+-----------------------------+----------------------------+-----------------------------+---------------------------------------+
| StreamAgg_10 | 1.00 | root | | funcs:min(test.t1.c1)->Column#6 |
| └─TopN_11 | 1.00 | root | | test.t1.c1, offset:0, count:1 |
| └─TableReader_21 | 1.00 | root | | data:TopN_20 |
| └─TopN_20 | 1.00 | cop[tikv] | | test.t1.c1, offset:0, count:1 |
| └─Selection_19 | 2557440.00 | cop[tikv] | | not(isnull(test.t1.c1)) |
| └─TableFullScan_18 | 2560000.00 | cop[tikv] | table:t1 | keep order:false |
+-----------------------------+----------------------------+-----------------------------+---------------------------------------+
Index Full Scan(2)
Use Index
Not Use Index