请教为什么能使用到索引

索引: create index idx_stuno_name_age on student(stuno,name,age);
查询分析:

mysql> explain select * from student where name='abc' order by stuno limit 10;
+----+-------------+---------+------------+-------+---------------+--------------------+---------+------+------+----------+-------------+
| id | select_type | table   | partitions | type  | possible_keys | key                | key_len | ref  | rows | filtered | Extra       |
+----+-------------+---------+------------+-------+---------------+--------------------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | student | NULL       | index | NULL          | idx_stuno_name_age | 72      | NULL |   10 |    10.00 | Using where |
+----+-------------+---------+------------+-------+---------------+--------------------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

按照sql的执行顺序,应该是先执行where然后执行order by,然后索引的顺序为(stuno,name,age),这样不遵循最左前缀原则啊,想请教为什么还是能用上索引?

因为你创建了联合索引

执行order by stuno的时候走了索引
执行where的时候没有使用索引
你可以把order by stuno去掉看一下,这个时候就不走索引了