Things you didn't know about indexes
Summary
This post explains how database indexing works, including single, composite, functional, partial, and covering indexes. It discusses trade-offs between reads and writes, how to diagnose index usage with EXPLAIN and EXPLAIN ANALYZE, and common gotchas to avoid in PostgreSQL.