# Index Full Scan（B）
```7
/* Index Used */
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                 |
+------------------------------+---------+-----------+-------------------------------+---------------------------------+
5 rows in set (0.16 sec)

/* Index NOT Used */
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                |
+--------------------------------+------------+-----------+---------------+---------------------------------+
6 rows in set (0.01 sec)
```

-------------------------------------------------------------

在这个例子中，TiDB 在每一个 TiKV Region 上执行  IndexFullScan 操作。在 min(id) 的例子中，虽然算子名为 FullScan 即全扫描，但是 TiDB只读取了第一行，我们可以看到一个 limit_24 算子。每个 TiKV 返回各自的 min 值给 TiDB，TiDB 在执行流汇聚过滤出一行数据。

而在后面的例子中，没有索引时，min 函数会在 TiKV 上做 table full scan 的操作。查询会扫描 TiKV 上的所有行。但是由于 TopN 算子的存在，可以保证每个 TiKV 只返回一行数据给 TiDB。尽管 TopN 能减少 TiDB 和 TiKV 之间的多余数据传输，但该查询的效率仍远不及以上示例（MIN 能够使用索引）。
