Skip navigation links
Showing entries 1 to 2

Tags Filter: MySQL Toolkit (reset)

Articles
Add to Favourites +0 Vote Up -0Vote Down
Today I've been checking out a new client environment. My mission is to figure out (cold) some of the characteristics of the queries being run, and particularly if they're "good" or "bad". In my arsenal of "tools I really want to check out" has been Ma'atkit's Query Profiler.They're very different tools. Ma'atkit's query profiler profiles a batch of queries, without granularity (at least not the way I ran it) to see what query is doing what. So I ran this against a production machine:(I ran the query profiler for a while and then hit "enter" (apparently after about 17 minutes))> ./mk-query-profiler --external --host localhost --user <user> --password <password> Press <enter> when the external program is finished +----------------------------------------------------------+ | 1 (1028.2091 sec) |  []
Articles
Add to Favourites +0 Vote Up -0Vote Down
The "sla" in mysqlsla stands for "statement log analyzer". This does a much better job than mysqldumpslow of analyzing your slow query log. In fact, you can sort by many different parameters -- by sheer number of times the query shows up in the slow query log, by the total or average query time, by the lock time, etc. This is really good for weeding out pesky entries in the slow query log that you do not care about. In this case, our client was using log-queries-not-using-indexes, so there was a lot of junk in the slow query log as well (for instance, every time a mysqldump backup was run, the slow query log got plenty of entries). In this case, I'm using --slow to read the slow query log at the filename specified, --flat to flatten all the text to lowercase (basically case-insensitive matching) and --sort at to sort by "average time".> ./mysqlsla --flat --slow ~mysql/var/mysql-slow.log  []
Showing entries 1 to 2