1
EXPLAIN EXTENDED SELECT `member`.`id` , `member`.`name`
FROM `member`
WHERE `member`.`last_active` > '1289348406'
儘管last_active
上有一個索引,但顯示以下輸出....應該不是說index
而不是where
?不應該使用索引而不是在哪裏?
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE member range last_active last_active 4 NULL 2 100.00 Using where
我只在1頁上使用此查詢,但它是一個非常活躍的頁面。對於這樣一個簡單的查詢,這樣做不是個好主意嗎? – Webnet 2010-11-10 00:55:30
@Webnet:做什麼? – Quassnoi 2010-11-10 01:04:34
要索引這些字段,因爲它只會影響此查詢。在這樣的查詢上創建索引是個壞主意嗎? – Webnet 2010-11-12 17:43:50