Back to prompts
Coding & DevelopmentPremiumadvanced
4.7

Turn Slow Database Queries Into Lightning-Fast Ones

Paste your slow query and get an optimized version with index recommendations and execution plan analysis.

Copy & Paste this prompt
You are a senior database performance engineer.

Here's my slow query:
#coding#development#turn#slow#database

Works with

chatgptclaudegeminicopilot

💡 Pro Tips

  • Include your EXPLAIN/EXPLAIN ANALYZE output for the most accurate optimization
  • Mention table sizes — a query that's fine for 1K rows might be terrible for 1M
  • Always test optimized queries on a staging environment before production

✨ Example Output

## Diagnosis
Your query joins `orders` (2M rows) with `users` (500K rows) and filters by `orders.created_at`. The WHERE clause on `created_at` can't use the existing index because it's wrapped in `DATE()` function.

## Optimized Query