Backend concept

SQL Indexes

Single-column indexes, composite indexes, leftmost prefix rules, covering indexes, and write overhead.

Practice this concept Review missed items Back to concept map

Why this matters

Indexes are one of the highest leverage tools for making backend queries predictable under load.

How to practice

Match equality filters, sort order, range predicates, and selected columns deliberately.

0 active misses 0 reviewed 0 games completed

Local review for this concept

No local review items for this concept yet.

Start a focused review session for SQL Indexes.

Learning objectives

  • Choose indexes that match filters and ordering.
  • Apply the leftmost prefix rule for composite indexes.
  • Recognize when an index is low-value or creates unnecessary write overhead.
  • Apply expand-contract thinking to columns, renames, indexes, and constraints.
  • Plan backfills that avoid unnecessary locks and production load spikes.
  • Explain why schema changes must be compatible with mixed application versions.

Common mistakes to avoid

  • Indexing a low-cardinality boolean column by itself and expecting a large speedup.
  • Creating composite indexes in the wrong column order.
  • Ignoring ORDER BY and then paying for a separate sort.
  • Renaming or dropping a column while old app versions still use it.
  • Running huge backfills or index builds in the most blocking mode during peak traffic.
  • Adding constraints before all writers and old rows satisfy them.

Games for SQL Indexes

Start with the first game, then use local review history to revisit missed decisions.

Databases Intermediate

SQL Index Quest

Choose the best database index for simplified schemas and queries while learning full scans, covering indexes, sort avoidance, and composite order.

Time
7-10 minutes
Concept
Database indexing and query performance
  • Data & Performance
  • SQL
  • indexes
  • performance
Play SQL Index Quest
Databases Intermediate

Schema Migration Runbook

Choose safe zero-downtime database migration steps for expanding schemas, backfilling data, rolling out indexes, enforcing constraints, and recovering from failures.

Time
6-9 minutes
Concept
Zero-downtime schema migration planning and expand-contract releases
  • Data & Performance
  • migrations
  • schema design
  • backfill
Play Schema Migration Runbook
Databases Advanced

Transaction Isolation Arena

Defend database invariants from concurrent requests by choosing transactions, locks, constraints, snapshot reads, and optimistic concurrency.

Time
7-10 minutes
Concept
Database transactions, isolation anomalies, locks, and invariant protection
  • Data & Performance
  • SQL
  • transactions
  • isolation
Play Transaction Isolation Arena