| name | database-workflow |
| description | Use when investigating database performance degradation end-to-end โ from query quality through server tuning, connection layer, and transaction safety. Triggers on: "database workflow", "DB ์ฑ๋ฅ ์ ์ฒด", "database performance investigation", DB ์ ์ฒด ์ ๊ฒ", |
| type | workflow |
| theme | engineering |
| scenarios | ["database workflow ์ ์ฒด ๋๋ ค์ค","DB ์ฑ๋ฅ ๋ฌธ์ ์ฒ์๋ถํฐ ๋๊น์ง ์ ๊ฒํด์ค","database performance investigation ์์","ํ๋ก๋์
DB๊ฐ ๋๋ฌด ๋๋ ค โ ์ ์ฒด ๋ ์ด์ด ๋ค ๋ด์ค","์ ๊ธฐ๋ฅ DB ์ค๊ณ, ์ฟผ๋ฆฌ๋ถํฐ ํธ๋์ญ์
๊น์ง ์ ๋๋ก ํ๊ณ ์ถ์ด","connection pool์ด๋ transaction๊น์ง ํฌํจํด์ DB ์ ์ฒด ์ ๋ต ์ก์์ค"] |
| estimated_time | 2-6 hours (full), 30-90 min per step |
| compatibility | {"recommended":["think-tool"],"optional":["sequential-thinking"],"remote_mcp_note":"think-tool์ ์คํ ๊ณํ ํด์๊ณผ ํธ๋์ญ์
๊ฒฉ๋ฆฌ ์์ค ํธ๋ ์ด๋์คํ ๋ถ์์์ ํนํ ์ ํจํฉ๋๋ค. sequential-thinking์ ๋ฒ ์ด์ค๋ผ์ธ ์บก์ฒ โ ๋ณ๊ฒฝ โ ๊ฒ์ฆ ์์๋ฅผ ๊ฐ์ ํฉ๋๋ค. Claude ์ค์ โ MCP Servers์์ remote SSE ์๋ํฌ์ธํธ๋ฅผ ์ถ๊ฐํ์ธ์."} |
Database Workflow
4-step database quality process: query authoring โ slow query diagnosis โ connection layer โ transaction safety.
When to Use / When Not to Use
| Use | Skip |
|---|
| Production database slowness with unknown root layer | Single query rewrite request โ use sql-pro |
| Designing a new database-heavy feature | Pool sizing only โ use connection-pool-tuner |
| Database-layer onboarding or audit | Transaction review only โ use transaction-boundary-reviewer |
Workflow Overview
[1] SQL Quality (sql-pro)
Write / rewrite queries, index strategy, EXPLAIN plan
โ
[2] Server-Level Optimization (database-optimizer)
Slow query diagnosis, execution plan, server config tuning
โ
[3] Connection Layer Tuning (connection-pool-tuner)
Pool sizing, HikariCP / pgBouncer config, leak detection
โ
[4] Transaction Safety (transaction-boundary-reviewer)
Isolation levels, @Transactional scope, Outbox / Saga patterns
Steps
Step 1 โ SQL Quality
Skill: sql-pro
Goal: Write or rewrite queries using CTEs, window functions, and correct join types; design indexes that cover the query access patterns; interpret EXPLAIN plans
Input: Slow query or new query requirements; schema DDL; target DB engine and version
Output: Optimized query with inline comments, covering index recommendations, EXPLAIN plan analysis, before/after performance metrics
Skip if: All queries are already optimized and EXPLAIN plans show no sequential scans on large tables
"Step 1 ์์" ๋๋ "์ด ์ฟผ๋ฆฌ ์ต์ ํํด์ค"
Step 2 โ Server-Level Optimization
Skill: database-optimizer
Goal: Diagnose performance issues that survive query-level fixes โ server memory config, VACUUM, lock contention, statistics staleness, partitioning design
Input: EXPLAIN (ANALYZE, BUFFERS) output from Step 1; DB engine, version, and deployment type (self-managed vs. RDS/Cloud SQL)
Output: Bottleneck analysis with EXPLAIN evidence, server parameter recommendations, incremental implementation plan, validation queries
Skip if: DB server is correctly configured and EXPLAIN plans are already optimal (Step 1 output is clean)
"Step 2 ์์" ๋๋ "์๋ฒ ๋ ๋ฒจ ํ๋ ํด์ค"
Step 3 โ Connection Layer Tuning