DSA Trainer
← System Design Foundations

System Design · Unit 7

Database indexing

You add a feature that looks up users by email, and it works fine with a hundred users. At a million users it crawls. Nothing about your code changed, so what happened? The database is doing more work than you think for that lookup, and an index is usually the fix.

An index is a separate, sorted structure the database keeps so it can find rows without examining every one. It is the difference between flipping to the index at the back of a book and reading the whole book to find a topic.

This unit is about the judgment around indexes: what they speed up, the price they quietly charge on writes, and how to decide which columns deserve one. It is one of the most practical wins in all of system design.

Goal: Explain why a query is fast or slow, what an index speeds up and what it costs, and decide when a column deserves one.
Premium unit

The rest of the System Design course is premium

The first two units are free, and this is where the gate sits. Unlocking premium opens this unit and everything else in both courses:

  • This unit: 5 prediction-first lessons, 3 applied drills, and a 5-question graded test
  • All 20 System Design units, caching to CAP & consistency
  • The full DSA course: every unit, guided problem, and drill

Cancel anytime. Not useful within 7 days? Email for a full refund.

Not sure yet? Start with the free units →