technotes · topic

PostgreSQL

First-principles depth, taught by contrast with InnoDB — the heap & MVCC, VACUUM & bloat, the planner, snapshot isolation, the WAL & replication.

GlossaryContext: PostgreSQL current (16/17+)Mission core complete — all pillars

Lessons

  1. 0001 The heap & MVCC

    Postgres never updates in place — so dead tuples, VACUUM, bloat, and "every index is secondary" all derive from one keystone fact.

    done
  2. 0002 Dead tuples, VACUUM & HOT updates

    Following the dead tuples: what plain VACUUM vs VACUUM FULL do, when autovacuum fires (~20% dead), and how HOT lets an update skip every index.

    done
  3. 0003 Secondary indexes & the visibility map

    Why every index scan is a two-step heap fetch, how the visibility map (set by VACUUM) earns an index-only scan, and INCLUDE covering indexes.

    done
  4. 0004 Transaction IDs, freezing & wraparound

    The 32-bit XID clock that InnoDB's undo log hides — why old rows must be frozen, and the wraparound that VACUUM exists to prevent.

    done
  5. 0005 Snapshot isolation: Read Committed → Serializable

    A snapshot is just a captured set of XIDs — so an isolation level is a timing choice. RC vs RR vs Serializable (SSI), the optimistic Postgres way.

    done
  6. 0006 Reading EXPLAIN (ANALYZE, BUFFERS)

    The plan as a tree of nodes: cost, estimated vs actual rows, BUFFERS for cache vs disk, and the scan nodes from the storage arc.

    done
  7. 0007 Interleaved review

    Storage, transactions & the planner mixed on purpose — cross-pillar quiz, diagnose-it scenarios, a synthesis prompt, and community pointers.

    done
  8. 0008 Why the planner ignores your index

    Selectivity, random_page_cost, and the cases where a Seq Scan is genuinely the right call — the Postgres cousin of "when indexes are ignored."

    done
  9. 0009 Durability: the WAL & checkpoints

    Write-ahead logging — log before data, checkpoints, the synchronous_commit dial, and why Postgres needs one log where InnoDB needs two.

    done
  10. 0010 Replication: streaming vs logical

    Ship the WAL to a replica — physical (streaming) vs logical replication, and the sync-vs-async availability/consistency trade-off.

    done

Reference

These lessons have a teacher attached, and this course leans on your InnoDB knowledge on purpose. Bring a real EXPLAIN, a bloat mystery, or a Postgres-vs-MySQL contrast that feels off, and we'll dissect it together.