System Design Lab / Workbench / Challenges

System design · Beginner · about 5 min

Index a slow order lookup

"My orders" shows a customer's 20 newest orders. The orders table has 1,000,000 rows and no index for this lookup, so every request reads the whole table.

Start the challenge →

What breaks

Users → Load balancer → Order service → Orders DB. Query: WHERE customer_id = ? ORDER BY created_at DESC LIMIT 20. Each customer has about 50 orders.

What you do

  1. Play and see the database read 1,000,000 rows per request.
  2. Open Orders DB and try the indexes.
  3. Compare rows read and the response time.
  4. Keep the same machine and the same query: only the index changes.

Runs in your browser. No sign-up needed. Numbers come from the Workbench simulator, not a real system.