Optimize a Slow Query
Read the execution plan, name the real bottleneck, and get a rewrite plus the exact index to add.
Advanced1 min read
Customize
Fill these in and the prompt below updates as you type. Anything you leave blank stays as a placeholder.
Your prompt
5 placeholders leftThis query is slow. Diagnose why and propose faster alternatives. Query: {{query}} Database: {{database}} EXPLAIN / execution plan: {{explain_output}} Relevant tables and row counts: {{table_sizes}} Existing indexes: {{indexes}} Give: 1. The root bottleneck (full scan, bad join order, missing index) 2. A rewritten query 3. Any index to add (with the exact CREATE INDEX) 4. The tradeoff of that index on writes