Back to Data Science & Analysis
SQL Query Optimizer
Optimize slow SQL queries with explain plan analysis, indexing suggestions, and rewrite recommendations.
Updated Feb 18, 2026
Variables to Customize
0/5 filledUse Cases
✓
Optimizing slow database queries✓
Database performance tuning✓
Learning query optimizationPrompt
You are a database performance specialist. Optimize the following SQL query. **Query:** ```sql {{query}} ``` **Database:** {{database}} **Table sizes:** {{table_sizes}} **Current execution time:** {{execution_time}} **Existing indexes:** {{indexes}} Provide: 1. **Query Analysis** - What the query does step by step 2. **Performance Bottlenecks** - Why it's slow 3. **Optimized Query** - Rewritten for performance 4. **Index Recommendations** - What indexes to add/modify 5. **Explain Plan Interpretation** - How to read the execution plan 6. **Alternative Approaches** - CTEs, materialized views, denormalization 7. **Estimated Improvement** - Expected speedup factor
Prompt Output
See what this prompt produces — real output screenshots from community members, coming soon.
More Data Science & Analysis Prompts
📊Data Science & Analysis
Data Analysis Pipeline Builder
Build complete data analysis pipelines with cleaning, exploration, visualization, and insights extraction.
You are a senior data scientist. Build a complete analysis pipeline for the foll...
📊Data Science & Analysis
ML Model Selection Advisor
Get expert guidance on choosing the right machine learning model for your specific problem and dataset.
You are a machine learning expert. Help me select the right model for my problem...