- 论坛徽章:
- 0
|
是的,我把 order by ordinal, mtime desc改成 order by ordinal, mtime asc后,没有文件排序了。
可是问题是我需要 order by ordinal, mtime desc这样取数据
这样是不是意味着uid_2索引没有任何作用
explain SELECT SQL_CALC_FOUND_ROWS * FROM table_name WHERE uid = '100055' order by ordinal, mtime asc LIMIT 0, 100;
+----+-------------+----------------+------+-----------------+-------+---------+-------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------------+------+-----------------+-------+---------+-------+------+-------------+
| 1 | SIMPLE | table_name | ref | uid,uid_2 | uid_2 | 4 | const | 34 | Using where |
+----+-------------+----------------+------+-----------------+-------+---------+-------+------+-------------+ |
|