-4
EXPLAIN 
    SELECT * FROM test_askcomment WHERE cid IN(1,2,3) ORDER BY dateline DESC;


id  select_type table   type    possible_keys   key key_len ref rows    Extra
1   SIMPLE  test_askcomment ALL PRIMARY NULL    NULL    NULL    3   Using where; Using filesort
4

1 回答 1

1
ALTER TABLE `test_askcomment ` ADD INDEX `index1` (`cid`);

ALTER TABLE `test_askcomment ` ADD INDEX `index2` (`dateline `);

尝试索引您正在使用 where 子句的列或选择列

于 2012-09-03T13:45:52.557 回答