PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5
Theserver_locks table is similar in structure to thecluster_locks table, and provides a subset of the information found in the latter table, but which is specific to the SQL node (MySQL server) where it resides. (Thecluster_locks table provides information about all locks in the cluster.) More precisely,server_locks contains information about locks requested by threads belonging to the currentmysqld instance, and serves as a companion table toserver_operations. This may be useful for correlating locking patterns with specific MySQL user sessions, queries, or use cases.
Theserver_locks table contains the following columns:
mysql_connection_idMySQL connection ID
node_idID of reporting node
block_instanceID of reporting LDM instance
tableidID of table containing this row
fragmentidID of fragment containing locked row
rowidID of locked row
transidTransaction ID
modeLock request mode
stateLock state
detailWhether this is first holding lock in row lock queue
opOperation type
duration_millisMilliseconds spent waiting or holding lock
lock_numID of lock object
waiting_forWaiting for lock with this ID
Notes
Themysql_connection_id column shows the MySQL connection or thread ID as shown bySHOW PROCESSLIST.
block_instance refers to an instance of a kernel block. Together with the block name, this number can be used to look up a given instance in thethreadblocks table.
Thetableid is assigned to the table byNDB; the same ID is used for this table in otherndbinfo tables, as well as in the output ofndb_show_tables.
The transaction ID shown in thetransid column is the identifier generated by the NDB API for the transaction requesting or holding the current lock.
Themode column shows the lock mode, which is always one ofS (shared lock) orX (exclusive lock). If a transaction has an exclusive lock on a given row, all other locks on that row have the same transaction ID.
Thestate column shows the lock state. Its value is always one ofH (holding) orW (waiting). A waiting lock request waits for a lock held by a different transaction.
Thedetail column indicates whether this lock is the first holding lock in the affected row's lock queue, in which case it contains a* (asterisk character); otherwise, this column is empty. This information can be used to help identify the unique entries in a list of lock requests.
Theop column shows the type of operation requesting the lock. This is always one of the valuesREAD,INSERT,UPDATE,DELETE,SCAN, orREFRESH.
Theduration_millis column shows the number of milliseconds for which this lock request has been waiting or holding the lock. This is reset to 0 when a lock is granted for a waiting request.
The lock ID (lockid column) is unique to this node and block instance.
If thelock_state column's value isW, this lock is waiting to be granted, and thewaiting_for column shows the lock ID of the lock object this request is waiting for. Otherwise,waiting_for is empty.waiting_for can refer only to locks on the same row (as identified bynode_id,block_instance,tableid,fragmentid, androwid).
Theserver_locks table was added in NDB 7.5.3.
PDF (A4) - 35.2Mb
Man Pages (TGZ) - 256.4Kb
Man Pages (Zip) - 361.2Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
MySQL Globalization
MySQL Information Schema
MySQL Installation Guide
MySQL and Linux/Unix
MySQL and macOS
MySQL Partitioning
MySQL Performance Schema
MySQL Replication
Using the MySQL Yum Repository
MySQL Restrictions and Limitations
Security in MySQL
MySQL and Solaris
Building MySQL from Source
Starting and Stopping MySQL
MySQL Tutorial
MySQL and Windows
MySQL NDB Cluster 7.5