Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I want to know how many number of Select statements that got executed in MySQL server. Also I want to exclude the queries that are executing from query cache.

I thought status variable 'com_select' gives the required one. But it is not giving proper result.

Following is the test case, I had followed:

1) Restarted MySQL Service.

2) Executed Show Global Status and following is the result:

Com_select - 1

Qcache_hits - 0

Qcache_inserts - 0

3) Next executed one select statement.

4) Then executed Show Global Status and following is the result:

Com_select - 4

Qcache_hits - 0

Qcache_inserts - 1

5) Again executed same select statement which I had executed earlier

6) Then executed Show Global Status and following is the result:

Com_select - 6

Qcache_hits - 1

Qcache_inserts - 1

For every Select/Show statement, com_select is getting incremented. I had tried the same test case two to three times, But still the result is same.

So Is there any way to get exact number of Select statements that got executed by excluding statements that are getting executed from 'query cache'

Is there any way to narrow down the size of com_select.

Also, what about the update statements. will the update statements get cached..?

share|improve this question
Sorry, but is Com_select - Qcache_hits not what you are looking for? – Derek Downey Jan 31 '12 at 20:44
I did not understand what you wanted to say. – Phanindra Feb 1 '12 at 6:26

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.