Before you start. The last lesson showed you the index: a wide, shallow tree of pages that finds any row in three or four page reads. This one is about what happens to the row itself once two people try to read it and write it at the same moment.
Lesson 9 of 26 in Database Internals
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
Monday, July 20th, 2015: the database that stopped taking writes
The trick: an UPDATE writes a new version, it does not erase the old one
How two readers see two different truths: the snapshot
The bill comes due: old versions, and the VACUUM
The clock that ran out: wraparound
Terms it explains: version, MVCC, snapshot, VACUUM, wraparound, frozen, version chain, hint bits, fresh snapshot per statement, plus SSI, anti-wraparound vacuums.
Lab
One transaction has been open for an hour and nobody noticed. Why is the table three times the size of its data?
Press Commit next transaction to the end, then drag How long the oldest reader has been sitting there right and watch The bill.