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