我有我在哪裏存儲我的數據庫的音樂,音樂是不同的語言,所以我排序與列song_language。表結構的歌曲是這樣mysql的explain輸出不正確
非常簡單的表結構id title song_language
我有100萬首不同的語言大約歌曲,但是當我試圖篩選出它掃描特定語言的所有歌曲。如果我說song_language =「工程」,它會掃描所有歌曲500000然而,我想只有3首歌曲和我的專欄song_language是很好的索引。這裏是我的查詢
SELECT * FROM tableA WHERE song_language='Eng' limit 6
需要0.0009秒來執行,所以我很高興,但解釋說,一些訂單後
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tableA ref song_language song_language 167 const 462591 Using where
輸出相差
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tableA ref song_language primary 4 null 11 Using where
,所以我認爲這是不使用索引,當我執行這個查詢需要對我的公關0.0035秒爲了不被只用了0.0009秒
任何人都可以給一些光在這個陌生的解釋輸出evious查詢?
@FathahRehmanP是的,我知道爲什麼üHV疑問 – wayenjoy 2013-02-23 04:58:46