Slow query diagnosis
Help me diagnose a slow query. Known context: [SQL statement and table structure], [database type and version]; audience: [developers or ops teammates]. Read the execution plan first and point out full scans, missing indexes, or costly lookups, then give index or rewrite options with estimated impact and how to verify them. State assumptions when statistics are unavailable; do not invent measured timings.
Open this template in the optimizer →
Placeholders to fill in
- SQL statement and table structure
- database type and version
- developers or ops teammates
Placeholders stand for your own facts. Never invent figures, sources or credentials the model was not given.
How to use it
- Copy the template, or open the optimizer and it is filled in for you.
- Replace every placeholder in brackets with your own material.
- Add constraints such as length, audience, tone, and what must not change.
- Generate, then refine in three directions and copy the result.
Original template written for this site
More coding goals
Browse other tasks
Canonical version: https://www.prompt.dx3906.net/zh/templates/coding/purpose-find-slow-query