### 27.12.14 Performance Schema System Variable Tables

[27.12.14.1 Performance Schema persisted\_variables Table](performance-schema-persisted-variables-table.html)
[27.12.14.2 Performance Schema variables\_info Table](performance-schema-variables-info-table.html)

 The MySQL server maintains many system variables that indicate how it is configured (see [Section 5.1.8, “Server System Variables”](server-system-variables.html)). System variable information is available in these Performance Schema tables:

* [`global_variables`](performance-schema-system-variable-tables.html): Global system variables. An application that wants only global values should use this table.

* [`session_variables`](performance-schema-system-variable-tables.html): System variables for the current session. An application that wants all system variable values for its own session should use this table. It includes the session variables for its session, as well as the values of global variables that have no session counterpart.

* [`variables_by_thread`](performance-schema-system-variable-tables.html): Session system variables for each active session. An application that wants to know the session variable values for specific sessions should use this table. It includes session variables only, identified by thread ID.

* [`persisted_variables`](performance-schema-persisted-variables-table.html): Provides a SQL interface to the `mysqld-auto.cnf` file that stores persisted global system variable settings. See [Section 27.12.14.1, “Performance Schema persisted\_variables Table”](performance-schema-persisted-variables-table.html).

* [`variables_info`](performance-schema-variables-info-table.html): Shows, for each system variable, the source from which it was most recently set, and its range of values. See [Section 27.12.14.2, “Performance Schema variables\_info Table”](performance-schema-variables-info-table.html).

 The session variable tables ([`session_variables`](performance-schema-system-variable-tables.html), [`variables_by_thread`](performance-schema-system-variable-tables.html)) contain information only for active sessions, not terminated sessions.

 The [`global_variables`](performance-schema-system-variable-tables.html) and [`session_variables`](performance-schema-system-variable-tables.html) tables have these columns:

* `VARIABLE_NAME`

   The system variable name.

* `VARIABLE_VALUE`

   The system variable value. For [`global_variables`](performance-schema-system-variable-tables.html), this column contains the global value. For [`session_variables`](performance-schema-system-variable-tables.html), this column contains the variable value in effect for the current session.

 The [`global_variables`](performance-schema-system-variable-tables.html) and [`session_variables`](performance-schema-system-variable-tables.html) tables have these indexes:

* Primary key on (`VARIABLE_NAME`)

 The [`variables_by_thread`](performance-schema-system-variable-tables.html) table has these columns:

* `THREAD_ID`

   The thread identifier of the session in which the system variable is defined.

* `VARIABLE_NAME`

   The system variable name.

* `VARIABLE_VALUE`

   The session variable value for the session named by the `THREAD_ID` column.

 The [`variables_by_thread`](performance-schema-system-variable-tables.html) table has these indexes:

* Primary key on (`THREAD_ID`, `VARIABLE_NAME`)

 The [`variables_by_thread`](performance-schema-system-variable-tables.html) table contains system variable information only about foreground threads. If not all threads are instrumented by the Performance Schema, this table misses some rows. In this case, the [`Performance_schema_thread_instances_lost`](performance-schema-status-variables.html#statvar_Performance_schema_thread_instances_lost) status variable is greater than zero.

[`TRUNCATE TABLE`](truncate-table.html) is not supported for Performance Schema system variable tables.

