Reference · Course map

Course map & review plan

Every lesson's keystone on one page, the threads that connect them, and a spaced-review schedule to turn fluency into durable memory.

Living document10 lessons · 5 pillars · core completeContext: PostgreSQL current

Pillar 1 · Storage & MVCC (consolidated)

#LessonKeystone — recall this first
0001Heap & MVCCTable = unordered heap; Postgres never updates in place — new version, old expired.
0002VACUUM, autovacuum & HOTPlain VACUUM reuses space (doesn't shrink); autovacuum ~20% dead; HOT = update with no indexed col changed + page room.
0003Visibility mapEvery index secondary → two-step heap fetch; the visibility map (set by VACUUM) earns an index-only scan.
0004XIDs, freezing & wraparoundVisibility = compare 32-bit XIDs (circular); freezing is VACUUM's third job; neglect → write-refusal outage.

Pillar 2 · Transactions

#LessonKeystone
0005Snapshot isolationA snapshot = a captured set of XIDs; a level just chooses when to take it. RC (default) / RR (40001 retry) / Serializable (SSI, kills write skew).

Pillar 3 · The planner

#LessonKeystone
0006Reading EXPLAINPlan = tree of nodes; cost in page-fetch units; estimated vs actual rows is the #1 check; BUFFERS read = disk.
0008Why the planner ignores your indexCost-based: the index lost a comparison. Selectivity picks index/bitmap/seq; tune random_page_cost on SSD; stale stats → ANALYZE.

Pillar 4 · Durability

#LessonKeystone
0009The WAL & checkpointsLog before data; only WAL flushed at commit; REDO on recovery; checkpoints bound replay. WAL = redo-only (no undo — heap holds MVCC). synchronous_commit dial.

Pillar 5 · Replication

#LessonKeystone
0010Streaming vs logicalShip the WAL: physical (bytes → whole-cluster clone) vs logical (row changes → subset/cross-version). Async = failover loss window; sync = synchronous_commit over the network.

The threads that tie it together

"Why VACUUM" runs through everything. VACUUM has three jobs — reclaim dead tuples (0002), maintain the visibility map for index-only scans (0003), and freeze old XIDs to prevent wraparound (0004) — and it also runs ANALYZE to keep the planner's estimates fresh (0006). Almost every Postgres operational story is a VACUUM story.
XIDs are the spine of MVCC. Tuples carry xmin/xmax XIDs (0004); visibility is an XID comparison against a snapshot (0004); a snapshot is a captured set of XIDs and an isolation level is when you take it (0005).
The keystone reaches the surface. "No clustered index → every index secondary" (0001) is why an index scan is two-step (0003), why non-HOT updates touch every index (0002), and why you see Index/Index-Only/Bitmap-Heap scan nodes in EXPLAIN (0006).

Spaced-review schedule

Retrieval beats re-reading. Do these closed-book, then check against the cheat sheets. Space them out — the gaps are the point.

WhenReview
NowThe interleaved review: lesson 0007.
~3 daysRecite VACUUM's three jobs + the "never update in place → dead tuples → bloat → VACUUM" chain, from memory.
~1 weekRe-take the 0007 quiz cold. Re-derive: why is the wraparound horizon 2 billion, not 4?
~2 weeksExplain, out loud, the three isolation levels as snapshot-timing choices + when each errors 40001.
~1 monthRead a real EXPLAIN (ANALYZE, BUFFERS) and narrate every number. Bring a surprising one to your teacher.