New advertisers: 50% off your first month with code FIRSTMONTHSee slots
jeffallan avatar

Database Optimizer

Optimizes PostgreSQL and MySQL queries, indexes, and configuration by measuring every change against a baseline.

skills.sh installs
6.4K
GitHub stars
12.5K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers slow query diagnosis, execution plan analysis, index design, query rewrites, config tuning, partitioning, and lock contention
  • Includes SQL for finding top slow queries via pg_stat_statements and MySQL performance_schema, plus EXPLAIN (ANALYZE, BUFFERS) capture
  • Enforces a measured baseline before changes, CONCURRENTLY index builds, and one change at a time with rollback on regression
  • Designed for engineers tuning production-adjacent databases who need before-and-after metrics documented for each change

Install

$ npx -y skills add jeffallan/claude-skills --skill database-optimizer -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Database Optimizer

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

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 — Capture baseline metrics and run EXPLAIN ANALYZE before any changes
  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; validate each change before proceeding to the next
  5. Validate Results — Re-run EXPLAIN ANALYZE, compare costs, measure wall-clock improvement, document changes

⚠️ Always test changes in non-production first. Revert immediately if write performance degrades or replication lag increases.

Reference Guide

Load detailed guidance based on context:

Details

Repository
github.com/jeffallan/claude-skills
Categories
Databases, Data Science & Analytics

More from jeffallan/claude-skills

All 66

Similar to Database Optimizer

More Databases