Essential MySQL tool No. 1: mk-query-digest
Nothing
frustrates
like slow MySQL performance.
All too often,
faster hardware is thrown at the problem,
a solution that works only if hardware is in fact to blame.
More often than not,
poor performance can be attributed to slowly executing queries that are blocking other queries,
creating a ripple effect of slow response times. Since it's a lot cheaper to optimize queries than to upgrade hardware, the logical first step in MySQL optimization is query log analysis.