The events_stages_current Table
The events_stages_current table contains current stage events, one row per thread showing the current status of the thread's most recent monitored stage event.
The events-stages-current table can be truncated with TRUNCATE TABLE.
Of the tables that contain stage event rows, events_stages_current is the most fundamental. Other tables that contain stage event rows are logically derived from the current events. For example, the events_stages_history and events_stages_history_long tables are collections of the most recent stage events, up to a fixed number of rows.
The events_stages_current table has these columns:
THREAD_IDThe thread associated with the event. The
THREAD_IDandEVENT_IDvalues taken together form a primary key that uniquely identifies the row. No two rows will have the same pair of values.EVENT_IDThe thread current event number when the event starts.
END_EVENT_IDThis column is set to
NULLwhen the event starts, and updated to the thread current event number when the event ends. This column was added in MariaDB 5.6.4.EVENT_NAMEThe name of the instrument that produced the event. This is a
setup_instruments.NAMEvalue. Instrument names have multiple parts and form a hierarchy, as discussed in , "Performance Schema Instrument Naming Conventions".SOURCEThe 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.
TIMER_START,TIMER_END,TIMER_WAITTiming information for the event. The unit for these values is picoseconds (trillionths of a second). The
TIMER_STARTandTIMER_ENDvalues indicate when event timing started and ended.TIMER_WAITis the event elapsed time (duration).If an event has not finished,
TIMER_ENDandTIMER_WAITareNULL.If an event is produced from an instrument that has
TIMED = NO, timing information is not collected, andTIMER_START,TIMER_END, andTIMER_WAITare allNULL.For discussion of picoseconds as the unit for event times and factors that affect time values, see , "Performance Schema Event Timing".
NESTING_EVENT_IDThe
EVENT_IDvalue of the event within which this event is nested. The nesting event for a stage event is usually a statement event.NESTING_EVENT_TYPEThe nesting event type. The value is
statement,stage, orwait.
The events_stages_current table was added in MariaDB 5.6.3.