Tagged articles
15 articles
Page 1 of 1
Architecture & Thinking
Architecture & Thinking
Apr 16, 2024 · Databases

Master MySQL InnoDB Locks: How SELECT…FOR UPDATE Behaves

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 ConcurrencyInnoDBSELECT FOR UPDATE
0 likes · 10 min read
Master MySQL InnoDB Locks: How SELECT…FOR UPDATE Behaves
Su San Talks Tech
Su San Talks Tech
Nov 15, 2023 · Databases

Understanding MySQL SELECT … FOR UPDATE Locks: Row, Gap, or Table?

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.

Gap LockSELECT FOR UPDATElocking
0 likes · 10 min read
Understanding MySQL SELECT … FOR UPDATE Locks: Row, Gap, or Table?
Selected Java Interview Questions
Selected Java Interview Questions
Oct 30, 2023 · Databases

Understanding SELECT ... FOR UPDATE Locks in MySQL

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.

SELECT FOR UPDATESQLdatabase locking
0 likes · 9 min read
Understanding SELECT ... FOR UPDATE Locks in MySQL
ITPUB
ITPUB
Oct 25, 2023 · Databases

SELECT FOR UPDATE: When MySQL Locks Rows vs. Tables – 20 Tested Scenarios

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.

SELECT FOR UPDATElockingmysql
0 likes · 21 min read
SELECT FOR UPDATE: When MySQL Locks Rows vs. Tables – 20 Tested Scenarios
Sanyou's Java Diary
Sanyou's Java Diary
Aug 7, 2023 · Databases

What Locks Does SELECT FOR UPDATE Use? 20 MySQL Scenarios Revealed

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 PerformanceSELECT FOR UPDATElocking
0 likes · 23 min read
What Locks Does SELECT FOR UPDATE Use? 20 MySQL Scenarios Revealed
ITPUB
ITPUB
Jan 26, 2023 · Databases

What Locks Does SELECT … FOR UPDATE Acquire Under Different Isolation Levels?

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 ConcurrencyInnoDBIsolation Levels
0 likes · 16 min read
What Locks Does SELECT … FOR UPDATE Acquire Under Different Isolation Levels?
Java Backend Technology
Java Backend Technology
Sep 20, 2022 · Databases

Does SELECT FOR UPDATE Lock Rows or the Whole Table in MySQL?

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.

SELECT FOR UPDATEmysqlrow lock
0 likes · 4 min read
Does SELECT FOR UPDATE Lock Rows or the Whole Table in MySQL?
Laravel Tech Community
Laravel Tech Community
Jun 22, 2022 · Databases

Understanding MySQL SELECT ... FOR UPDATE: When It Locks Rows vs. Tables

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.

Database TransactionsSELECT FOR UPDATElocking
0 likes · 4 min read
Understanding MySQL SELECT ... FOR UPDATE: When It Locks Rows vs. Tables
Top Architect
Top Architect
Jun 22, 2022 · Databases

Understanding SELECT ... FOR UPDATE Locking in MySQL: Row vs. Table Locks

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.

SELECT FOR UPDATEdatabaselocking
0 likes · 5 min read
Understanding SELECT ... FOR UPDATE Locking in MySQL: Row vs. Table Locks
Top Architect
Top Architect
Nov 3, 2021 · Databases

Understanding SELECT ... FOR UPDATE Locking in MySQL: Row vs. Table Locks

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.

SELECT FOR UPDATESQLmysql
0 likes · 5 min read
Understanding SELECT ... FOR UPDATE Locking in MySQL: Row vs. Table Locks