Mysqldumpslow is a slow query log analysis tool with MySQL, as its name implies, queries those SQL statements that are slow to query, thus analyzing the reason why SQL query efficiency is slow.
In general, the results of a Mysqldumpslow group query are similar, and when displaying statistical results, you can abstract numbers and strings into "N" and "S", respectively. Of course, you can also use the-A and-n options to modify these abstract behaviors.
Mysqldumpslow Query command
Mysqldumpslow [Options] [Log_file]
Mysqldumpslow Optional parameters (options), as follows:
-A: Do not abstract numbers into N, strings are abstracted into S.
Example:
Mysql%mysqldumpslow/home/mysql/logs/slow_query.log
Reading mysql slow query log from/home/mysql/logs/slow_query.log
count:1 time=0.00s (0s) lock=0.00s (0s) rows=0.0 (0), favdba[favdba]@[10.1.45.51] # schema:last_errno:n Killed:n # QUERY_TIME:N.N LOCK_TIME:N.N rows_sent:n rows_examined:n rows_affected:n # bytes_sent:n SET timestamp=n; SELECT Event_Name, Event_schema, event_definition from INFORMATION_SCHEMA. EVENTS |
Mysql%mysqldumpslow-a/home/mysql/logs/slow_query.log
Reading mysql slow query log from/home/mysql/logs/slow_query.log
count:1 time=0.00s (0s) lock=0.00s (0s) rows=0.0 (0), favdba[favdba]@[10.1.45.51] # schema:last_errno:0 killed:0 # query_time:0.004095 lock_time:0.002907 rows_sent:0 rows_examined:0 rows_affected:0 # bytes_sent:140 SET timestamp=1451270206; SELECT Event_Name, Event_schema, event_definition from INFORMATION_SCHEMA. EVENTS |
-N: Displays the number abstract as at least the specified number of digits
This article is from the "This person's IT World" blog, be sure to keep this source http://favccxx.blog.51cto.com/2890523/1730049
Slow query log Analysis tool Mysqldumpslow