Skip to content
Advertisement

Interpreting mysqldumpslow results

I have modified mysql config to log slow queries

slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 2
log-queries-not-using-indexes

And interpreting them with mysqldumpslow. One of the results is as follows

Count: 28  Time=0.21s (5s)  Lock=0.00s (0s)  Rows=5.0 (140), root[root]@localhost

Question: what do the numbers in brackets mean?

The query does take about 0.21s when run with mysql (or via mysql GUI’s); however when making a request to a page the time span is more like 5 seconds.

Extra read: mysqldumpslow: What does these fields indicate..?

Advertisement

Answer

It seems that the number in brackets (5s) is the average Time multiplied by Count and floored.

28 * 0.21 = 5.88s ~ 5s

The same applies to rows

28 * 5.0 = 140 
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement