Affiliate disclosure

Book titles on this page link to Amazon. As an Amazon Associate, DataField.Dev earns from qualifying purchases — at no additional cost to you.

Further Reading: Relational Databases for Data Engineering

Sources are tagged Tier 1 (confident it exists, recommended without reservation) or Tier 2 (real and worth seeking, but confirm the current edition, version, or URL yourself).

PostgreSQL has unusually good primary documentation, so this list leans on it heavily. Most of what you need is free, official, and better written than the secondary material about it.

The primary source

  • The PostgreSQL documentation (postgresql.org/docs). Read these chapters, in this order, and you will know more than most people who use PostgreSQL daily:

  • Chapter 13, "Concurrency Control." MVCC, isolation levels, and why a long transaction prevents cleanup. This is §7.3, in full, from the source. Forty minutes and it is the highest-value reading in this chapter's list.

  • Chapter 14, "Performance Tips." EXPLAIN, planner statistics, and how the cost model works. The section "Using EXPLAIN" is what §7.6 compresses.
  • Chapter 25, "Routine Database Maintenance Tasks." Vacuum, autovacuum, and bloat, explained by the people who wrote it.
  • "Logical Replication" and "Logical Decoding" (chapters 27 and 49 of the manual in the PostgreSQL 16 numbering — check your version, as the numbering moves). What Chapter 14 of this book depends on, including the replication slot behavior that fills disks.

Tier 1, all of it. Check the version selector at the top of every page.

  • Bruce Momjian's presentations (momjian.us/presentations). Free, extensive, and unusually clear slide decks on MVCC internals, query planning, and locking, by a PostgreSQL core developer. The MVCC deck in particular explains with diagrams what Chapter 13 of the manual explains in prose, and the combination sticks better than either alone. Tier 1.

On query plans

  • Hironobu Suzuki, The Internals of PostgreSQL (interdb.jp/pg). A free online book on the storage engine, buffer manager, and query processing. Read Chapter 3 (Query Processing) and Chapter 5 (Concurrency Control) alongside the official documentation — Suzuki is more visual and more willing to show the data structures. Tier 2 — a personal site; it has been stable for years but it is one person's.

  • explain.depesz.com and explain.dalibo.com. Two free tools that take an EXPLAIN (ANALYZE, BUFFERS) output and render it as a tree with the expensive nodes highlighted. Genuinely useful for a plan too large to read by eye, which is most real plans. Do not paste a plan containing production data or query text you would not publish — these are public services. Tier 2.

  • Markus Winand, SQL Performance Explained and the companion site use-the-index-luke.com. The best available explanation of how indexes are actually used by query planners, across four databases rather than one — which is what makes it valuable, because the differences teach you what is essential and what is one engine's choice. The chapters on composite index column order and on index-only scans are §7.5 in more depth. The website is free. Tier 1.

On floating point, since §7.4 depends on it

  • David Goldberg, "What Every Computer Scientist Should Know About Floating-Point Arithmetic" (1991), ACM Computing Surveys. The canonical reference. Longer and more mathematical than you need for §7.4, and worth skimming the first section once so that "floats are inexact" becomes a mechanism you understand rather than a rule you follow. Tier 1.

  • 0.30000000000000004.com. A one-page site listing the output of 0.1 + 0.2 in dozens of languages. Frivolous, memorable, and a genuinely effective way to make the point to a colleague who thinks integer cents is pedantry. Tier 2 — it has been up for a decade; no guarantees.

On MySQL, since you will meet it

  • The MySQL Reference Manual, "InnoDB Storage Engine" and "The Binary Log." The clustered-index behavior in §7.9 and the binlog format that CDC reads. The section on ROW versus STATEMENT binlog format is the one that matters for Chapter 14. Tier 2 — versioned, and the 5.7/8.0 differences are substantial.

  • Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko, High Performance MySQL (O'Reilly). The standard reference. Check the edition — the 4th (2021) is substantially rewritten for MySQL 8.0 and cloud deployment, and earlier editions describe a different world. Tier 2 on edition.

On extraction patterns

  • The Debezium documentation, "PostgreSQL Connector." Read the section on replication slots and WAL retention now, before Chapter 14, because it is the operational hazard in §7.8 described by the tool that creates it. The "How the connector works" section also explains the initial snapshot, which is the part of CDC most people underestimate. Tier 2 — versioned.

  • The psycopg 3 documentation on server-side cursors. Directly relevant to this chapter's first case study: server-side cursors are the correct way to iterate a large result set and they hold a transaction open for the duration. The documentation is honest about this; the honesty is easy to read past. Tier 1.

On the organizational side

  • Chapter 4 of this book, Case Study 2, and this chapter's Case Study 1. They are two halves of the same subject: what happens when a data pipeline meets a production database's operational reality. Read them together if you are about to build your first extract against a live system. Tier 1 (it is in your hand).

If you only read one thing

Read the PostgreSQL manual's Chapter 13, "Concurrency Control." About forty minutes. It is the source of the least intuitive and most expensive failure in this chapter, and reading it once means you will never again be surprised that a SELECT can degrade a production database.

Then run SHOW hot_standby_feedback; against a replica you extract from. It takes ten seconds and a surprising number of people discover an answer they did not expect.