简体   繁体   中英

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..?

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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM