The Internals of PostgreSQL interdb.jp · 283 points · 22 comments · HN thread TL...

@best30

The Internals of PostgreSQL interdb.jp · 283 points · 22 comments · HN thread

TL;DR The Internals of PostgreSQL is an open online book by Hironobu Suzuki that explains how PostgreSQL's subsystems work, from process architecture and query processing to MVCC, VACUUM, buffer management, WAL and replication. The page covers versions up to 19-beta (excluding the new buffer page lock mechanism); a Section 8.5 on asynchronous I/O was published in June 2026 and Chapter 12 on logical replication is in beta. The page also carries the author's personal note that he is seeking work abroad, which is unrelated to the documentation itself.

  • Documentation is split into 12 chapters covering database cluster and tables, process and memory architecture, query processing, foreign data wrappers, concurrency control, VACUUM, HOT updates and index-only scans, buffer manager, WAL, online backup and PITR, streaming replication, and logical replication.
  • Covers PostgreSQL 19-beta (excluding the new buffer page lock mechanism) and earlier versions.
  • Latest additions: Section 8.5 on asynchronous I/O (28 Jun 2026) and Chapter 12 on logical replication, still marked beta (1 May 2026).
  • First published 26 September 2015; a Chinese edition was published in June 2019, and some academic papers cite it.
  • The author, Hironobu Suzuki, is a former director of the Japan PostgreSQL Users Group and wrote seven database books; the page states he is looking for remote or visa-sponsored PostgreSQL work abroad.
  • The page states that, due to the XZ backdoor incident, he no longer accepts contact from anonymous individuals.

Discussion The thread is a mix of practical tips, debate over Postgres's MVCC design, and some side remarks. Several commenters point to earlier HN threads on the same book, and one recalls using it in 2018 alongside CMU database courses. The MVCC subthread is the longest, comparing Postgres's vacuum-based approach with OrioleDB and Oracle's undo-based design, with some pointed disagreement. Other comments give concrete HOT and fillfactor advice, mention Postgres 18 full-text search and collation changes, and promote a new cache project. The mood is mostly informed and matter-of-fact, with a few light jokes and one meta-discussion about whether a comment was AI-generated.

  • MVCC and vacuum design is a real operational weakness (some): Commenters note that Postgres's dead-tuple and vacuum model causes bloat and CPU pressure, and that it is unlikely to change soon. Tom Lane is cited as not seeing a move away from dead tuples and vacuuming.
  • OrioleDB is a viable alternative MVCC for Postgres (a few): One commenter argues OrioleDB is friendlier to SSDs and already used in production despite beta status, and that Postgres users would benefit from knowing about it.
  • Oracle's undo-based MVCC fails more gracefully (a few): A commenter who works on Oracle's DB group argues that Oracle's snapshot-too-old failures limit damage to a single long-running query, while Postgres's failure mode can take the whole database down. Another reply notes the disclosure about the author's employer.
  • The book is valuable for practical tuning (some): Several commenters highlight the HOT chapter as directly useful: HOT is disabled when indexed columns change, and lowering fillfactor on update-heavy tables can help. Others caution that lowering fillfactor is not always good for wide rows.
  • The book is a long-standing learning resource (some): Commenters describe using it for learning kernel internals, including a team at Greenplum in 2018, and note that beginners can now combine it with AI tools.
  • Chapter 12 needs updating for Postgres 18 collations (a few): One commenter notes that Postgres 18 changed full-text search to use the cluster's default collation provider, so ICU or builtin collations can change behavior and require reindexing.

Links from the comments

#PostgreSQL #Databases #MVCC #Documentation #QueryInternals