MySQL :: MySQL 8.4 Reference Manual :: 29.12.13.4 The table_handles Table (original) (raw)

29.12.13.4 The table_handles Table

The Performance Schema exposes table lock information through the table_handles table to show the table locks currently in effect for each opened table handle. table_handles reports 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.

The table_handles table is read only and cannot be updated. It is autosized by default; to configure the table size, set theperformance_schema_max_table_handles system variable at server startup.

Table lock instrumentation uses thewait/lock/table/sql/handler instrument, which is enabled by default.

To control table lock instrumentation state at server startup, use lines like these in your my.cnf file:

[mysqld]  
performance-schema-instrument='wait/lock/table/sql/handler=ON'  
[mysqld]  
performance-schema-instrument='wait/lock/table/sql/handler=OFF'  

To control table lock instrumentation state at runtime, update the setup_instruments table:

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';  

The table_handles table has these columns:

The table_handles table has these indexes:

TRUNCATE TABLE is not permitted for the table_handles table.