Tidbit

PostgreSQL Internals

A deep dive into how PostgreSQL actually works under the hood: storage, indexing, MVCC, transactions, and the WAL explained with diagrams.

11 conceptsInteractive diagrams
How a Query Travels Through Postgres
The full lifecycle from SQL text to result rows: parsing, planning, and execution.
The Postgres Process Architecture
Postmaster, backend processes, shared memory, and how connections are managed.
How Tables Are Stored on Disk — The Heap
Pages, tuples, TOAST, and the physical layout of a heap file.
B-Tree Indexes — The Data Structure
How Postgres implements B-trees for fast equality and range lookups.
B-Tree Index Operations — Insert, Split, Scan
The mechanics of inserting rows, page splits, and index scans.
Other Index Types
Hash, GIN, GiST, BRIN, and when to reach for each.
Transactions and ACID
How Postgres guarantees atomicity, consistency, isolation, and durability.
MVCC — Multi-Version Concurrency Control
How Postgres keeps multiple row versions to allow readers and writers to coexist.
Isolation Levels and Anomalies
Read committed, repeatable read, serializable and the anomalies each prevents.
Locking — Row Locks, Table Locks, Deadlocks
The locking hierarchy and how Postgres detects and resolves deadlocks.
WAL — The Write-Ahead Log
How WAL ensures crash recovery and powers streaming replication.