???mysql?????????????
?????С???? ???????[ 2017/6/30 15:34:59 ] ????????mySQL ?????
???????????????????裺
????1. ??????????????
?????????????????????????sql???????????????????????????????????£?
????1. show variables like '%slow_query_log%'; ?????????????????????
????2. set global slow_query_log=1; ??????????????
????2. ??explain ????sql ???
????ps: explain select * from temp ?????????????
??????????????????????????????????????? ????????????????(type??key??ref??extra).????????type?all??????????sql????????????????key???????sql?????????????????null??????С?ref ??????????????????Щ??????
????????const??????????Extra ????Щ??????????????using index??using filesort???????????????????????
??????????β??????????????? ???id??????????????С????id???id???????С?
????3. ???profile ????sql ??????????????sql?????????????е???????????
????1. set profiling=1; ????profile ????????2. show profiles?? ??????mysql ????????????
????3.show profile for query id;
???????磺show profile for query 2; ?? ?? ?????sql ??????????????
????4. ???mysql ??????????????????????????DBA ?????????
???????????????????mysql??????????????????ò???????????С????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11