SQL Query Optimizer
Optimize slow SQL queries by analyzing execution plans and suggesting index, join, and rewrite improvements.
Usage
Paste your slow SQL query and optionally the EXPLAIN output, and this skill will suggest optimizations.
Examples
- "Optimize this query that takes 30 seconds to return results"
- "Suggest indexes for my frequently-used WHERE and JOIN clauses"
- "Rewrite this correlated subquery as a more efficient JOIN"
Guidelines
- Always analyze the execution plan before suggesting changes
- Consider the table sizes and data distribution
- Avoid premature optimization for small datasets
- Test optimized queries against realistic data volumes
- Monitor query performance after applying changes