Jump to content

[SOLVED] Count how many queries are made to mysql


papaface

Recommended Posts

Short of adding the code manually next to each MySQL query I'm not sure how you would do it the way you're wanting to. An alternative could be, if you're using MySQL >= 5.0.2, is to create a stored routine / trigger that increments a table field on every query that takes place.

 

This would be causing a lot of unnecessary load on your server using either method - Are you sure you need to do this?

Link to comment
Share on other sites

Could you not store a timestamp at the beginning of the script, then again at the end of the script, subtract one from the other and convert to seconds? This will give you the script execution time, which I believe includes queries - A fair comparison for your optimisation demonstration...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.