PostgreSQL Index Strategy Guide
summary
Shows concrete measurements from a 26 GB test table with 12 GB shared_buffers and explains when indexes reduce IO versus when planner prefers a sequential scan — e.g. a 1% selective column yields big wins, 5% often does not. Demonstrates partial indexes and function-based MD5 index that make queries index-only and cut IO, and shows write cost and bloat: adding many includes or 18 indexes makes index size approach the table and cripples writes. Gives commands, pg_stat views, and test scripts to reproduce.
AI-written summary · about
chapters (15)
- 0:00PostgreSQL index strategy
- 1:06Indexing goals and trade-offs
- 5:46What indexes are and costs
- 7:16PostgreSQL data pages
- 10:47Statistics and query planning
- 15:57Data distribution and index efficiency
- 20:16Partial indexes benefits
- 23:49Index-only access and covering indexes
- 27:43Index size impact on performance
- 29:06Function-based indexes cost
- 37:32Write costs and index overhead
- 39:42Table bloat in PostgreSQL
- 43:32Testing index strategies
- 44:14Summary
- 45:22Q&A
related talks
45mA Deep Dive into PostgreSQL Indexing
52mA Deep Dive into PostgreSQL Indexing
46mA Deep Dive Into PostgreSQL Indexing
50mImproving Postgres' Efficiency
26mBeyond Joins and Indexes
29mExplaining the Postgres Query Optimizer
29mPostgres Index types and where to find them
40mExplaining the Postgres Query Optimizer
