22.9.4.1 The events_waits_current Table

The events_waits_current table
contains current wait events, one row per thread showing the
current status of the thread's most recent monitored wait
event.

Of the tables that contain wait event rows,
events_waits_current is the most
fundamental. Other tables that contain wait event rows are
logically derived from the current events. For example, the
events_waits_history and
events_waits_history_long tables
are collections of the most recent wait events, up to a fixed
number of rows.

The thread associated with the event and the thread
current event number when the event starts. The
THREAD_ID and
EVENT_ID values taken together uniquely
identify the row. No two rows have the same pair of
values.

END_EVENT_ID

This column is set to NULL when the
event starts and updated to the thread current event
number when the event ends. This column was added in MySQL
5.6.4.

The name of the source file containing the instrumented
code that produced the event and the line number in the
file at which the instrumentation occurs. This enables you
to check the source to determine exactly what code is
involved. For example, if a mutex or lock is being
blocked, you can check the context in which this occurs.

TIMER_START,
TIMER_END,
TIMER_WAIT

Timing information for the event. The unit for these
values is picoseconds (trillionths of a second). The
TIMER_START and
TIMER_END values indicate when event
timing started and ended. TIMER_WAIT is
the event elapsed time (duration).

If an event has not finished, TIMER_END
and TIMER_WAIT are
NULL before MySQL 5.6.26. As of 5.6.26,
TIMER_END is the current timer value
and TIMER_WAIT is the time elapsed so
far (TIMER_END −
TIMER_START).

If an event is produced from an instrument that has
TIMED = NO, timing information is not
collected, and TIMER_START,
TIMER_END, and
TIMER_WAIT are all
NULL.

For a mutex, the number of spin rounds. If the value is
NULL, the code does not use spin rounds
or spinning is not instrumented.

OBJECT_SCHEMA,
OBJECT_NAME,
OBJECT_TYPE,
OBJECT_INSTANCE_BEGIN

These columns identify the object “being acted
on.” What that means depends on the object type.

For a synchronization object (cond,
mutex, rwlock):

OBJECT_SCHEMA,
OBJECT_NAME, and
OBJECT_TYPE are
NULL.

OBJECT_INSTANCE_BEGIN is the
address of the synchronization object in memory.

For a file I/O object:

OBJECT_SCHEMA is
NULL.

OBJECT_NAME is the file name.

OBJECT_TYPE is
FILE.

OBJECT_INSTANCE_BEGIN is an address
in memory.

For a socket object:

OBJECT_NAME is the
IP:PORT value for the socket.

OBJECT_INSTANCE_BEGIN is an address
in memory.

For a table I/O object:

OBJECT_SCHEMA is the name of the
schema that contains the table.

OBJECT_NAME is the table name.

OBJECT_TYPE is
TABLE for a persistent base table
or TEMPORARY TABLE for a temporary
table.

OBJECT_INSTANCE_BEGIN is an address
in memory.

An OBJECT_INSTANCE_BEGIN value itself
has no meaning, except that different values indicate
different objects.
OBJECT_INSTANCE_BEGIN can be used for
debugging. For example, it can be used with GROUP
BY OBJECT_INSTANCE_BEGIN to see whether the load
on 1,000 mutexes (that protect, say, 1,000 pages or blocks
of data) is spread evenly or just hitting a few
bottlenecks. This can help you correlate with other
sources of information if you see the same object address
in a log file or another debugging or performance tool.

INDEX_NAME

The name of the index used. PRIMARY
indicates the table primary index. NULL
means that no index was used.

NESTING_EVENT_ID

The EVENT_ID value of the event within
which this event is nested. Before MySQL 5.6.3, this
column is always NULL.

NESTING_EVENT_TYPE

The nesting event type. The value is
STATEMENT, STAGE, or
WAIT. This column was added in MySQL
5.6.3.

OPERATION

The type of operation performed, such as
lock, read, or
write.

NUMBER_OF_BYTES

The number of bytes read or written by the operation. For
table I/O waits (events for the
wait/io/table/sql/handler instrument),
NUMBER_OF_BYTES is
NULL.