OptimizeMidData / MLAuto-graded
Index and rewrite a 12-second reporting query
Shows whether a crawling database report is diagnosed by measurement rather than guesswork, then made fast enough to ship.A reporting query takes twelve seconds in production. Work from the query plan rather than intuition: read what the planner is actually doing, find what is missing, add the indexes that change the plan, and rewrite the query where the shape itself is the problem. The target is under half a second.25 min
sql
You're done when
- The date column the report filters and orders on is indexed.
- The customer foreign key used for joining is indexed.
- The status column used for filtering is indexed.
- The customer segment column is indexed.
- A composite index is considered where the access pattern calls for one, rather than adding single-column indexes reflexively.
- The query completes comfortably under the target time.
What it measures
SQLReading a query plan and understanding which access path the planner chose and why.
Performance optimizationChanging the plan deliberately through indexing and query shape, then measuring the result.
Indexing judgementKnowing when a composite index beats several single-column ones, and what each one costs on write.
Your environment
Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards
Start this lab
25 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo