Tagged articles
Row Lock
25 articles · Page 1 of 1

liandkAug 20, 2026 · Databases
Understanding MySQL’s lock types—table, row, and gap locks—reveals how they act as resource tokens to ensure data consistency under concurrency, while the article details their characteristics, appropriate and prohibited use cases, common pitfalls like lock degradation and deadlocks, and provides hands‑on SQL examples to reproduce and avoid these issues.
ConcurrencyLocksMySQL
0 likes · 10 min read

This article breaks down MySQL’s locking mechanisms—table, row, and gap locks—explaining their principles, performance trade‑offs, when they are triggered, how they relate to index usage, and provides practical deadlock avoidance techniques and a concise cheat‑sheet for common concurrency problems.
ConcurrencyLocksMySQL
0 likes · 7 min read

An UPDATE in MySQL 8.0 acquires three distinct locks—a server‑level metadata lock, an InnoDB intention exclusive lock (IX), and a row‑level exclusive lock—so understanding the three‑layer lock architecture (metadata, intention, row) helps both interview preparation and troubleshooting.
InnoDBIntention LockLocks
0 likes · 14 min read

This article explains how InnoDB in MySQL 8.0.32 grants table and row locks, detailing the active versus passive acquisition, the lock‑granting algorithms for tables and rows, and the priority, weight, and FIFO rules that determine lock ordering and deadlock handling.
Database ConcurrencyInnoDBMySQL
0 likes · 11 min read

This article explains how MySQL's SELECT ... FOR UPDATE statement acquires either row-level or table-level locks depending on the presence of indexes or primary keys, and demonstrates the behavior with multiple transaction examples and a sample table definition.
MySQLRow LockSELECT FOR UPDATE
0 likes · 4 min read

This article explains how MySQL's SELECT … FOR UPDATE statement applies different lock types—row, gap, or table—depending on whether the WHERE clause uses primary keys, unique indexes, regular indexes, range queries, or empty results, and demonstrates each case with practical SQL examples and screenshots.
MySQLRow LockSELECT FOR UPDATE
0 likes · 10 min read

This article sets up a MySQL 5.7 environment, runs a series of SELECT FOR UPDATE queries on primary keys, unique indexes, normal indexes, range scans and non‑indexed columns, then analyzes the resulting lock types—row, gap, next‑key and table locks—and distills practical locking rules.
InnoDBMySQLRow Lock
0 likes · 13 min read

This article explains how MySQL's SELECT ... FOR UPDATE statement applies different lock types—row, table, or none—depending on whether the WHERE clause uses primary keys, unique indexes, regular indexes, range queries, non‑indexed fields, or returns no rows, illustrated with practical transaction examples.
Row LockSELECT FOR UPDATESQL
0 likes · 9 min read


ITPUBOct 25, 2023 · Databases
This article systematically investigates how MySQL's SELECT FOR UPDATE behaves under different versions (5.7 and 8.0) and isolation levels (RR and RC), covering twenty scenarios that vary by index type and query range, and summarizes whether the statement acquires row‑level, gap, or table‑level locks.
MySQLRow LockSELECT FOR UPDATE
0 likes · 21 min read


ITPUBJul 28, 2023 · Databases
This article explains InnoDB's three row‑lock types, when MySQL statements acquire implicit or explicit locks, and walks through concrete examples for unique and non‑unique index queries, showing how Next‑key, Record and Gap locks are determined.
Database ConcurrencyInnoDBMySQL
0 likes · 10 min read

This article explains MySQL deadlocks through practical examples, covering lock types, exclusive vs. shared locks, lock‑in‑share‑mode vs. FOR UPDATE differences, real‑world deadlock scenarios, and multiple strategies—including isolation level tweaks, optimistic locking, and distributed locks—to prevent and resolve them.
LockMySQLRow Lock
0 likes · 19 min read

This article experimentally verifies how SELECT FOR UPDATE behaves under different MySQL versions, isolation levels, and index conditions, revealing when it acquires row‑level, gap, or table‑level locks across 20 distinct scenarios.
InnoDBMySQLRow Lock
0 likes · 22 min read

