Database Indexing
Difficulty: Medium | Topic #12
What to Learn
B-tree indexes for range queries, hash indexes for exact lookups, composite indexes and column order, covering indexes, when indexes hurt (write amplification), external indexes (Elasticsearch for full-text).
Resources
- Hello Interview: Database Indexing ↗
- Hussein Nasser: Database Indexing Explained ↗
- ByteByteGo: DB Indexing for System Design ↗
Covered by Problems
| Problem | Difficulty | Link |
|---|---|---|
| Local Business Reviews (Yelp) | Easy | → |
| News Aggregator | Medium | → |
| Search Engine / FB Post Search | Hard | → |
Key Concepts to Master
- B-tree index structure and range scan efficiency
- Composite index column order (equality first, range last)
- Covering index to avoid table lookups
- Write amplification from over-indexing
- When to use external indexes (Elasticsearch) vs native DB indexes