MySQL explain指令中type为index的第二个场景是什么?

对于explain指令中type为index的第二个场景不清楚
image.png

想要问一下第二种情况发生的具体场景。
最后想问一下“MySQL can use this join type when the query uses only columns that are part of a single index.”这句话。我现在有以下场景:

create table t1(
  f1 int not null,
  f2 int not null,
  f3 int not null,
  primary key(f1),
  index f(f2, f3));

mysql> explain select * from t1;
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | partitions | type  | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t1    | NULL       | index | NULL          | f    | 8       | NULL |    4 |   100.00 | Using index |
+----+-------------+-------+------------+-------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

这里查询的是f1,f2,f3只有f2,f3是属于一个联合查询的,那么为什么这个type还是index,是我对上面这句话理解错误了吗。请大佬们帮助我一下。

阅读 374
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题