A free, self-paced textbook in 7 chapters. Read a chapter, then drill it with the 103 companion flashcards using spaced repetition.
PostgreSQL performance tuning almost always starts with finding the right queries to fix. The canonical tool is the pg_stat_statements extension, which records normalized query tex...
Indexes are usually the highest-leverage tuning tool in PostgreSQL. The default access method is B-tree, created simply with CREATE INDEX ON t (col), and it serves equality and ran...
Two maintenance commands, ANALYZE and VACUUM, are central to keeping PostgreSQL fast. ANALYZE refreshes the row-count and distribution statistics that the planner relies on for cos...
PostgreSQL's concurrency model is MVCC, in which each row version carries the inserting transaction's xmin and the deleting transaction's xmax. A transaction's snapshot decides whi...
A few settings carry most of the weight on a tuned PostgreSQL server. shared_buffers controls the database's own page cache, with a common starting point of about 25% of RAM on ded...
When a single server isn't enough, the first move is usually read scaling via streaming replication. A primary publishes its write-ahead log (WAL) to one or more replicas, which re...
Many schema design choices have surprisingly large performance consequences. UUID primary keys of the v4 flavor are random and cause B-tree fragmentation because newly inserted row...