Skip to main content

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​

Covered by Problems​

ProblemDifficultyLink
Local Business Reviews (Yelp)Easy→
News AggregatorMedium→
Search Engine / FB Post SearchHard→

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