mysql> explain select * from kaxi_art where verify=1 and img is not null order by id desc limit 5;
+----+-------------+----------+-------+---------------+------+---------+------+--------+-----------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------+-------+---------------+------+---------+------+--------+-----------------------------+
| 1 | SIMPLE | kaxi_art | range | img | img | 153 | NULL | 178664 | Using where; Using filesort |
+----+-------------+----------+-------+---------------+------+---------+------+--------+-----------------------------+img索引是index:
img
verify
id
或者你的索引创建根本不对。你需要的索引是复合索引 (verify,img ,id)
可能是 order by id desc引起的。