Explores whether read-only or read-heavy Postgres tables should be heavily indexed. Covers four key dimensions: table size (small tables like 8k rows often see no benefit from indexes due to efficient full scans), query complexity (simple queries can actually be slower with indexes, while complex multi-condition queries benefit greatly), data format (low-cardinality types like booleans are poor candidates for B-tree indexes), and resource constraints (disk space, memory, CPU overhead). Includes benchmark comparisons showing index performance at 10k vs 10M rows with simple and complex queries.

10m read timeFrom neon.com
Post cover image
Table of contents
A quick primer: What’s read-only, what’s indexing, and what’s “heavily”?The 4 dimensions of database indexingThe takeaway