A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Profiling MySQL

SET profiling = 1;

SET
profiling_history_size = 100; -- maximum is 100

SHOW PROFILES; -- shows a list of recent commands

SHOW PROFILE; -- shows a very detailed breakdown of time spent on each database task

For example, if a lot of time is spent 'Sending data', try improving your indexes.

http://dev.mysql.com/doc/refman/5.0/en/show-profiles.html