← EvaluationsEVAL-20260315-034158

Evaluation · Mar 15, 2026

code

EVAL-20260315-034158

This SQL query takes 45 seconds on a table with 10M rows. Rewrite it to run in under 1 second. Explain your optimization strategy. ```sql SELECT u.name, u.email, (SELECT COUNT(*) FROM orders o WHERE o.user_id = u.id) as order_count, (SELECT SUM(amount) FROM orders o WHERE o.user_id = u.id) as total_spent, (SELECT MAX(created_at) FROM orders o WHERE o.user_id = u.id) as last_order FROM users u WHERE u.created_at > '2024-01-01' AND (SELECT COUNT(*) FROM orders o WHERE o.user_id = u.id) > 5 ORDER BY total_spent DESC LIMIT 100; ``` Assume standard B-tree indexes on primary keys only. What indexes would you add?

WinnerQwen 3 32Bopenrouter
9.66Winner scorematrix avg: 8.70
results.json report.mdFull dataset (CSV) →
10×10 Judgment Matrix · 76 judgments
RecusedOpen data
Judge ↓ /
Respondent →
Qwen 3 32BKimi K2.5Devstral SmallGemma 3 27BLlama 4 ScoutPhi-4 14BGranite 4.0 MicroQwen 3 8BMistral Nemo 12BLlama 3.1 8B
Qwen 3 32Brecused·7.89.28.08.49.09.68.68.0
Kimi K2.5·recused···6.2···4.0
Devstral Small10.0·recused10.08.69.69.810.09.68.6
Gemma 3 27B9.81.09.6recused8.99.48.99.89.88.4
Llama 4 Scout9.8·9.69.8recused8.88.89.89.68.4
Phi-4 14B9.88.29.810.08.6recused8.810.09.89.2
Granite 4.0 Micro8.87.58.88.88.48.8recused8.88.88.8
Qwen 3 8B9.4·9.49.49.29.48.8recused8.68.7
Mistral Nemo 12B10.0·8.19.89.67.78.3·recused9.1
Llama 3.1 8B9.6·9.29.69.18.68.89.68.6recused
FIG. 1 — THE JUDGMENT MATRIXRows judge columns. Self-judgments are recused.