MySQL slow query log
Clone this wiki locally
As of version 1.5.0, request-log-analyzer supports parsing MySQL slow query logs. Use
--format mysql to instruct r-l-a to parse a file as a slow query log.
Query duration in milliseconds
By default, MySQL reports the query and lock duration as whole seconds in the slow query log. To get a more detailed number for improved results, a patch is available that makes MySQL report the query duration as a floating point number in its log. Request-log-analyzer can parse these floating point numbers as well.
Filtering SQL_NO_CACHE queries
If you encounter queries like
SELECT !40032:SQL_NO_CACHE * FROM table; in your slow query log, you probably use the mysqldump tool to create backups of your database. You probably do not want to include these queries in your reports. You can filter them out using the
request-log-analyzer mysql_slow_queries.log --reject query /SQL_NO_CACHE/
This will ignore all queries that include the