database

How do I find the slow queries in MySQL?

The easiest way to isolate the slowest queries in the slow queries log is to use mysqlsla.

Run mysqlsla on your slow queries log and save the output to a file. For example: “mysqlsla –log-type slow /var/lib/mysql/slow_queries.log > ~/slow_queries”. That command will create a file in your home directory called slow_queries.

6 Comments

6 Comments

  1. mherzog

    July 9, 2010 at 11:15 am

    This is a handy tip, yo.

  2. pc support

    August 12, 2010 at 10:13 am

    you just made me see another perspective of this one.

  3. birthday party supplies

    August 12, 2010 at 2:48 pm

    Fantastic blog! I definitely love how it is easy on my eyes and also the information are well written. I am wondering how I might be notified whenever a new post has been made.

  4. mherzog

    August 26, 2010 at 8:55 am

    The MySQL server I’m logged into does not have mysqlsla.

    Dang.

  5. mherzog

    September 14, 2010 at 2:59 am

    http://hackmysql.com/mysqlsla

    It’s a perl script. Yo.

  6. droid x case

    October 14, 2010 at 7:25 am

    Like the design, template, post is clean, writing is great. I’ll probably check back again….

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top