Database Query Optimizer
Use when investigating slow SQL, execution plans, missing or redundant indexes, lock contention, deadlocks, or database scaling bottlenecks in PostgreSQL or MySQL.
Install
npx skills add sandbaseai/workbuddy-skill --skill database-query-optimizergit clone --depth 1 https://github.com/sandbaseai/workbuddy-skill.git /tmp/workbuddy-skill
mkdir -p ~/.claude/skills
cp -r /tmp/workbuddy-skill/skills/database-query-optimizer ~/.claude/skills/database-query-optimizerPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Database Query Optimizer ## Purpose and safety boundary Optimize database performance from measured evidence, not intuition. Start with read-only inspection and a reproducible query shape. Do not run arbitrary customer queries, expose sensitive rows, change schemas, tune global configuration, kill sessions, or rebuild indexes in production without explicit authorization, a maintenance plan, and recovery evidence. `EXPLAIN ANALYZE` executes a statement. Never run it against an untrusted write query or live production traffic without a reviewed transaction/rollback plan. Prefer a sanitized representative dataset, a read-only transaction where valid, or plain `EXPLAIN` when execution itself is unsafe. ## Inputs and baseline Record database engine/version, schema and statistics freshness, query fingerprint, parameter class, dataset scale, concurrency, cache state, connection pool, replica role, and the exact environment. Capture: - wall time and p50/p95/p99 latency under representative load; - execution plan with estimates vs. actual rows, buffers/I/O, sort/hash spills, and parallelism; - CPU, memory, I/O, cache hit rate, locks, deadlocks, connections, and replication lag; - read/write mix, query frequency, business SLO, and acceptable change window. Redact literals, identifiers, tokens, and customer data. Preserve the query fingerprint and enough shape to reproduce the issue. ## Workflow
Details
- Skill name
database-query-optimizer- Repository
- sandbaseai/workbuddy-skill
- Path
skills/database-query-optimizer/SKILL.md- License
- MIT
- Repo updated
- 8 September 2026
FAQ
What does the Database Query Optimizer skill do?
Use when investigating slow SQL, execution plans, missing or redundant indexes, lock contention, deadlocks, or database scaling bottlenecks in PostgreSQL or MySQL.
How do I install the Database Query Optimizer skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add sandbaseai/workbuddy-skill --skill database-query-optimizer. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Database Query Optimizer popular?
It lives in sandbaseai/workbuddy-skill, which has 9 GitHub stars and 3 forks.
Related skills
Access Control Security Best Practices
9sandbaseai/workbuddy-skill
Design, review, implement, and verify least-privilege access controls across users, services, tenants, resources, and administrative workflows.
Accessibility Review
9sandbaseai/workbuddy-skill
Use when reviewing a web interface or interaction for semantic, keyboard, focus, screen-reader, ARIA, and contrast accessibility risks.
Acquire Codebase Knowledge
9sandbaseai/workbuddy-skill
Use when the user asks to map, document, or onboard into an existing codebase and needs evidence-backed architecture, structure, conventions, integrations, testing, and concerns documentation.
DBT Patterns
9sandbaseai/workbuddy-skill
Use when designing, reviewing, or operating a dbt project; structure SQL transformations, tests, documentation, lineage, incremental models, and production workflows with explicit data contracts.
Database Migration
9sandbaseai/workbuddy-skill
Use when planning or reviewing database schema/data migrations, ORM changes, zero-downtime deployment, backfills, compatibility, or rollback.
DBT Transformation Patterns
9sandbaseai/workbuddy-skill
Use when organizing dbt analytics projects, designing source/staging/intermediate/mart models, adding tests and documentation, building incremental models, or reviewing lineage and transformation risk.
Browse the most popular Claude skills, all databases skills, or write your own with the skills generator.