How They Use AI  |  Newest

<< Home  |  Work

Fixed a slow database query in 2 minutes

AreaWork
AI usedClaude
Sourcer/ClaudeCode
Posted2026-11-13

The move

Upload your database query plan to an AI agent to receive optimization suggestions.

Steps

  1. Export the execution plan for your slow database query.
  2. Upload the query plan and the current SQL code to Claude.
  3. Ask the AI to identify performance bottlenecks and suggest optimizations.
  4. Review the suggested index changes or query rewrites.
  5. Apply the recommended changes to your database.

Prompt for your AI

Analyze this database query plan: [paste query plan]. Suggest specific index changes or query rewrites to improve performance for [describe table size and query goal].

What happened

A junior developer used Claude to analyze a slow database query plan. The AI suggested a partial index and a code rewrite that successfully resolved the performance issue. This allowed the developer to fix a complex problem without needing deep database expertise.

Watch out

AI suggestions may require verification to ensure they do not cause table locks or unintended side effects in production.

Give it to your agent

Read https://howtheyuse.ai/p/fixed-a-slow-database-query-in-2-minutes.md and help me do this.

Sources



Last updated November 26, 2026.