Internal Locking Methods •Possible to lock a single row for a long time. •Relatively little memory required (row locking requires memory per row or group of rows locked) •Fast when used on a large part of the table because only a single lock is involved. •Fast if you often do  GROUP BY  operations on a large part of the data or must scan the entire table frequently. 1. If there are no locks on the table, put a write lock on it. 2. Otherwise, put the lock request in the write lock queue. 1. If there are no write locks on the table, put a read lock on it. 2. Otherwise, put the lock request in the read lock queue. 1823 The  MyISAM  storage engine supports concurrent inserts to reduce contention between readers and writers for a given table: If a  MyISAM  table has no free blocks in the middle of the data file, rows are always The Performance Schema lock tables also provide locking information. See Section 27.12.13, “Performance Schema Lock Tables” . You can analyze the table lock contention on your system by checking the  Table_locks_immediate and  Table_locks_waited  status variables, which indicate the number of times that requests for table locks could be granted immediately and the number that had to wait, respectively: For information on altering the priority of reads and writes, see Section 8.11.2, “Table Locking Issues” . Table updates are given higher priority than table retrievals. Therefore, when a lock is released, the lock is made available to the requests in the write lock queue and then to the requests in the read lock queue. This ensures that updates to a table are not “starved”  even when there is heavy  SELECT  activity for the table. However, if there are many updates for a table,  SELECT  statements wait until there are no more updates. MySQL grants table read locks as follows: MySQL grants table write locks as follows: Advantages of table-level locking: These storage engines avoid deadlocks by always requesting all needed locks at once at the beginning of a query and always locking the tables in the same order. The tradeoff is that this strategy reduces concurrency; other sessions that want to modify the table must wait until the current data change statement finishes. MySQL uses table-level locking for  MyISAM ,  MEMORY , and  MERGE  tables, permitting only one session to update those tables at a time. This locking level makes these storage engines more suitable for read-only, read-mostly, or single-user applications. Table-Level Locking mysql>  SHOW STATUS LIKE ’Table%’; +-----------------------+---------+ | Variable_name | Value | +-----------------------+---------+ | Table_locks_immediate | 1151552 | | Table_locks_waited | 15324 | +-----------------------+---------+