PDF (A4) - 40.9Mb
Man Pages (TGZ) - 259.7Kb
Man Pages (Zip) - 366.9Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
The MySQL server maintains many status variables that provide information about its operation (seeSection 7.1.10, “Server Status Variables”). Status variable information is available in these Performance Schema tables:
global_status: Global status variables. An application that wants only global values should use this table.session_status: Status variables for the current session. An application that wants all status 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.status_by_thread: Session status 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.
There are also summary tables that provide status variable information aggregated by account, host name, and user name. SeeSection 29.12.20.12, “Status Variable Summary Tables”.
The session variable tables (session_status,status_by_thread) contain information only for active sessions, not terminated sessions.
The Performance Schema collects statistics for global status variables only for threads for which theINSTRUMENTED value isYES in thethreads table. Statistics for session status variables are always collected, regardless of theINSTRUMENTED value.
The Performance Schema does not collect statistics forCom_ status variables in the status variable tables. To obtain global and per-session statement execution counts, use thexxxevents_statements_summary_global_by_event_name andevents_statements_summary_by_thread_by_event_name tables, respectively. For example:
SELECT EVENT_NAME, COUNT_STARFROM performance_schema.events_statements_summary_global_by_event_nameWHERE EVENT_NAME LIKE 'statement/sql/%'; Theglobal_status andsession_status tables have these columns:
VARIABLE_NAMEThe status variable name.
VARIABLE_VALUEThe status variable value. For
global_status, this column contains the global value. Forsession_status, this column contains the variable value for the current session.
Theglobal_status andsession_status tables have these indexes:
Primary key on (
VARIABLE_NAME)
Thestatus_by_thread table contains the status of each active thread. It has these columns:
THREAD_IDThe thread identifier of the session in which the status variable is defined.
VARIABLE_NAMEThe status variable name.
VARIABLE_VALUEThe session variable value for the session named by the
THREAD_IDcolumn.
Thestatus_by_thread table has these indexes:
Primary key on (
THREAD_ID,VARIABLE_NAME)
Thestatus_by_thread table contains status variable information only about foreground threads. If theperformance_schema_max_thread_instances system variable is not autoscaled (signified by a value of −1) and the maximum permitted number of instrumented thread objects is not greater than the number of background threads, the table is empty.
The Performance Schema supportsTRUNCATE TABLE for status variable tables as follows:
global_status: Resets thread, account, host, and user status. Resets global status variables except those that the server never resets.session_status: Not supported.status_by_thread: Aggregates status for all threads to the global status and account status, then resets thread status. If account statistics are not collected, the session status is added to host and user status, if host and user status are collected.Account, host, and user statistics are not collected if the
performance_schema_accounts_size,performance_schema_hosts_size, andperformance_schema_users_sizesystem variables, respectively, are set to 0.
FLUSH STATUS adds the session status from all active sessions to the global status variables, resets the status of all active sessions, and resets account, host, and user status values aggregated from disconnected sessions.
PDF (A4) - 40.9Mb
Man Pages (TGZ) - 259.7Kb
Man Pages (Zip) - 366.9Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb