Learning Pathway

01 — Foundations: PostgreSQL Internals 101

8 lessons
  1. 01 MVCC Internals: How PostgreSQL Stores Row Versions How PostgreSQL implements MVCC at the source level: xmin, xmax, t_infomask in the heap tuple header, and why every UPDATE creates a new row…
  2. 02 Write-Ahead Logging: How WAL Guarantees Durability How the PostgreSQL WAL works at the source level: XLogInsert, LSNs, the WAL buffer, fsync at commit, and crash recovery replay.
  3. 03 The Buffer Cache: How shared_buffers and Clock-Sweep Work How the PostgreSQL buffer manager works: BufferDesc, the buffer mapping hash table, pinning, and the clock-sweep eviction algorithm in freelist.c.
  4. 04 Autovacuum Internals: How Dead Tuples Are Reclaimed How autovacuum works at the source level: the launcher/worker model, the dead-tuple threshold formula, vacuumlazy.c phases, and visibility-map maintenance.
  5. 05 The Page Layout: How PostgreSQL Stores Rows on Disk The anatomy of an 8KB PostgreSQL heap page: PageHeaderData, the ItemId line-pointer array, tuples filling from the end, and free-space management.
  6. 06 Snapshots and Visibility: How PostgreSQL Decides What You See How PostgreSQL snapshots work at the source level: SnapshotData (xmin/xmax/xip), GetSnapshotData, and how isolation levels change snapshot timing.
  7. 07 TOAST: How PostgreSQL Stores Oversized Values How TOAST works at the source level: the 2KB threshold, compression and out-of-line storage, varlena headers, and the per-table TOAST relation.
  8. 08 The Lock Manager: How PostgreSQL Coordinates Concurrent Access How PostgreSQL locking works at the source level: heavyweight locks in lock.c, the lock mode conflict table, lightweight locks (LWLocks), and deadlock detection.
Pro

The first lessons are free. Unlock the full pathway and every other pathway with Pro.

See plans

← All pathways