Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 32.3Mb
PDF (A4) - 32.3Mb
PDF (RPM) - 30.4Mb
HTML Download (TGZ) - 7.8Mb
HTML Download (Zip) - 7.8Mb
HTML Download (RPM) - 6.7Mb
Man Pages (TGZ) - 142.5Kb
Man Pages (Zip) - 201.7Kb
Info (Gzip) - 3.0Mb
Info (Zip) - 3.0Mb


Pre-General Availability Draft: 2017-05-26

24.11.12.2 The data_lock_waits Table

The data_lock_waits table implements a many-to-many relationship showing which data lock requests in the data_locks table are blocked by which held data locks in the data_locks table. Held locks in data_locks appear in data_lock_waits only if they block some lock request.

This information enables you to understand data lock dependencies between sessions. The table exposes not only which lock a session or transaction is waiting for, but which session or transaction currently holds that lock.

Example data lock wait information:

mysql> SELECT * FROM data_lock_waits\G
*************************** 1. row ***************************
                          ENGINE: INNODB
       REQUESTING_ENGINE_LOCK_ID: 4141:66:5:2
REQUESTING_ENGINE_TRANSACTION_ID: 4141
            REQUESTING_THREAD_ID: 38
             REQUESTING_EVENT_ID: 11
REQUESTING_OBJECT_INSTANCE_BEGIN: 140489320441368
         BLOCKING_ENGINE_LOCK_ID: 4140:66:5:2
  BLOCKING_ENGINE_TRANSACTION_ID: 4140
              BLOCKING_THREAD_ID: 37
               BLOCKING_EVENT_ID: 9
  BLOCKING_OBJECT_INSTANCE_BEGIN: 140489320307736

Unlike most Performance Schema data collection, there are no instruments for controlling whether data lock information is collected or system variables for controlling data lock table sizes. The Performance Schema collects information that is already available in the server, so there is no memory or CPU overhead to generate this information or need for parameters that control its collection.

Use the data_lock_waits table to help diagnose performance problems that occur during times of heavy concurrent load. For InnoDB, see the discussion of this topic at Section 16.14.2, “InnoDB INFORMATION_SCHEMA Transaction and Locking Information”.

Because the columns in the data_lock_waits table are similar to those in the data_locks table, the column descriptions here are abbreviated. For more detailed column descriptions, see Section 24.11.12.1, “The data_locks Table”.

The data_lock_waits table has these columns:

  • ENGINE

    The storage engine that requested the lock.

  • REQUESTING_ENGINE_LOCK_ID

    The ID of the lock requested by the storage engine. To obtain details about the lock, join this column with the ENGINE_LOCK_ID column of the data_locks table.

  • REQUESTING_ENGINE_TRANSACTION_ID

    The storage engine internal ID of the transaction that requested the lock.

  • REQUESTING_THREAD_ID

    The thread ID of the session that requested the lock.

  • REQUESTING_EVENT_ID

    The Performance Schema event that caused the lock request in the session that requested the lock.

  • REQUESTING_OBJECT_INSTANCE_BEGIN

    The address in memory of the requested lock.

  • BLOCKING_ENGINE_LOCK_ID

    The ID of the blocking lock. To obtain details about the lock, join this column with the ENGINE_LOCK_ID column of the data_locks table.

  • BLOCKING_ENGINE_TRANSACTION_ID

    The storage engine internal ID of the transaction that holds the blocking lock.

  • BLOCKING_THREAD_ID

    The thread ID of the session that holds the blocking lock.

  • BLOCKING_EVENT_ID

    The Performance Schema event that caused the blocking lock in the session that holds it.

  • BLOCKING_OBJECT_INSTANCE_BEGIN

    The address in memory of the blocking lock.

The data_lock_waits table has these indexes:

  • Index on (REQUESTING_ENGINE_LOCK_ID, ENGINE)

  • Index on (BLOCKING_ENGINE_LOCK_ID, ENGINE)

  • Index on (REQUESTING_ENGINE_TRANSACTION_ID, ENGINE)

  • Index on (BLOCKING_ENGINE_TRANSACTION_ID, ENGINE)

  • Index on (REQUESTING_THREAD_ID, REQUESTING_EVENT_ID)

  • Index on (BLOCKING_THREAD_ID, BLOCKING_EVENT_ID)

TRUNCATE TABLE is not permitted for the data_lock_waits table.


User Comments
Sign Up Login You must be logged in to post a comment.