PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
The Performance Schema exposes table lock information through thetable_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.
Thetable_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 yourmy.cnf file:
Enable:
[mysqld]performance-schema-instrument='wait/lock/table/sql/handler=ON'Disable:
[mysqld]performance-schema-instrument='wait/lock/table/sql/handler=OFF'
To control table lock instrumentation state at runtime, update thesetup_instruments table:
Enable:
UPDATE performance_schema.setup_instrumentsSET ENABLED = 'YES', TIMED = 'YES'WHERE NAME = 'wait/lock/table/sql/handler';Disable:
UPDATE performance_schema.setup_instrumentsSET ENABLED = 'NO', TIMED = 'NO'WHERE NAME = 'wait/lock/table/sql/handler';
Thetable_handles table has these columns:
OBJECT_TYPEThe table opened by a table handle.
OBJECT_SCHEMAThe schema that contains the object.
OBJECT_NAMEThe name of the instrumented object.
OBJECT_INSTANCE_BEGINThe table handle address in memory.
OWNER_THREAD_IDThe thread owning the table handle.
OWNER_EVENT_IDThe event which caused the table handle to be opened.
INTERNAL_LOCKThe table lock used at the SQL level. The value is one of
READ,READ WITH SHARED LOCKS,READ HIGH PRIORITY,READ NO INSERT,WRITE ALLOW WRITE,WRITE CONCURRENT INSERT,WRITE LOW PRIORITY, orWRITE. For information about these lock types, see theinclude/thr_lock.hsource file.EXTERNAL_LOCKThe table lock used at the storage engine level. The value is one of
READ EXTERNALorWRITE EXTERNAL.
Thetable_handles table has these indexes:
Primary key on (
OBJECT_INSTANCE_BEGIN)Index on (
OBJECT_TYPE,OBJECT_SCHEMA,OBJECT_NAME)Index on (
OWNER_THREAD_ID,OWNER_EVENT_ID)
TRUNCATE TABLE is not permitted for thetable_handles table.
PDF (A4) - 41.3Mb
Man Pages (TGZ) - 262.8Kb
Man Pages (Zip) - 368.8Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb