Search code examples
mysqlquery-optimization

How to parse a mysql slow query log into something useful?


I have an extensive slow query log which was running for a few weeks. I would like to parse it, which would put the highest occurring queries at the top (with number of executions and average times of execution), and it goes from there in descending order.

What tool/command can I use to accomplish that?


Solution

  • Check out Percona Toolkit:

    mk-query-digest - Parses logs and more. Analyze, transform, filter, review and report on queries.