Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 38.2Mb
PDF (A4) - 38.2Mb
PDF (RPM) - 37.1Mb
HTML Download (TGZ) - 10.1Mb
HTML Download (Zip) - 10.2Mb
HTML Download (RPM) - 8.9Mb
Man Pages (TGZ) - 206.4Kb
Man Pages (Zip) - 314.8Kb
Info (Gzip) - 3.5Mb
Info (Zip) - 3.5Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  Performance Schema System Variable Tables

25.11.13 Performance Schema System Variable Tables


The value of the show_compatibility_56 system variable affects the information available from the tables described here. For details, see the description of that variable in Section 5.1.5, “Server System Variables”.

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

  • global_variables: Global system variables. An application that wants only global values should use this table.

  • session_variables: 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: 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.

The session variable tables (session_variables, variables_by_thread) contain information only for active sessions, not terminated sessions.

TRUNCATE TABLE is not supported for Performance Schema system variable tables.

The global_variables and session_variables tables have these columns:


    The system variable name.


    The system variable value. For global_variables, this column contains the global value. For session_variables, this column contains the variable value in effect for the current session.

The variables_by_thread table has these columns:


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


    The system variable name.


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

The variables_by_thread table contains system variable information only about foreground threads. If not all threads are instrumented by the Performance Schema, this table will miss some rows. In this case, the Performance_schema_thread_instances_lost status variable will be greater than zero.

User Comments
Sign Up Login You must be logged in to post a comment.