Indexing Strategies for Postgres at the 100M-Row Mark
B-tree, BRIN, GIN, partial, covering. Which to use when, with explain plans you can copy.
- Author
- Randhir Jassal
- Published
- Reading time
- 9 min read
- Views
- 2 views
Start with the query, not the column
Every index has a write cost. Read the slow query log first.
Composite order matters
Leftmost prefix rule still applies. (status, published_at DESC) answers our listings.
BRIN for append-only
Log tables and time-series do not need B-tree.
Get the next issue
A short, curated email with the newest posts and questions.