排序字段应保持一样的顺序(逆序或者降序),则使用索引排序。否则将使用文件排序
mysql> explain select id,time from edu_text order by count desc, time desc ;
+----+-------------+----------+-------+---------------+-------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+-------+---------------+-------+---------+------+------+-------------+
| 1 | SIMPLE | edu_text | index | NULL | count | 8 | NULL | 5 | Using index |
+----+-------------+----------+-------+---------------+-------+---------+------+------+-------------+
1 row in set (0.00 sec)
mysql> explain select id,time from edu_text order by count desc, time asc ;
+----+-------------+----------+-------+---------------+-------+---------+------+------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+-------+---------------+-------+---------+------+------+-----------------------------+
| 1 | SIMPLE | edu_text | index | NULL | count | 8 | NULL | 5 | Using index; Using filesort |
+----+-------------+----------+-------+---------------+-------+---------+------+------+-----------------------------+
1 row in set (0.00 sec)