This article explains how MySQL's SELECT … FOR UPDATE adds a pessimistic lock, and demonstrates that using an indexed column or primary key results in a row lock, while lacking an index causes a table lock, with step‑by‑step verification using multiple transaction examples.
MySQLRow LockSELECT FOR UPDATE
0 likes · 4 min read

When two transactions access the same data without proper coordination, concurrency bugs such as dirty reads and dirty writes can arise; the article explains these problems, the guarantees of isolation levels, and how row locks and snapshot techniques prevent them in modern databases.
Database ConcurrencyDirty ReadRow Lock
0 likes · 7 min read

This article explains how a plain SELECT does not lock data, while SELECT … FOR UPDATE adds a pessimistic lock whose scope—row or table—depends on whether the query uses an indexed or primary‑key column, and demonstrates the behavior with SQL examples and transaction scenarios.
MySQLRow LockSELECT FOR UPDATE
0 likes · 4 min read

This article explains how the SELECT ... FOR UPDATE statement in MySQL adds a pessimistic lock, describes when it results in a row lock versus a table lock based on index usage, provides verification SQL, example scenarios, and practical tips for transaction handling.
MySQLRow LockSELECT FOR UPDATE
0 likes · 5 min read

This article explains how MySQL's SELECT ... FOR UPDATE statement adds a pessimistic lock, detailing when it results in row-level locking versus table-level locking based on the presence of indexes or primary keys, and demonstrates the behavior with multiple practical examples.
MySQLRow LockSELECT FOR UPDATE
0 likes · 5 min read

This article explains how the MySQL SELECT … FOR UPDATE statement adds a pessimistic lock, why the lock type (row or table) depends on the presence of an index or primary key, and demonstrates the behavior with practical examples and SQL scripts.
IndexMySQLRow Lock
0 likes · 5 min read

This article explains how MySQL's SELECT ... FOR UPDATE statement adds pessimistic locks, detailing when it results in row‑level locks versus table‑level locks based on the presence of indexes or primary keys, and provides verification examples with code and transaction scenarios.
MySQLRow LockSELECT FOR UPDATE
0 likes · 4 min read

This article explains how MySQL implements row‑level locking, the two‑phase locking protocol, common deadlock scenarios with online ticket sales, and practical strategies—including lock ordering, deadlock detection settings and sharding tricks—to improve concurrency and reduce CPU overhead.
MySQLRow Lockdeadlock
0 likes · 9 min read

This article explains the differences between MySQL table locks and row locks, how they are implemented by the server and storage engines, the lock modes and types (including intention, auto‑increment, gap, next‑key, and insert‑intention locks), and provides practical SQL examples with diagrams.
InnoDBMySQLRow Lock
0 likes · 13 min read

This article explains the differences between MySQL table locks and row locks, describes how MyISAM and InnoDB handle locking, provides explicit lock syntax with examples, discusses gap locks, and offers practical recommendations for avoiding lock contention in concurrent applications.
ConcurrencyInnoDBLocks
0 likes · 7 min read

This article explains MySQL shared (S) and exclusive (X) row‑level locks, demonstrates their behavior with two concurrent sessions, shows how lock ordering can cause deadlocks, and provides practical tips for using InnoDB locking correctly.
Exclusive LockInnoDBMySQL
0 likes · 8 min read

This article explains MySQL's lock mechanisms, covering table‑level, row‑level, and page locks, the differences between pessimistic and optimistic locking, shared locks, and provides guidance on when to choose table locks versus row locks in various application scenarios.
Database ConcurrencyLocksMySQL
0 likes · 7 min read


ITPUBFeb 22, 2018 · Databases
This guide explains Oracle's TX row lock mechanism, shows how to identify blocking sessions, locate the exact locked rows using system views and ROWID functions, and provides practical steps to prevent and mitigate TX lock waiting issues.
Database ConcurrencyOracleRow Lock
0 likes · 8 min read
