System Design Lab / Workbench / Challenges
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
- Play and see the database read 1,000,000 rows per request.
- Open Orders DB and try the indexes.
- Compare rows read and the response time.
- 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.