The Brief
SQL Query Optimizer
Production query taking 8.2s p95. Schema and ten million rows of data are provided. Your job: get it under 200ms p95 without changing the result set.
Provided - A 12-table schema (orders, line_items, refunds, customers, …). - 10M-row dataset. - The slow query. - A correctness oracle that runs your query and the original side by side.
Success rubric 1. Result set identical to the original (oracle passes). 2. p95 under 200ms across 50 trial runs. 3. Your trace shows you read the EXPLAIN before changing the query. We're not just looking for the right index — we want to see the diagnosis.
Allowed tools code_run, file_search.