MySQL Replication and Slow Queries

MySQL Replication and Slow Queries


I just filed a bug regarding slow queries executed by replication thread are not being logged to the slow query log.

This is not a big deal but it is ugly little gotcha which I think few people know about. It is especially bad if you’re using tools to analyze slow query log to find what queries take up the most resources on your server – in certain configurations replication load itself may be very significant contributor.

But even if you do not, as I wrote in the bug report it is quite handy to have this information our where as query times on master and slave can be different in a lot of circumstances.

One more thing to consider – slow replication queries also identify replication lag, ie if you have query which ran 10 seconds on the slave and your replication is well loaded, this means at some point in time your replication lag was at least 10 seconds.


Share this post

Comments (3)

  • sonny Reply


    I have encounter this issue when implement replication. On Master database transaction processing got dramatically slow down and threads connection went high.

    I would appreciate if any help on this… pls share that what information need from my end.

    Thanks in advance…

    March 28, 2007 at 12:00 am
  • Valeriy Kravchuk Reply

    The bug ( is verified already.

    April 4, 2007 at 6:54 am
  • MySQL Performance Blog » Does Slow query log logs all slow queries ? Reply

    […] queries or for audit purposes. In fact however not all the queries are logged. I already mentioned mysql slave queries are not logged to slow query log and it looks like I was wrong connecting it just with […]

    June 25, 2007 at 2:58 pm

Leave a Reply