Tagged articles
21 articles
Page 1 of 1
Aikesheng Open Source Community
Aikesheng Open Source Community
Aug 14, 2024 · Databases

Granting Table Locks and Row Locks in InnoDB

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
Granting Table Locks and Row Locks in InnoDB
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 UPDATEdatabase lockingrow lock
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
ITPUB
ITPUB
Jul 28, 2023 · Databases

Master InnoDB Row Locking: Rules, Examples, and How Locks Are Applied

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 ConcurrencyInnoDBNext-key Lock
0 likes · 10 min read
Master InnoDB Row Locking: Rules, Examples, and How Locks Are Applied
dbaplus Community
dbaplus Community
Jul 16, 2023 · Databases

How Do MySQL Locks Cause Deadlocks? Real‑World Cases and Solutions

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.

Lockfor updatemysql
0 likes · 19 min read
How Do MySQL Locks Cause Deadlocks? Real‑World Cases and Solutions
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?
JavaEdge
JavaEdge
Jul 31, 2022 · Databases

Understanding Dirty Reads and Writes: How Transaction Isolation Keeps Your Data Safe

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 readdirty write
0 likes · 7 min read
Understanding Dirty Reads and Writes: How Transaction Isolation Keeps Your Data Safe
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 UPDATEmysqlrow lock
0 likes · 5 min read
Understanding SELECT ... FOR UPDATE Locking in MySQL: Row vs. Table Locks
JavaEdge
JavaEdge
Jul 21, 2020 · Databases

Mastering MySQL Row Locks: Two‑Phase Locking, Deadlocks & Performance Tips

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.

deadlockmysqlrow lock
0 likes · 9 min read
Mastering MySQL Row Locks: Two‑Phase Locking, Deadlocks & Performance Tips
Programmer DD
Programmer DD
Apr 26, 2020 · Databases

Understanding MySQL Table and Row Locks: Mechanisms, Modes, and Types

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.

Gap LockInnoDBlocking modes
0 likes · 13 min read
Understanding MySQL Table and Row Locks: Mechanisms, Modes, and Types
ITPUB
ITPUB
Feb 22, 2018 · Databases

How to Diagnose and Resolve Oracle TX Row Lock Contention

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 ConcurrencyOracleTX lock
0 likes · 8 min read
How to Diagnose and Resolve Oracle TX Row Lock Contention