Hack MySQL

MySQL log analyzer – mysqlsla v1.5 finally done

without comments

mysqlsla (MySQL Statement Log Analyzer) v1.5 is finally done. Some people may recall a semi-release of v1.4 a few months ago, but that version wasn’t documented or otherwise mentioned at hackmysql.com.

Now, the real next release of mysqlsla is finished, and with documentation too! (However, I have removed the guide for now; it still needs to be completely rewritten). From the old v1.3 to the present, a lot has changed due to a lot of feedback, suggestions, problems, and bugs reported from users. Essentially, the script has been completely written, but here is a brief list of the changes:

  • COMPLETE redesign from v1.3: more simple to use and more informative
  • Log types are now mutually exclusive (but multiple logs of same type can still be combined)
  • Captures USE statements for querys when possible (to make EXPLAIN work)
  • –time-all-queries only works with general and slow logs
  • Nothing is filtered by default
  • Auto-filter -*,+SELECT,+USE enabled for –time-all-queries and –time-each-query unless overriden by –filter
  • Handles compound statements in slow logs
  • Mimicking of mysqldumpslow removed; slow log values now “automatic” when parsing a slow log
  • Removed options: –order, –correlate, –hide, –rows-read, –mysqldumpslow, –frequency (now called Count)
  • Added options: –debug, –flat, –examples, –sort, –databases, –distribution, –mp, –no-report, –np, –nth-percent
  • Improved log parsing routines
  • Handles DBI/MySQL errors cleanly instead of dumping them to stderr
  • Greatly minimized memory usage (can now parse multi-gig logs without running out of memory)

Thank you to all those who helped to improve this script. Please, keep submitting suggestions, bugs, problems, etc.

Written by Daniel Nichter

April 6th, 2007 at 11:34 am

Posted in MySQL,mysqlsla