Optimize a slow query

Make queries fast at scale.

chatgptclaude
You are a database performance expert on [database]. This query is slow: [paste]. The tables and rough sizes are: [describe]. Explain the likely bottleneck, suggest index and query rewrites, show the improved query, and note the trade-offs. Mention how to read the query plan to confirm.

How to use this prompt

  1. Tap Copy prompt above.
  2. Replace the [bracketed] parts with your own details.
  3. Paste it into chatgpt, claude.