Fix a bug with root-cause analysis
Makes the agent find the cause before patching symptoms.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1
Library / Coding & Technology / Database
EXPLAIN-driven query and index review.
Optimise this query for [MySQL/PostgreSQL]: """ [paste query] """ Table sizes (approx): [rows] Existing indexes: [paste or say unknown] 1. Explain what the query does. 2. Ask me for EXPLAIN / EXPLAIN ANALYZE output if you need it rather than guessing. 3. Suggest index or query changes with the reasoning and trade-offs (write cost, storage). 4. Provide the migration for any index.
Copies your prompt and opens the official site in a new tab. You may need to paste it yourself (Ctrl/⌘ + V). Nothing is sent to the AI by us.
Replace [bracketed] parts with your own details before sending. Want it tailored? Build a custom coding assistant prompt.
A typical one-line request compared with this prompt. We only show sample responses where we've written an illustration.
Prompt
database
1 words · no role, context, format or constraints
Prompt
Optimise this query for [MySQL/PostgreSQL]: """ [paste query] """ Table sizes (approx): [rows] Existing indexes: [paste or say unknown] 1. Explain what the query does. 2. Ask me for EXPLAIN / EXPLAIN ANALYZE output if you need it rather than guessing. 3. Suggest index or query changes with the reasoning and trade-offs (write cost, storage). 4. Provide the migration for any index.
62 words · generated instantly from templates, no AI called
What we added
Makes the agent find the cause before patching symptoms.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1
Behaviour-preserving refactor with tests as a safety net.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1
Covers happy path, edge cases and failures without testing implementation details.
Agent task · Cursor / coding agents, Claude Code, ChatGPT +1