Chapter 28 — Further Reading

Official reference (🔬 CS Student · 🏗️ DBA)

  • PostgreSQL Docs: "Internals" — "Database Physical Storage" (pages, TOAST, the heap), "Write-Ahead Logging (WAL)", "Reliability and the Write-Ahead Log", and "Routine Vacuuming." The authoritative source for everything in this chapter. https://www.postgresql.org/docs/current/internals.html
  • PostgreSQL Docs: "Concurrency Control → VACUUM" and "Routine Database Maintenance Tasks." Dead tuples, autovacuum, bloat, transaction-ID wraparound.

The best deep dives (🔬 CS Student · 🏗️ DBA)

  • "The Internals of PostgreSQL" (interdb.jp) by Hironobu Suzuki — a free, superb, illustrated walkthrough of pages, the buffer manager, WAL, MVCC, and VACUUM. If you want to really understand the engine, read this.
  • "PostgreSQL 14 Internals" (Egor Rogov, free PDF) — an excellent, current, book-length treatment of the internals.
  • Bruce Momjian's "MVCC Unmasked" and WAL talks — clear, authoritative slide decks on MVCC and the WAL.

Operations (🏗️ DBA) — pairs with Chapter 38

  • "Understanding and fighting table bloat in PostgreSQL" — diagnosing/fixing bloat (Case Study 1); pg_repack as a non-locking alternative to VACUUM FULL.
  • Autovacuum tuning guides — making autovacuum keep up with high-churn tables.
  • idle_in_transaction_session_timeout — preventing leaked long transactions.
  • "Never set fsync=off" / durability-settings explainers (Case Study 2).

Reference (this book)

  • Chapter 26–27: MVCC and concurrency, whose mechanics this chapter explains.
  • Chapter 38 — Administration: monitoring bloat, autovacuum tuning, checkpoints, WAL archiving/PITR, replication ops.
  • Chapter 35 — Distributed Databases: replication built on the WAL.

Do, don't just read

  • Demonstrate cold vs. warm cache with EXPLAIN (ANALYZE, BUFFERS).
  • Create and reclaim dead tuples: UPDATE many rows, watch n_dead_tup, VACUUM, watch it drop.
  • Reproduce the bloat mechanism (Case Study 1): in one session BEGIN and leave it open; in another, churn a table; observe VACUUM can't reclaim until you end the first transaction.

Next: Chapter 29 — Connecting Applications — Part V begins: code meets database.