Tagged articles
21 articles
Page 1 of 1
ITPUB
ITPUB
Feb 24, 2026 · Databases

Why INSERT … SELECT Can Lock Your Table and How an Index Saves the Day

A real‑world MySQL incident shows that using INSERT … SELECT without proper indexing can cause full‑table scans and progressive row locks, leading to massive payment failures, but adding an index on the filter column prevents the lock and restores safe batch migration.

INSERT SELECTSQLindex
0 likes · 8 min read
Why INSERT … SELECT Can Lock Your Table and How an Index Saves the Day
Practical DevOps Architecture
Practical DevOps Architecture
May 29, 2025 · Databases

Quick Solutions for MySQL Table Locks

This guide outlines a step‑by‑step method to diagnose and release MySQL table locks by checking open tables, inspecting running processes, querying InnoDB transaction and lock tables, and generating KILL statements to terminate blocking sessions.

Database AdministrationSQLmysql
0 likes · 3 min read
Quick Solutions for MySQL Table Locks
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
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
Liangxu Linux
Liangxu Linux
Oct 7, 2022 · Databases

Why MyISAM’s Table Locks Can Outperform InnoDB in High‑Concurrency Scenarios

This article provides a systematic deep‑dive into MySQL table‑lock mechanics, comparing storage engines, explaining the advantages of table locks, detailing lock acquisition and release rules, showing how to monitor lock statistics, and revealing why MyISAM can deliver superior performance for heavy concurrent insert and select workloads despite using only table‑level locking.

Database PerformanceLock MechanismMyISAM
0 likes · 7 min read
Why MyISAM’s Table Locks Can Outperform InnoDB in High‑Concurrency Scenarios
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
Aikesheng Open Source Community
Aikesheng Open Source Community
Jun 8, 2021 · Databases

Understanding Table Locks in MySQL When Using INSERT INTO SELECT and the Impact of Isolation Levels

The article explains why an INSERT INTO SELECT statement can lock an entire InnoDB table in MySQL, demonstrates the lock behavior with transaction examples, and offers two solutions—adding an index on the filtered column and adjusting the transaction isolation level—to avoid table‑wide blocking.

INSERT SELECTInnoDBindex
0 likes · 13 min read
Understanding Table Locks in MySQL When Using INSERT INTO SELECT and the Impact of Isolation Levels
macrozheng
macrozheng
May 9, 2020 · Databases

Why Insert‑Into‑Select Can Lock Your MySQL Tables and How to Fix It

An engineer’s mishap with a massive ‘INSERT INTO … SELECT’ migration exposed how full‑table scans lock MySQL tables, causing payment failures, and shows that adding an index on the filter column prevents the lock and ensures safe, efficient data transfer.

INSERT INTO SELECTdatabase migrationindex
0 likes · 7 min read
Why Insert‑Into‑Select Can Lock Your MySQL Tables and How to Fix It
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