The Performance Schema exposes table lock information through
table_handles table to show
the table locks currently in effect for each opened table
what is recorded by the table lock instrumentation. This
information shows which table handles the server has open, how
they are locked, and by which sessions.
Table lock instrumentation uses the
which is enabled by default.
To control table lock instrumentation state at server startup,
use lines like these in your
To control table lock instrumentation state at runtime, update
UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'wait/lock/table/sql/handler';
UPDATE performance_schema.setup_instruments SET ENABLED = 'NO', TIMED = 'NO' WHERE NAME = 'wait/lock/table/sql/handler';
table_handles table has these
The table opened by a table handle.
The schema that contains the object.
The name of the instrumented object.
The table handle address in memory.
The thread owning the table handle.
The event which caused the table handle to be opened.
The table lock used at the SQL level. The value is one of
READ WITH SHARED LOCKS,
READ HIGH PRIORITY,
READ NO INSERT,
WRITE ALLOW WRITE,
WRITE CONCURRENT INSERT,
WRITE LOW PRIORITY, or
WRITE. For information about these lock types, see the
The table lock used at the storage engine level. The value is one of