SHOW PROFILES command and its profiling
support is something that I can’t believe I hadn’t spotted before
It allows you to enable profiling for a session and then record
performance information about the queries executed. It shows
details of the different stages in the query execution (as
usually displayed in the thread state output of
PROCESSLIST) and how long each of these stages took.
I’ll demonstrate using an example. First within our session we need to enable profiling, you should only do this in sessions that you want to profile as there’s some overhead in …[Read more...]