← Back to Labs

PostgreSQL MVCC Snapshot Lab

Watch one row version chain pass through reader snapshots, writer commits, and vacuum eligibility under read committed and repeatable read.

READER TRANSACTIONReader: idleNo transaction openSNAPSHOT STATENo snapshot pinnednew readers start from AWRITER TRANSACTIONWriter: idleNo transaction openHEAP PAGE 231MVCC starts with tuple metadata, not with locks around one mutable row body.Axmin 810xmax 0status 'paid'freereusableslot freeunused slotfreereusableslot freeunused slotREAD RESULT + CLEANUPSELECT status -> paidVacuum action: noneVM: all-visible noall-frozen noRead committed would take a fresh statement snapshot here.
Step 1 / 6One committed tuple version exists

The heap page has a single committed row version A. No older history exists, so every new reader sees the same tuple and vacuum has nothing to reclaim.

isolation effect
Read committed would take a fresh statement snapshot here.
read result
SELECT status -> paid
vacuum state
Vacuum action: none

Arrow keys to navigate · R to reset

Tap dots to jump to any step

Read the full article →Take the quiz →