| 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