← EvaluationsEVAL-20260402-131651

Evaluation · Apr 02, 2026

code

CODE-013

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?

WinnerClaude Opus 4.6openrouter
9.29Winner scorematrix avg: 7.68
results.json report.mdFull dataset (CSV) →
10×10 Judgment Matrix · 54 judgments
RecusedOpen data
Judge ↓ /
Respondent →
GPT-5.4Gemini 3Claude Opus 4.6Gemini 3.1 ProClaude Sonnet 4.6MiniMax M2.5Grok 4.20GPT-OSS-120BMiMo-V2-FlashDeepSeek V4
GPT-5.4recused7.88.60.58.4··7.87.44.7
Gemini 39.8recused10.01.410.0··9.89.68.0
Claude Opus 4.69.68.6recused1.09.2··9.28.96.5
Gemini 3.1 Pro7.28.09.6recused9.6··7.86.37.7
Claude Sonnet 4.69.38.89.61.0recused··9.69.27.2
MiniMax M2.59.28.69.01.09.0recused·8.89.27.8
Grok 4.209.0·9.00.28.8·recused···
GPT-OSS-120B·8.6·····recused8.6·
MiMo-V2-Flash9.39.39.32.5····recused7.8
DeepSeek V4·········recused
FIG. 1 — THE JUDGMENT MATRIXRows judge columns. Self-judgments are recused.