| name | database-optimizer |
| description | Use when database slowness stems from infrastructure concerns rather than query authoring: server memory and I/O configuration, connection pooling, lock contention, VACUUM and statistics maintenance, partitioning design, or cloud-managed database... |
| scenarios | ["Our database queries are slow and we're hitting performance bottlenecks","Help me optimize this SQL query that takes 30 seconds on a 10M row table","Need to scale our PostgreSQL database โ it can't handle current load","DB ์ฟผ๋ฆฌ๊ฐ ๋๋ฌด ๋๋ ค์ ์๋น์ค ์๋ต์๊ฐ์ด 30์ด์ผ","PostgreSQL ์ฑ๋ฅ ์ต์ ํ ๋ฐฉ๋ฒ์ ์๋ ค์ค"] |
| compatibility | {"recommended":["think-tool"],"optional":["sequential-thinking"],"remote_mcp_note":"think-tool์ด ์์ผ๋ฉด ๋ณ๋ชฉ ์์ธ ๋ถ์๊ณผ ์ต์ ํ ์ฐ์ ์์ ๊ฒฐ์ ์ ๋ ์ฒด๊ณ์ ์ผ๋ก ์ํํฉ๋๋ค. sequential-thinking์ ๋ฒ ์ด์ค๋ผ์ธ ์บก์ฒ โ ๋ณ๊ฒฝ โ ๊ฒ์ฆ ์์๋ฅผ ๊ฐ์ ํฉ๋๋ค. Claude ์ค์ โ MCP Servers์์ remote SSE ์๋ํฌ์ธํธ๋ฅผ ์ถ๊ฐํ์ธ์."} |
| license | MIT |
| metadata | {"author":"https://github.com/Jeffallan","version":"1.1.0","domain":"infrastructure","triggers":"database optimization, slow query, query performance, database tuning, index optimization, execution plan, EXPLAIN ANALYZE, database performance, PostgreSQL optimization, MySQL optimization","role":"specialist","scope":"optimization","output-format":"analysis-and-code","related-skills":"devops-engineer"} |
Database Optimizer
When to Use / When Not to Use
Use when:
- EXPLAIN plan is in hand but the fix is server config, not query rewriting
- Investigating lock contention, VACUUM lag, or statistics staleness
- Tuning
shared_buffers, work_mem, or InnoDB buffer pool
- Designing partitioning strategy or index structure
Do not use when:
- The fix is rewriting a slow SQL query (use
sql-pro)
- The bottleneck is connection pool exhaustion (use
connection-pool-tuner)
Process
- Initial triage โ Confirm: database engine + version, deployment type (self-managed vs. cloud-managed), and whether direct connection is available
- Capture baseline โ Run
EXPLAIN (ANALYZE, BUFFERS) before any changes
- Identify bottlenecks โ Find inefficient queries, missing indexes, config issues from the plan
- Design solutions โ Index strategy, query rewrites, schema or config improvements
- Implement incrementally โ One change at a time; validate each before proceeding
- Validate results โ Re-run
EXPLAIN ANALYZE, compare costs, measure wall-clock improvement
On cloud-managed databases (RDS, Cloud SQL, Aurora): ALTER SYSTEM and my.cnf edits are unavailable. Use parameter groups or the console instead.
Use sequential-thinking if available โ it enforces the baseline-capture step and prevents skipping directly to index creation.
Output Template
For each optimization task, provide:
- Performance analysis with baseline metrics (query time, cost, buffer hit ratio)
- Identified bottlenecks with EXPLAIN evidence
- Optimization strategy with specific changes
- Implementation SQL / config changes
- Validation queries to measure improvement
- Monitoring recommendations
What Claude Does / What You Do
| Claude | You |
|---|
| Reads EXPLAIN output and identifies plan patterns | Provide the actual EXPLAIN output |
|