Tagged articles
SELECT FOR UPDATE
16 articles · Page 1 of 1
This article explains the concept of MySQL pessimistic locking, its implementation via row‑level locks in InnoDB, and provides step‑by‑step SQL examples showing how SELECT … FOR UPDATE secures data against concurrent modifications.
InnoDBMySQLSELECT FOR UPDATE
0 likes · 3 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 the default repeatable‑read isolation level in InnoDB, details the three main lock types—record, gap, and next‑key—and shows how SELECT … FOR UPDATE applies different locking rules depending on primary key, unique, ordinary, range, or table‑scan queries, with practical SQL examples.
Database ConcurrencyInnoDBMySQL
0 likes · 10 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

This article experimentally verifies how SELECT FOR UPDATE behaves under MySQL 5.7 and 8.0 with both REPEATABLE‑READ and READ‑COMMITTED isolation levels, covering primary keys, unique indexes, ordinary indexes, no indexes and range queries, and summarizes when row‑level, gap‑level or table‑level locks are taken.
Database PerformanceMySQLSELECT FOR UPDATE
0 likes · 23 min read


ITPUBJan 26, 2023 · Databases
This article experimentally demonstrates how MySQL's SELECT … FOR UPDATE statement acquires various locks—IX, X, and gap locks—under RC (read‑committed) and RR (repeatable‑read) isolation levels with unique, primary, normal, and missing indexes, revealing when row‑level versus table‑level locking occurs.
Database ConcurrencyInnoDBMySQL
0 likes · 16 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

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
