Mysqldumpslow Instructions for use
Mysqldumpslow--help
Usage:mysqldumpslow [OPTS ...] [LOGS ...]
Parse and summarize the MySQL slow query log. Options are
--verbose verbose
--debug Debug
--help write this text to standard output
-V Verbose
-D Debug
-S ORDER what to sort by (Al, at, AR, C, L, R, T), ' on ' is default
Al:average Lock Time
Ar:average rows Sent
At:average Query Time
C:count (number of occurrences)
L:lock time
R:rows sent
T:query time
-R Reverse the sort order (largest last instead of first) (sort from large to small)
-T NUM just show the top n queries (highest n queries)
-A don ' t abstract all numbers-N and strings to ' S '
-N NUM abstract numbers with at least n digits within names
-G PATTERN Grep:only Consider stmts that include the This string
-H HOSTNAME HOSTNAME of DB Server for *-slow.log filename (can be wildcard),
Default is ' * ', i.e. match all
-I name name of server instance (if using Mysql.server startup script)
-L don ' t subtract lock time from total time
For example:
Analyze the top n slow SQL with the highest frequency:
Mysqldumpslow-s c-t N Mysql-slow.log
If you just need to analyze the slowest n SQL for processing:
Mysqldumpslow-t N Mysql-slow.log
Mysqldumpslow Instructions for use