mysql lock analysis related to several systems view


1, infomation_schema.innodb_lock_waits
+ ------------------- + ------------- + ------ + --- - + --------- + ------- +
| Field, | Type | Null | Key | the Default | Extra |
+ --------------- ---- + ------ + ----- + ------------- + --------- + ------- +
| requesting_trx_id | varchar (18) | NO | | | | transaction id # request locks 
| requested_lock_id | varchar (81) | NO | | | | # requests lock the above mentioned id
| blocking_trx_id | VARCHAR (18) | NO | | | | transaction id # holds the lock 
| blocking_lock_id | varchar (81) | NO | | | | # owned lock the above mentioned id 
+ ------------------- + ----- -------- + ------ + ----- + --------- + ------- +


2, information_schema.innodb_trx
+ --------------- + ---------------------------- ------ + ------ + ----- + ----- + ------- +
| Field, | Type | Null | Key | the Default | Extra |
+ ---------------------------- + ------- -------------- + --------------------- + ------ + ----- + + -------
| trx_id | VARCHAR (18 is) | NO | | | | # transaction ID
| TRX_STATE | VARCHAR (13 is) | NO | | | | transaction execution state #
| trx_started | datetime | NO | | 0000-00-00 00:00:00 | | time # transaction started
| trx_requested_lock_id | varchar (81) | YES | | NULL | | # Affairs is awaiting a lock id
| Trx_wait_started | datetime | YES | | NULL | | Time # Affairs wait for a lock started
| trx_weight | bigint (21) unsigned | NO | | 0 | | # Affairs weight, the number of lines of things to modify and lock mainly reflects
| trx_mysql_thread_id | bigint (21) unsigned | NO | | 0 | | id corresponding thread # Affairs
| trx_query | varchar (1024) | YES | | NULL | | # affairs SQL statements
| trx_operation_state | varchar (64) | YES | | NULL | | # the transaction is currently operating
| trx_tables_in_use | bigint (21) unsigned | NO | | 0 | | # transaction number used in the current SQL table
| Trx_tables_locked | bigint (21) unsigned | NO | | 0 | | # affairs current number of SQL tables have row lock
| trx_lock_structs | bigint (21) unsigned | NO | | 0 | | number of locks # things reserved
| trx_lock_memory_bytes | bigint (21) unsigned | NO | | 0 | | # affairs lock structure occupied by memory size
| trx_rows_locked | bigint (21) unsigned | NO | | 0 | | # Affairs approximate number of rows locked
| trx_rows_modified | bigint (21) unsigned | NO | | 0 | | # transaction modifications and inserted rows
| trx_concurrency_tickets | bigint (21) unsigned | NO | | 0 | | # value indicating the current transaction to be processed before being swapped out of the workload 
| Trx_isolation_level | varchar (16) | NO | | | | # of the current isolation level transaction
| trx_unique_checks | int (1) | NO | | 0 | | # The only check is turned on for the current transaction
| trx_foreign_key_checks | int (1) | NO | | 0 | | # foreign key checks on whether the current transaction open
| Details # recent foreign key error of | trx_last_foreign_key_error | VARCHAR (256) | YES | | NULL |
| trx_adaptive_hash_latched | int (1) | NO | | 0 | | # the current transaction is locked adaptive hash index
| trx_adaptive_hash_timeout | bigint (21) unsigned | NO | | 0 | | # indicate whether to give up or keep the current transaction values adaptive search index, is 0, then immediately give up
| Trx_is_read_only | int (1) | NO | | 0 | | # of the current transaction is read-only, read-only 1
| trx_autocommit_non_locking | int (1) | NO | | 0 | | # indicates that the current transaction is a non-locking automatic submission
+ --------------------- + ---------------------------- + ------ + ----- + ----- + ------- +

. 3, information_schema.innodb_locks
+ ------------- + --------------------- + ------ + - + --------- + ------- + ----
| Field, | Type | Null | Key | the Default | Extra |
+ ------------- + --------------------- + ------ + ----- + ---- + --------- + ---
| lock_id | VARCHAR (81) | NO | | | | # lock the above mentioned id
| lock_trx_id | VARCHAR (18) | NO | | | | transaction id # holds the lock   
| lock_mode | varchar (32) | NO | | | | # lock mode
| lock_type | varchar (32) | NO | | | | # lock type
| lock_table | varchar (1024) | NO | | | | # locked table
| lock_index | varchar (1024) | YES | | NULL | | # locked index
| Lock_space | bigint (21) unsigned | YES | | NULL | | # locked table space number
| lock_page | bigint (21) unsigned | YES | | NULL | | # page number locked
| lock_rec | bigint (21) unsigned | YES | | NULL | | # locked record number
| lock_data | varchar (8192) | YES | | NULL | | # is latched data
+ ------------- + - ------------------- + ------ + ----- + --------- + ------- +

. 4, information_schema.processlist
+ --------- + ------ + ----- + --------------------- + --------- + ------- +
| Field, | Type | Null | Key | the Default | Extra |
+ --------- + ------- + ----- + ------ + -------------- --------- + ------- +
| ID | bigint (21) unsigned | NO | | 0 | | id # connecting thread
| USER | varchar (32) | NO | | | | # log mysql the User
| the HOST | VARCHAR (64) | NO | | | | # log mysql the host name or address: port
| DB | varchar (64) | YES | | NULL | | mysql database logon name # of
| cOMMAND | varchar (16) | NO | | | | # type of connection thread currently running the command
| TIME | int (7) | NO | | 0 | | # seconds connection thread in the current state 
| STATE | varchar (64) | YES | | NULL | | a state in which the connecting threads currently # 
| INFO | longtext | YES | | NULL | | # connection thread statement currently being executed
+ --------- + --------------------- + --- --- + ----- + --------- + ------- +
 

Published 170 original articles · won praise 46 · views 190 000 +

Guess you like

Origin blog.csdn.net/LHDZ_BJ/article/details/88529728