profiling queries with the MySQL Profiler

set profiling=1;

Turn the profiler on.

Now run a query or two. Then...

show profile;

To show the last profiled query.


show profiles;

To get a list of profiled queries, including durations.

Then you can...

show profile for query 4;

To show the profile for one of the listed queries.

More info on this very helpful functionality:

And of course, don't forget about using EXPLAIN on your queries...

Find Me Around

User login