mlsamuelson.com

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.

Or...

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...

No comments

Add your comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

Find Me Around

User login