Tagged articles
Phantom Read
17 articles · Page 1 of 1
This article explains MySQL's MVCC mechanism in InnoDB, detailing how hidden fields, undo logs, and Read Views enable lock-free snapshot reads, the differences between RC and RR isolation levels, why MVCC prevents non-repeatable reads but not phantom reads, and common pitfalls like long transactions causing undo log bloat.
InnoDBMVCCPhantom Read
0 likes · 11 min read

This article explains how MySQL's Repeatable Read isolation level prevents phantom reads by combining MVCC snapshot reads for consistent views and Next-Key Locks (record + gap locks) to block inserts during current reads like UPDATE, detailing the ReadView mechanism, version chains, and a concrete phantom read scenario.
Isolation LevelMVCCMySQL
0 likes · 8 min read


liandkJul 31, 2026 · Databases
This article explains why database transactions are a core backend skill, breaks down the four ACID properties, clarifies dirty read, non‑repeatable read and phantom read, compares the four isolation levels, and offers practical guidelines for choosing the right level in production.
ACIDDirty ReadMySQL
0 likes · 7 min read

The article explains that MVCC in MySQL InnoDB prevents phantom reads for snapshot (ordinary SELECT) queries by using ReadView, while write‑conflict scenarios that appear as phantom reads are handled by unique index checks and gap locks, highlighting the distinction between snapshot and current reads.
InnoDBMVCCPhantom Read
0 likes · 5 min read

The article explains ACID properties, details how inadequate isolation levels cause dirty reads, non‑repeatable reads, and phantom reads, illustrates each with transaction scenarios and diagrams, and shows how MySQL’s lock types and isolation settings prevent these anomalies, noting the trade‑off between isolation and concurrency.
Dirty ReadMySQLPhantom Read
0 likes · 9 min read

This article investigates whether the REPEATABLE‑READ isolation level in InnoDB fully prevents phantom reads by conducting a series of current‑read and snapshot‑read experiments, analyzing transaction behavior, MVCC mechanisms, and offering recommendations to avoid phantom anomalies.
InnoDBMVCCMySQL
0 likes · 19 min read

This article examines whether the REPEATABLE‑READ isolation level in InnoDB fully prevents phantom reads by conducting systematic current‑read and snapshot‑read experiments, analyzing lock mechanisms, MVCC behavior, and presenting detailed SQL scripts, results, and recommendations for avoiding phantom reads.
InnoDBMVCCMySQL
0 likes · 18 min read

Through a series of MySQL 8.0 experiments, the article demonstrates that InnoDB inserts run concurrently, explains why phantom reads can appear, and details how MVCC, insert‑intention locks, and the ReadView mechanism together prevent phantom read anomalies.
MVCCMySQLPhantom Read
0 likes · 10 min read

This article explains MySQL's four transaction isolation levels—READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, and SERIALIZABLE—detailing their definitions, associated phenomena such as dirty reads, non‑repeatable reads, and phantom reads, and demonstrates how to query and set isolation levels with practical SQL examples.
Database ConcurrencyDirty ReadMySQL
0 likes · 12 min read


ITPUBApr 19, 2023 · Databases
This article explains how InnoDB’s REPEATABLE READ isolation level uses MVCC and gap locks to prevent most phantom reads, illustrates the mechanisms with SQL examples and diagrams, and outlines the remaining edge cases and best practices for fully avoiding phantom reads.
InnoDBMVCCMySQL
0 likes · 9 min read

This article explains MySQL's four transaction isolation levels, illustrating how concurrent transactions can cause dirty reads, non‑repeatable reads, and phantom reads through detailed examples of two transactions interacting via SELECT, UPDATE, and INSERT operations, and summarizes the consistency issues each scenario creates.
Dirty ReadMySQLPhantom Read
0 likes · 4 min read

This article explains the concept of phantom reads, distinguishes them from non‑repeatable reads, critiques the ANSI SQL isolation‑level definitions, and shows how MySQL implements repeatable‑read using locks and MVCC to prevent both strict and loosely defined phantom anomalies.
ANSI SQLIsolation LevelMySQL
0 likes · 14 min read

This article explains MySQL's four transaction isolation levels, focusing on the default Repeatable Read, how MVCC enables snapshot reads to avoid phantom reads, the differences between snapshot and current reads, and practical techniques such as serializable isolation and next‑key locking to fully prevent phantom anomalies.
MVCCMySQLPhantom Read
0 likes · 11 min read

This article explains the four transaction isolation levels, defines phantom reads, and details how MySQL's InnoDB engine uses MVCC snapshot reads and next‑key locking (including the next‑key principle and lock composition) to prevent phantom reads under the REPEATABLE READ isolation level.
InnoDBIsolation LevelMVCC
0 likes · 2 min read

This article explains why phantom reads occur under MySQL's REPEATABLE READ isolation, how InnoDB uses MVCC for snapshot reads and next‑key locks for current reads, and demonstrates the mechanisms with code examples and version‑tracking diagrams.
Isolation LevelMVCCMySQL
0 likes · 7 min read

This article explains MySQL’s transaction isolation levels, clarifies the differences between dirty reads, non‑repeatable reads and phantom reads, and demonstrates through experiments why the REPEATABLE READ level can prevent phantom reads, while also discussing its limitations, MVCC, and locking mechanisms.
MVCCMySQLPhantom Read
0 likes · 14 min read

This article examines why concurrent upsert operations in a high‑throughput MySQL service can cause deadlocks due to GAP locks and phantom reads, explains the underlying InnoDB locking mechanisms, and offers practical solutions such as adjusting isolation levels or redesigning data sharding logic.
MySQLPhantom Readdeadlock
0 likes · 9 min read
