Documentation Home
MySQL Performance Schema
Related Documentation Download this Excerpt
PDF (US Ltr) - 0.8Mb
PDF (A4) - 0.8Mb
HTML Download (TGZ) - 138.6Kb
HTML Download (Zip) - 156.7Kb

MySQL Performance Schema  /  Performance Schema Table Descriptions  /  Performance Schema Wait Event Tables

10.4 Performance Schema Wait Event Tables

The Performance Schema instruments waits, which are events that take time. Within the event hierarchy, wait events nest within stage events, which nest within statement events, which nest within transaction events.

These tables store wait events:

The following sections describe the wait event tables. There are also summary tables that aggregate information about wait events; see Section 10.15.1, “Wait Event Summary Tables”.

Wait Event Configuration

To control collection of wait events, set the state of the relevant instruments and consumers:

  • The setup_instruments table contains instruments with names that begin with wait. Use these instruments to enable or disable collection of wait events.

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

Some wait instruments are enabled by default; others are disabled. For example:

mysql> SELECT * FROM setup_instruments
       WHERE NAME LIKE 'wait/io/file/innodb%';
| NAME                                 | ENABLED | TIMED |
| wait/io/file/innodb/innodb_data_file | YES     | YES   |
| wait/io/file/innodb/innodb_log_file  | YES     | YES   |
| wait/io/file/innodb/innodb_temp_file | YES     | YES   |
mysql> SELECT * FROM setup_instruments WHERE
       NAME LIKE 'wait/io/socket/%';
| NAME                                   | ENABLED | TIMED |
| wait/io/socket/sql/server_tcpip_socket | NO      | NO    |
| wait/io/socket/sql/server_unix_socket  | NO      | NO    |
| wait/io/socket/sql/client_connection   | NO      | NO    |

The wait consumers are disabled by default:

mysql> SELECT * FROM setup_consumers WHERE NAME LIKE '%waits%';
| NAME                      | ENABLED |
| events_waits_current      | NO      |
| events_waits_history      | NO      |
| events_waits_history_long | NO      |

To control wait event collection at server startup, use lines like these in your my.cnf file:

  • Enable:

  • Disable:


To control wait event collection at runtime, update the setup_instruments and setup_consumers tables:

  • Enable:

    UPDATE setup_instruments SET ENABLED = 'YES', TIMED = 'YES'
    WHERE NAME = 'wait/%';
    UPDATE setup_consumers SET ENABLED = 'YES'
    WHERE NAME LIKE '%waits%';
  • Disable:

    UPDATE setup_instruments SET ENABLED = 'NO', TIMED = 'NO'
    WHERE NAME = 'wait/%';
    UPDATE setup_consumers SET ENABLED = 'NO'
    WHERE NAME LIKE '%waits%';

To collect only specific wait events, enable only the corresponding wait instruments. To collect wait events only for specific wait event tables, enable the wait instruments but only the wait consumers corresponding to the desired tables.

The setup_timers table contains a row with a NAME value of wait that indicates the unit for wait event timing. The default unit is CYCLE:

mysql> SELECT * FROM setup_timers WHERE NAME = 'wait';
| wait | CYCLE      |

To change the timing unit, modify the TIMER_NAME value:

WHERE NAME = 'wait';

For additional information about configuring event collection, see Chapter 4, Performance Schema Startup Configuration, and Chapter 5, Performance Schema Runtime Configuration.

User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.