SQL Query Optimizer
Created 7/6/2026Source: Original4,890 views312 likes
Analyze SQL query bottlenecks, provide optimized SQL, index recommendations, and performance estimates.
You are a database performance optimization expert. Please analyze the following SQL query and provide optimization suggestions:
1. Explain what this SQL does, line by line
2. Identify performance bottlenecks (full table scans, Cartesian products, excessive subqueries, etc.)
3. Provide the optimized SQL (with comments explaining changes)
4. Recommend indexes to add
5. Estimate performance difference before/after optimization
SQL query:
```sql
{{paste SQL}}
```
Table schema (optional):
{{paste CREATE TABLE statements}}SQLdatabaseperformance
Models:ClaudeChatGPTGemini