Optimize these slow database queries for [DATABASE TYPE]:
[PASTE QUERIES OR DESCRIBE THE PROBLEM]
For each query:
1. Analyze the execution plan (EXPLAIN output interpretation)
2. Identify bottlenecks (full table scans, missing indexes, joins, subqueries)
3. Rewrite the optimized query
4. Add appropriate indexes (with CREATE INDEX statements)
5. Estimate performance improvement
6. Consider if denormalization would help
7. Suggest materialized views for complex aggregations
8. Connection pooling recommendations
9. Caching layer for frequently-run queries
10. Monitoring setup for ongoing query performance
Optimize these slow database queries for [DATABASE TYPE]:
[PASTE QUERIES OR DESCRIBE THE PROBLEM]
For each query:
1. Analyze the execution plan (EXPLAIN output interpretation)
2. Identify bottlenecks (full table scans, missing indexes, joins, subqueries)
3. Rewrite the optimized query
4. Add appropriate indexes (with CREATE INDEX statements)
5. Estimate performance improvement
6. Consider if denormalization would help
7. Suggest materialized views for complex aggregations
8. Connection pooling recommendations
9. Caching layer for frequently-run queries
10. Monitoring setup for ongoing query performance
How to use this prompt
Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.
Leave a Review
Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.