How to Check Whether Changes Had an Effect
There are status variables that show the current server status. As opposed to configuration variables, these do not affect server behavior, but instead contain information about what is happening in the mysqld process. Status variables are read-only, i.e., it is the MySQL server that changes them, not the user. They show such things as how many queries were executed and of what kind, network traffic, how indexes are used (you can find an example in Queries That Modify Data), buffer usage, how many tables are open, how many temporary tables were created, and a lot of other useful information. I won’t describe each of them here, but will note which status variable to watch while covering the variables themselves later in this chapter, as I did in Queries That Modify Data.
In the context of altering variables, the status variables are useful mostly in Performance-Related Options. We will also discuss how to get information about what is going on in your MySQL configuration in Chapter 6.
Like other variables, status variables can apply to both individual
sessions and all sessions (global).
Session variables show the status for the current session, whereas global
variables show the status since the server was started or since the last
FLUSH STATUS command was
executed.
Note
Some variables are not independent. For example, variables that
control the query cache change nothing when query_cache_size is set to zero. When tuning such options, always ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access