Skip to content

Database Optimizer

Diagnoses slow PostgreSQL and MySQL queries and suggests indexes, rewrites and config tuning.

Stars
12,176
Licence
MIT
Files
6 files

What it does

Once installed, the agent approaches database slowness in a structured way: it asks for baseline measurements, reads query execution plans (EXPLAIN ANALYZE), identifies bottlenecks such as missing indexes or stale statistics, and proposes index designs, query rewrites and configuration changes with the SQL to apply them. It also gives validation queries to confirm the improvement and a checklist for monitoring afterwards. Reference notes cover PostgreSQL tuning, MySQL tuning, index strategies, query optimization and monitoring.

Great for

  • Backend developers investigating a slow query or endpoint in PostgreSQL or MySQL
  • DBAs or data engineers who want a structured checklist for index and configuration tuning
  • Teams planning index changes that must be applied without locking production tables

Skip it if

  • Production databases changed directly without a staging copy, because the skill itself says changes should be tested first and index or config changes can hurt write performance or replication
  • Databases other than PostgreSQL and MySQL (the skill does not cover them), such as SQL Server or Oracle
  • Situations where the agent would run SQL against a live database without a human reviewing it, since the skill gives SQL and commands but does not restrict what the agent executes

Try asking

  • “My checkout query takes 4 seconds in PostgreSQL. Here is the EXPLAIN ANALYZE output, what index should I add?”
  • “Find the top 20 slowest queries in our MySQL database and suggest fixes”
  • “Review this execution plan showing a Seq Scan on a 50 million row orders table”
  • “Should we partition our events table by month? Walk me through the tradeoffs”
Step-by-step guide: how to use Database OptimizerInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 6 original files, the MIT licence and an attribution note.

    database-optimizer.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip database-optimizer.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip database-optimizer.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Provide the exact query, the EXPLAIN (ANALYZE, BUFFERS) output and table row counts so the agent can ground its advice in evidence
  • Run suggested changes on a non-production copy first and compare before/after timings yourself
  • Ask for one change at a time so you can attribute any improvement or regression

What's inside

  • references/index-strategies.md
  • references/monitoring-analysis.md
  • references/mysql-tuning.md
  • references/postgresql-tuning.md
  • references/query-optimization.md
  • SKILL.md

Redistributed unmodified from Jeffallan/claude-skills under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.