jeffallan avatar

Database Optimizer

When your queries are crawling and you're staring at EXPLAIN output trying to figure out why, this walks you through the full optimization cycle: baseline metrics, execution plan analysis, index design, and validation. It covers both PostgreSQL and MySQL with practical SQL examples for finding slow queries, reading execution plans, and creating covering indexes. The workflow is methodical about measuring before and after, testing changes incrementally, and catching things like stale statistics or low buffer cache hits. The reference tables for interpreting EXPLAIN patterns are genuinely handy. Just know it's focused on query and index optimization rather than infrastructure scaling or replication tuning.

skills.sh installs
6.3K
GitHub stars
12.3K
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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:

Sponsors

Details

Repository
github.com/jeffallan/claude-skills
Categories
Backend & APIs, Debugging, Marketing & SEO, Design & UI/UX, Databases

More from jeffallan/claude-skills

All 66
1aws avataraws-lambda-microvmsaws/agent-toolkit-for-awsBuilds, runs, debugs, and operates applications on AWS Lambda MicroVMs — Firecracker-isolated, snapshot-resumable serverless compute environments running inside6.1Kskills.sh installs
2qianwen-ai avatarqianwen-ops-authqianwen-ai/qianwen-ai[QianWen] Configure authentication (API keys, endpoints). TRIGGER when: setting up QIANWEN_API_KEY, troubleshooting 401/auth errors, when another skill reports 5.8Kskills.sh installs
3trailofbits avatarfirebase-apk-scannertrailofbits/skillsScans Android APKs for Firebase security misconfigurations including open databases, storage buckets, authentication issues, and exposed cloud functions. Use wh5.8Kskills.sh installs
4manaflow-ai avatarcmux-backendmanaflow-ai/cmuxBackend TypeScript and Cloud VM development rules for cmux. Use when editing web/app/api, web/services, backend scripts, Cloud VM lifecycle, provider integratio4.9Kskills.sh installs
5grafana avatardatabase-observabilitygrafana/skillsSet up Grafana Cloud Database Observability for MySQL and PostgreSQL — enables `pg_stat_statements` / Performance Schema, creates a least-privilege monitoring u4.6Kskills.sh installs
6giuseppe-trisciuoglio avatarnextjs-authenticationgiuseppe-trisciuoglio/developer-kitProvides authentication implementation patterns for Next.js 15+ App Router using Auth.js 5 (NextAuth.js). Use when setting up authentication flows, implementing3.9Kskills.sh installs