-s ORDER what to sort by (t, at, l, al, r, ar etc), ‘at’ is default
t: 查询花费时间 l: lock时间 r: 返回的记录数 所有前面的a表示倒序
-r 按输出结果倒序排列
-a 不把字查询字符串与数据改成S,N
-t NUM just show the top n queries
显示前面几条
-g PATTERN grep: only consider stmts that include this string后边可以写一个正则匹配模式,大小写不敏感的
-l don’t subtract lock time from total time不要在总时间里面把lock的时候减去
例子: mysqldumpslow -s r -t 20 mysql-slow.log 返回记录集最多的20个sql。

0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.