EXPLAIN EXTENDED SELECT `board` . *
FROM `board`
WHERE `board`.`category_id` = '5'
AND `board`.`board_id` = '0'
AND `board`.`display` = '1'
ORDER BY `board`.`order` ASC
上述查询的输出为:
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE board ref category_id_2 category_id_2 9 const,const,const 4 100.00 Using where
我有点困惑,因为我有一个索引,包含在查询中使用的列,而且这些列的顺序与查询中使用的顺序相同...
category_id_2 BTREE No No
category_id 33 A
board_id 33 A
display 33 A
order 66 A
Using where; Using index
是什么意思?也许你可以回答这个问题:http://stackoverflow.com/questions/41620312/mysql-not-picking-correct-row-count-from-index - Nikhil Sahu