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

想要问一下第二种情况发生的具体场景。
最后想问一下“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)
阅读 574
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题