Skip to content

PostgreSQL 18 · First edition · Free to read online

Start with the 8 KB pageUnderstand PostgreSQL

From pages, rows, and indexes on disk to query plans, locks, migrations, and production operations. Every important claim comes with a check you can rerun.

44 chapters · one-minute sample schema · evidence first

View the project on GitHub

Author and translator

The people behind the book

The original book and the Chinese manuscript keep their sources, versions, and license boundaries visible. Select a portrait or name to visit a profile.

A way to read

Turn “why is it slow?” into a question you can test

Start with the physical path through the data, then let measurements guide the decision.

01 · Physical foundations

Count pages first

See how rows, pages, indexes, and cache shape the cost of a query.

02 · Query reasoning

Read the plan next

Follow estimates, scans, and joins so each choice has a number behind it.

03 · Operating practice

Take it to production

Put connections, backups, replicas, partitions, and extensions back into real constraints.

Contents

Eight parts, forty-four chapters

Follow the path from first principles to scaling out. The book icon in the top navigation opens the full chapter menu at any time.

Part I · Chapters 1–2

Front matter

The SQL, PostgreSQL, and lab basics every later chapter assumes.

Read this part

Part II · Chapters 3–11

The machine

Latency, pages, buffers, MVCC, WAL, ACID, vacuum, and why Postgres is not MySQL.

Read this part

Part III · Chapters 12–16

Designing for it

Types, keys, constraints, data models, and the extensions worth knowing.

Read this part

Part IV · Chapters 17–24

Finding rows fast

B-trees, other indexes, plans, the planner, queries, search, and database code.

Read this part

Part V · Chapters 25–27

Changing it

Concurrency, online schema changes, and loading large datasets.

Read this part

Part VI · Chapters 28–36

Running it

Connections, benchmarks, settings, observability, backups, security, providers, and operations.

Read this part

Part VII · Chapters 37–41

Scaling out

Scaling up, replication, partitioning, sharding, and where Postgres loses.

Read this part

Part VIII · Chapters 42–44

Back matter

Checklists, glossary, and the sources cited throughout the book.

Read this part

Edition and license

A book you can open, run, and check again

The English manuscript is published online; its Chinese translation is still being reviewed chapter by chapter.

This site publishes Eight Kilobytes: PostgreSQL from the page up, written by Chase Pierce, with examples run against PostgreSQL 18. The Chinese page is a manuscript under review; it does not relabel the English text or change the original chapter order, figures, code, credits, or license.

The original text, figures, and cover are covered by the Flagon book license. The repository’s source records, migration notes, and build configuration explain how this site is assembled; they do not grant republication rights for the book. Please use GitHub for corrections and suggestions.