?????????????????????????λ????????
????MySQL ??????????????????????????? my.cnf ???????slow_query_log ?????”On”?? ???? long_query_time ????????????β??????????????????????????? 0.2??slow_query_log_file ???????????????????·??????????????????????????趨????????????????????С?
?????????λ??Щ???????????????????????MySQL????EXPLAIN????????????SELECT??DELETE??INSERT??REPLACE??UPDATE????????á??????????????????????????
????EXPLAIN SELECT picture.id?? picture.title
????FROM picture
????LEFT JOIN album ON picture.album_id = album.id?WHERE album.user_id = 1;
????????????????????????????д???????????????????

??????????????????key?????????????????????

???????????????picture??2?????У??????picture????????album??2???С???ζ????ò??????????album??400???С??????????????Ч??
????????
??????????????????????????????????????е???????????????????????????β?????????????????????????????λ??
???????????????????????????衣??????picture.album_id???????????
????ALTER TABLE picture ADD INDEX(album_id);
??????????в???????????????picture?б????????????е?album?????????????????????album????????album_id???????????λ?????picture?????????????????20?????????????317????

???????????·?????????????????????????????????
????ALTER TABLE album ADD INDEX(user_id);

??????Σ?album??????????裬???user_id??????????λ?????album???????100??album?????????album_id??????picture???????????????????????????????в?????????????????????????380????
?????????????ζ?????????????????????????????д??????????????????????????????????????д???????????????????????????????????????????EXPLAIN????????????????????????????