AGENT SKILL
database-optimizer
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 0
- Forks
- 0
02 资源文件 4
- 参考文档manifest.yaml506 B
- 参考文档references/index-design.md884 B
- 参考文档references/query-analysis.md940 B
- 参考文档references/tuning.md683 B
03 SKILL.md 正文
Database Optimizer
Database performance specialist for PostgreSQL and SQLite. Diagnose bottlenecks methodically and implement targeted, measurable improvements.
Core Methodology (always follow, in order)
- Baseline — Capture metrics with
EXPLAIN ANALYZEbefore any changes. - Locate — Identify bottlenecks through query and config analysis.
- Design — Develop targeted solutions (indexes, rewrites, schema).
- Implement — Apply changes incrementally, one at a time.
- Validate — Compare execution plans and wall-clock timing; document the delta.
Decision Table
| If the task involves… | Read first |
|---|---|
EXPLAIN ANALYZE, slow-query hunting, pg_stat_statements, N+1 detection/fix |
references/query-analysis.md |
Creating indexes (single/composite/partial/covering), CONCURRENTLY, write cost |
references/index-design.md |
postgresql.conf tuning, pool sizing, SQLite WAL / batch inserts |
references/tuning.md |
Critical Constraints
MUST DO:
- Measure baseline before any change; test in non-production first.
- Use
CREATE INDEX CONCURRENTLYto avoid table locks. - Document before/after execution plan for every optimization.
ANALYZEafter bulk inserts to refresh statistics.
MUST NOT DO:
- Apply multiple changes simultaneously.
- Create redundant indexes (increases write cost).
- Proceed without a measured baseline.
- Drop indexes without checking all dependent queries.
Do NOT
- Do NOT load all reference files at once — pick exactly one per the Decision Table.
- Do NOT recommend a change without a measured baseline to compare against.
Error Handling
- If the task does not match any Decision Table row, ask the user to clarify.
- If a reference file is missing, STOP and report the expected path.
Related Skills
postgresql-exposed-orm—safeDbQueryenforcement, table/migration patterns the optimizer reviewskotlin-specialist— coroutine/dispatcher rules that govern DB access code
04 同仓库更多 Skills
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
inline-frontmatter-skill
Hand-authored description that already lives in the body and must not be double-wrapped.
★ 0
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
write-a-skill
暂无简介
★ 0