The MySQL server maintains many status variables that provide
information about its operation (see
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.

The Performance Schema collects statistics for global status
variables only for threads for which the
INSTRUMENTED value is YES
in the threads table. Statistics
for session status variables are always collected, regardless of
the INSTRUMENTED value.

The status variable value. For
global_status, this column
contains the global value. For
session_status, this column
contains the variable value for the current session.

The status_by_thread table contains
the status of each active thread. It has these columns:

THREAD_ID

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

VARIABLE_NAME

The status variable name.

VARIABLE_VALUE

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

The status_by_thread table contains
status variable information only about foreground threads. If
the
performance_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 will be empty.

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.

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.