Agent skill

Database Optimizer

by zebbern in zebbern/claude-code-guide

A skill your agent uses when investigating slow queries, analyzing execution plans, or optimizing database performance.

MITAuto-check passedDatabases

Install Database Optimizer

skills CLI
$ npx skills add zebbern/claude-code-guide --skill database-optimizer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zebbern/claude-code-guide database-optimizer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zebbern/claude-code-guide.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/database-optimizer .claude/skills/database-optimizer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
database-optimizer
GitHub stars
4.7k
Token cost
~967 tokens
SKILL.md length
321 words
Files
6 (incl. references)
Skills in repo
46
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when investigating slow queries, analyzing execution plans, or optimizing database performance.

  • Works in 5 steps: Analyze Performance - Review slow… → Identify Bottlenecks - Find inefficient… → Design Solutions - Create index… → …
  • Investigating slow queries
  • SKILL.md covers Role Definition, When to Use This Skill, Core Workflow and Reference Guide, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Database Optimizer is an agent skill from zebbern/claude-code-guide. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.

Its SKILL.md is about 970 tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/index-strategies.md`, `references/monitoring-analysis.md` and `references/mysql-tuning.md`).

It sits in Databases, covering Query optimization. It works with MySQL and PostgreSQL. The repository describes itself as: Claude Code Guide - Setup, Commands, workflows, agents, skills & tips-n-tricks from beginner to power user! The licence is MIT.

When your agent uses it

  • Investigating slow queries
  • Analyzing execution plans
  • Optimizing database performance

Example prompts

  • “/database-optimizer”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Analyze Performance - Review slow queries, execution plans, system metrics
  2. Identify Bottlenecks - Find inefficient queries, missing indexes, config issues
  3. Design Solutions - Create index strategies, query rewrites, schema improvements
  4. Implement Changes - Apply optimizations incrementally with monitoring
  5. Validate Results - Measure improvements, ensure stability, document changes

What it can do on your machine

Read from SKILL.md and the folder at commit e62775c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Database Optimizer loads about 967 tokens when it runs, and up to ~14k if it reads all its reference files. Until then it costs about 59 tokens; SKILL.md has 321 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~59
When it runs · the whole SKILL.md, loaded when a task matches
~967
With references · SKILL.md plus every file in references/, read only if the agent opens them
~14k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zebbern/claude-code-guide at commit e62775c, republished under its MIT licence (© zebbern). 321 words, ~967 tokens.

Download SKILL.mdSave it as .claude/skills/database-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
database-optimizer
description
Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.
license
MIT
metadata.author
https://github.com/Jeffallan
metadata.version
1.0.0
metadata.domain
infrastructure
metadata.triggers
database optimization, slow query, query performance, database tuning, index optimization, execution plan, EXPLAIN ANALYZE, database performance, PostgreSQL…
metadata.role
specialist
metadata.scope
optimization
metadata.output-format
analysis-and-code
metadata.related-skills
devops-engineer

Database Optimizer

Senior database optimizer with expertise in performance tuning, query optimization, and scalability across multiple database systems.

Role Definition

You are a senior database performance engineer with 10+ years of experience optimizing high-traffic databases. You specialize in PostgreSQL and MySQL optimization, execution plan analysis, strategic indexing, and achieving sub-100ms query performance at scale.

When to Use This Skill

  • Analyzing slow queries and execution plans
  • Designing optimal index strategies
  • Tuning database configuration parameters
  • Optimizing schema design and partitioning
  • Reducing lock contention and deadlocks
  • Improving cache hit rates and memory usage

Core Workflow

  1. Analyze Performance - Review slow queries, execution plans, system metrics
  2. Identify Bottlenecks - Find inefficient queries, missing indexes, config issues
  3. Design Solutions - Create index strategies, query rewrites, schema improvements
  4. Implement Changes - Apply optimizations incrementally with monitoring
  5. Validate Results - Measure improvements, ensure stability, document changes

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Query Optimizationreferences/query-optimization.mdAnalyzing slow queries, execution plans
Index Strategiesreferences/index-strategies.mdDesigning indexes, covering indexes
PostgreSQL Tuningreferences/postgresql-tuning.mdPostgreSQL-specific optimizations
MySQL Tuningreferences/mysql-tuning.mdMySQL-specific optimizations
Monitoring & Analysisreferences/monitoring-analysis.mdPerformance metrics, diagnostics

Constraints

MUST DO
  • Analyze EXPLAIN plans before optimizing
  • Measure performance before and after changes
  • Create indexes strategically (avoid over-indexing)
  • Test changes in non-production first
  • Document all optimization decisions
  • Monitor impact on write performance
  • Consider replication lag for distributed systems
MUST NOT DO
  • Apply optimizations without measurement
  • Create redundant or unused indexes
  • Skip execution plan analysis
  • Ignore write performance impact
  • Make multiple changes simultaneously
  • Optimize without understanding query patterns
  • Neglect statistics updates (ANALYZE/VACUUM)

Output Templates

When optimizing database performance, provide:

  1. Performance analysis with baseline metrics
  2. Identified bottlenecks and root causes
  3. Optimization strategy with specific changes
  4. Implementation SQL/config changes
  5. Validation queries to measure improvement
  6. Monitoring recommendations

Knowledge Reference

PostgreSQL (pg_stat_statements, EXPLAIN ANALYZE, indexes, VACUUM, partitioning), MySQL (slow query log, EXPLAIN, InnoDB, query cache), query optimization, index design, execution plans, configuration tuning, replication, sharding, caching strategies

© zebbern, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/database-optimizer of zebbern/claude-code-guide.

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

Open the folder on GitHubat commit e62775c

Compare with similar skills

Database Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Database Optimizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Optimizer this skillzebbern/claude-code-guide4.7k—~967Automated safety check: PassMIT
DB Ops SopOpenDCAI/DataMind423—~388Automated safety check: PassApache-2.0
Altimate Data Warehouse DelegateAltimateAI/data-engineering-skills128—~1.4kAutomated safety check: PassMIT
Database OptimizerJeffallan/claude-skills12k—~1.6kAutomated safety check: PassMIT
SQL ProJeffallan/claude-skills12k—~1.3kAutomated safety check: PassMIT
Database OptimizerAratKruglik/claude-laravel155—~1kAutomated safety check: PassNone

Similar skills

  • DB Ops Sop

    OpenDCAI/DataMind

    Database operations runbook — backup, recovery, performance tuning, troubleshooting.

    423 GitHub stars~388 tokensUpdated 18 days ago
    DatabasesAuto-check passed
  • Altimate Data Warehouse Delegate

    AltimateAI/data-engineering-skills

    Delegates dbt and warehouse tasks such as lineage, migrations and cost attribution to the altimate-code CLI agent and relays its answer back.

    128 GitHub stars~1.4k tokensUpdated 6 days ago
    DatabasesAuto-check passed
  • Database Optimizer

    Jeffallan/claude-skills

    Tunes PostgreSQL and MySQL performance by analyzing slow queries and execution plans, designing indexes, rewriting queries and adjusting configuration, one validated change at a time.

    12k GitHub stars~1.6k tokensUpdated 4 days ago
    DatabasesAuto-check passed
  • SQL Pro

    Jeffallan/claude-skills

    Optimizes SQL queries and designs schemas using CTEs, window functions, covering indexes and EXPLAIN ANALYZE, with notes on dialect differences between major databases.

    12k GitHub stars~1.3k tokensUpdated 4 days ago
    DatabasesAuto-check passed
  • Database Optimizer

    AratKruglik/claude-laravel

    A skill your agent uses when investigating slow queries, analyzing execution plans, or optimizing database performance.

    155 GitHub stars~1k tokensUpdated 5 mo ago
    DatabasesAuto-check passed
  • SQL Optimization

    github/awesome-copilot

    Official

    Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…

    40k GitHub starsUsed in 2 repos~2.3k tokens
    DatabasesAuto-check passed

More from zebbern/claude-code-guide

All 46 skills in this repo
  • Code To Diagram

    zebbern/claude-code-guide

    Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts.

    4.7k GitHub starsUsed in 1 repo~972 tokens
    Auto-check passed
  • Localization Toolkit

    zebbern/claude-code-guide

    This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the…

    4.7k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Audit Flow

    zebbern/claude-code-guide

    Interactive system flow tracing across CODE, API, AUTH, DATA, NETWORK layers with SQLite persistence and Mermaid export.

    4.7k GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • Chart Image

    zebbern/claude-code-guide

    Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts.

    4.7k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Code Vuln Audit

    zebbern/claude-code-guide

    Scan code for security issues: dependency vulnerabilities (npm/pip audit), secret leaks (regex and entropy analysis), and OWASP anti-patterns like SQL injection, XSS, or command injection.

    4.7k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Linux Shell Scripting

    zebbern/claude-code-guide

    This skill should be used when the user asks to "create bash scripts", "automate Linux tasks", "monitor system resources", "backup files", "manage users", or "write production shell scripts".

    4.7k GitHub starsUsed in 9 repos~3.1k tokens
    Auto-check: notes

Works with

Categories

Questions about Database Optimizer

What does Database Optimizer do?

A skill your agent uses when investigating slow queries, analyzing execution plans, or optimizing database performance. Database Optimizer is an agent skill from zebbern/claude-code-guide. Use when investigating slow queries, analyzing execution plans, or optimizing database performance.

When should I use Database Optimizer?

Database Optimizer fits situations like: investigating slow queries; analyzing execution plans; optimizing database performance.

How do I install Database Optimizer in Claude Code?

Run `npx skills add zebbern/claude-code-guide --skill database-optimizer -a claude-code`. Or copy the skill folder (skills/database-optimizer in zebbern/claude-code-guide) into .claude/skills/database-optimizer in your project. Claude Code loads it when a task matches its description.

How do I install Database Optimizer in Codex?

Run `npx skills add zebbern/claude-code-guide --skill database-optimizer -a codex`. Or copy the skill folder (skills/database-optimizer in zebbern/claude-code-guide) into .agents/skills/database-optimizer in your project. Codex loads it when a task matches its description.

Can I use Database Optimizer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zebbern/claude-code-guide --skill database-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-optimizer, .gemini/skills/database-optimizer, .github/skills/database-optimizer and .opencode/skills/database-optimizer in your project.

What does Database Optimizer need to run?

SKILL.md names no scripts, command-line tools or credentials: Database Optimizer is instructions for the agent only.

Does Database Optimizer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Database Optimizer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Database Optimizer use?

Database Optimizer is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Database Optimizer use?

About 967 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.

What are the alternatives to Database Optimizer?

Skills that share tags, products or a category with Database Optimizer: DB Ops Sop (OpenDCAI/DataMind, 423 stars), Altimate Data Warehouse Delegate (AltimateAI/data-engineering-skills, 128 stars), Database Optimizer (Jeffallan/claude-skills, 12k stars) and SQL Pro (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Optimizer?

zebbern (a GitHub user) maintains it in zebbern/claude-code-guide, which has 4,650 GitHub stars. The repository holds 46 skills in this directory. The repository was last updated on October 8, 2026.

Source: zebbern/claude-code-guide on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.