29.12.14.2 Performance Schema variables_info Table (original) (raw)

29.12.14.2 Performance Schema variables_info Table

The variables_info table shows, for each system variable, the source from which it was most recently set, and its range of values.

The variables_info table has these columns:

The variables_info table has no indexes.

TRUNCATE TABLE is not permitted for the variables_info table.

If a variable with a VARIABLE_SOURCE value other than DYNAMIC is set at runtime,VARIABLE_SOURCE becomesDYNAMIC andVARIABLE_PATH becomes the empty string.

A system variable that has only a session value (such asdebug_sync) cannot be set at startup or persisted. For session-only system variables,VARIABLE_SOURCE can be onlyCOMPILED or DYNAMIC.

If a system variable has an unexpectedVARIABLE_SOURCE value, consider your server startup method. For example, mysqld_safe reads option files and passes certain options it finds there as part of the command line that it uses to startmysqld. Consequently, some system variables that you set in option files might display invariables_info asCOMMAND_LINE, rather than asGLOBAL or SERVER as you might otherwise expect.

Some sample queries that use thevariables_info table, with representative output:

mysql> SELECT VARIABLE_NAME  
       FROM performance_schema.variables_info  
       WHERE VARIABLE_SOURCE = 'COMMAND_LINE'  
       ORDER BY VARIABLE_NAME;  
+---------------+  
| VARIABLE_NAME |  
+---------------+  
| basedir       |  
| datadir       |  
| log_error     |  
| pid_file      |  
| plugin_dir    |  
| port          |  
+---------------+  
mysql> SELECT VARIABLE_NAME  
       FROM performance_schema.variables_info  
       WHERE VARIABLE_SOURCE = 'PERSISTED'  
       ORDER BY VARIABLE_NAME;  
+--------------------------+  
| VARIABLE_NAME            |  
+--------------------------+  
| event_scheduler          |  
| max_connections          |  
| validate_password.policy |  
+--------------------------+  
mysql> SELECT  
         VI.VARIABLE_NAME, GV.VARIABLE_VALUE,  
         VI.MIN_VALUE,VI.MAX_VALUE  
       FROM performance_schema.variables_info AS VI  
         INNER JOIN performance_schema.global_variables AS GV  
         USING(VARIABLE_NAME)  
       WHERE VI.VARIABLE_SOURCE = 'PERSISTED'  
       ORDER BY VARIABLE_NAME;  
+--------------------------+----------------+-----------+-----------+  
| VARIABLE_NAME            | VARIABLE_VALUE | MIN_VALUE | MAX_VALUE |  
+--------------------------+----------------+-----------+-----------+  
| event_scheduler          | ON             | 0         | 0         |  
| max_connections          | 200            | 1         | 100000    |  
| validate_password.policy | STRONG         | 0         | 0         |  
+--------------------------+----------------+-----------+-----------+