← EvaluationsEVAL-20260318-161904

Evaluation · Mar 18, 2026

code

EVAL-20260318-161904

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?

WinnerGPT-5.4openrouter
9.72Winner scorematrix avg: 8.27
results.json report.mdFull dataset (CSV) →
10×10 Judgment Matrix · 56 judgments
RecusedOpen data
Judge ↓ /
Respondent →
MiniMax M2.7MiniMax M2.5MiniMax M2.1MiniMax M2MiniMax M1MiniMax-01Claude Sonnet 4.6GPT-5.4
MiniMax M2.7recused8.87.14.910.08.69.89.6
MiniMax M2.510.0recused6.54.59.68.310.09.8
MiniMax M2.19.28.6recused2.110.08.110.010.0
MiniMax M29.410.07.8recused9.88.410.09.6
MiniMax M19.89.68.34.3recused7.310.010.0
MiniMax-019.89.68.67.69.8recused10.09.8
Claude Sonnet 4.68.69.25.75.09.38.0recused9.3
GPT-5.47.07.05.22.57.26.67.8recused
FIG. 1 — THE JUDGMENT MATRIXRows judge columns. Self-judgments are recused.