In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The mysqldumpslow tool can be used to summarize the information of slow query logs.
The MySQL slow query log contains query information that takes a long time to execute. The mysqldumpslow tool can parse MySQL slow query log files and print out a summary of their contents.
Typically, the mysqldumpslow tool groups similar queries.
-- Common parameters
-s sort mode
T, at: sort by query time or average query time
L, al: sort by lock time and average lock time
R, ar: sort by the number of rows sent or the average number of rows sent
C: sort by number of execution
Mysqldumpslow sorts by average query time (- s at)
-r sort in reverse order
-t N displays only the first N queries in the output file
-- take out the top 5 SQL that have been executed the most
[root@localhost log] # / software/bin/mysqldumpslow-s c-t 5 slow_query.log | more
Reading mysql slow query log from slow_query.log
Count: 2 Time=43.54s (87s) Lock=0.00s (0s) Rows=0.0 (0), system [system] @ localhost
Lock table t10 write
Count: 1 Time=14.53s (14s) Lock=0.00s (0s) Rows=73088.0 (73088), system [system] @ localhost
SELECT / *! n SQL_NO_CACHE * / * FROM `troomidbbbig`
Count: 1 Time=12.22s (12s) Lock=0.00s (0s) Rows=0.0 (0), system [system] @ localhost
INSERT INTO `ttrainidbbig` VALUES ('Sparky recorder', 'Nulle', 'Null', 'Null,' Null,'
-- take out the top 10 slow SQL that takes the longest time
Mysqldumpslow-s t-t 10 slow.log
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.