The events_waits_history_long  table has the same columns as events_waits_current . See Section 27.12.4.1, “The events_waits_current Table” . Unlike events_waits_current , events_waits_history_long  has no indexing. 

TRUNCATE TABLE  is permitted for the events_waits_history_long  table. It removes the rows. 

For more information about the relationship between the three wait event tables, see Section 27.9, “Performance Schema Tables for Current and Historical Events” . 

For information about configuring whether to collect wait events, see Section 27.12.4, “Performance Schema Wait Event Tables” . 

## 27.12.5 Performance Schema Stage Event Tables 

The Performance Schema instruments stages, which are steps during the statement-execution process, such as parsing a statement, opening a table, or performing a filesort  operation. Stages correspond to the thread states displayed by SHOW PROCESSLIST  or that are visible in the INFORMATION_SCHEMA.PROCESSLIST  table. Stages begin and end when state values change. 

Within the event hierarchy, wait events nest within stage events, which nest within statement events, which nest within transaction events. 

These tables store stage events: 

• events_stages_current : The current stage event for each thread. 

• events_stages_history : The most recent stage events that have ended per thread. 

• events_stages_history_long : The most recent stage events that have ended globally (across all threads). 

The following sections describe the stage event tables. There are also summary tables that aggregate information about stage events; see Section 27.12.20.2, “Stage Summary Tables” . 

For more information about the relationship between the three stage event tables, see Section 27.9, “Performance Schema Tables for Current and Historical Events” . 

## Configuring Stage Event Collection 

•Configuring Stage Event Collection 

•Stage Event Progress Information 

To control whether to collect stage events, set the state of the relevant instruments and consumers: 

•The setup_instruments  table contains instruments with names that begin with stage . Use these instruments to enable or disable collection of individual stage event classes. 

•The setup_consumers  table contains consumer values with names corresponding to the current and historical stage event table names. Use these consumers to filter collection of stage events. 

Other than those instruments that provide statement progress information, the stage instruments are disabled by default. For example: 

mysql> SELECT NAME, ENABLED, TIMED FROM performance_schema.setup_instruments WHERE NAME RLIKE ’stage/sql/[a-c]’; +----------------------------------------------------+---------+-------+ 

