Why One MySQL UPDATE Blocks and Another Doesn’t: Row vs. Gap Locks Explained
The article examines a MySQL experiment where three transactions (A, B, C) interact on the same row, showing why transaction B’s UPDATE on a primary‑key field proceeds without waiting while transaction C’s UPDATE of the primary key blocks, due to the interplay of row‑level locks, gap locks, and the internal delete‑plus‑insert transformation of indexed updates.
