MySQL????????????????
???????????? ???????[ 2013/5/7 9:54:00 ] ????????
??????????壬?????????м???????????????? query
??????????????????????????????????????SQL?????????????????????
?????÷?????????????long_query_time?????á??????10??
????????????????????????????????long_query_time????????????????
?????????????????????ж????long_query_time????????????
mysql> show variables like 'log_slow_queries';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| log_slow_queries | ON |
+------------------+-------+
1 row in set (0.00 sec)
mysql> show variables like 'long_query_time';
+-----------------+-----------+
| Variable_name | Value |
+-----------------+-----------+
| long_query_time | 10.000000 |
+-----------------+-----------+
1 row in set (0.00 sec)
????????????????????????????log_queries_not_using_indexes
??????????е?SQL??????????????MySQL???????????????????????????
mysql> show variables like 'log_queries_not_using_indexes';
+-------------------------------+-------+
| Variable_name | Value |
+-------------------------------+-------+
| log_queries_not_using_indexes | OFF |
+-------------------------------+-------+
1 row in set (0.00 sec)
??????????????п???????е???????????????????ò??????????б?????????????Ч
????MySQL ????????????????????????????????? mysqldumpslow??????????MySQL DBA???????????????????
???????????? TOP-5 SQL???
[mysql@localhost bin]$ ./mysqldumpslow -s al -n 5 /home/mysql/mysql/log/slow.log
Reading mysql slow query log from /home/mysql/mysql/log/slow.log
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0)?? 0users@0hosts
??????
???·???
??????????????????
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