2

I have a mysql server running on 5.6.19 version and I got confused with the status variables Queries and Questions.

 show global status like 'Queries%';   
| Queries                 | 28058738 |

mysql> show global status like 'Questions%';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| Questions     | 9458886 |
+---------------+---------+

The server is executing so many preparing statements and as per MySQL manual I got an assumption that Questions will contain Com_stmt_execute count. So I found my counts as,

mysql> show global status like 'Com_stmt_execute';
+------------------+---------+
| Variable_name    | Value   |
+------------------+---------+
| Com_stmt_execute | 9356066 |
+------------------+---------+

So what are the other counters which dominates to the total Questions status value?

Please see my Select and Query cache hits and I have very less write on this server.

mysql> show global status like '%Com_select%';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| Com_select    | 2720855 |
+---------------+---------+

mysql> show global status like 'Qcache_hits';
+---------------+---------+
| Variable_name | Value   |
+---------------+---------+
| Qcache_hits   | 2316541 |
+---------------+---------+

Also the mysqladmin status show a reverse status if we consider the variable names.

$ mysqladmin status
 Questions: 28079556 
2

I answered an old question like this Feb 25, 2014 : Questions since MySQL Startup

In that post, I described how everything MySQL executes to retrieve info is a question. I also mentioned how a billion questions is no big deal (See my ServerFault post 1 billion mysql queries in 24 days? Can something be wrong?)

Here is the difference

  • Queries : The number of statements executed by the server. This variable includes statements executed within stored programs, unlike the Questions variable. It does not count COM_PING or COM_STATISTICS commands.

  • Questions : The number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries variable. This variable does not count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or COM_STMT_RESET commands.

You should go through the MySQL Documentation and read up on all Server Status Variables.

2
  • Thank you for spending time to respond my 'Questions' :) Still I have something uncleared on my mind, like if I calculate the total of, Com_stmt_execute+Com_select+Qcache_hits (Apprx 143 Million) is much more than the Questions (94 Million) I had on that server. Am I mixing up something it should not be?
    – Peter
    May 25 '15 at 6:24
  • I think im summing wrong counter. When I tested with prepared select statement executions, either the counter is landed on Com_select or Qcache_hits. So as per my understanding Com_stmt_execute count is distributed over Com_select and Qcache_hits. Still my Com_stmt_execute counter status is much more higher than the sum of those two values.
    – Peter
    May 25 '15 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.