Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/arbazkhan971/godmode --skill query명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Turn on Godmode. 135 skills, 7 subagents, zero configuration. Routes to the right skill automatically.
Backup and disaster recovery. backup strategy, disaster recovery, RPO/RTO, data integrity, durability, runbook.
Changelog and release notes management. Keep a Changelog format, Conventional Commits auto-generation, breaking change communication, migration guides, audience-specific notes.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | query |
| description | Query optimization and EXPLAIN analysis. |
/godmode:query, "this query is slow", "optimize"Database: PostgreSQL|MySQL|SQLite|MongoDB|Redis
Access via: Raw SQL|Prisma|Django ORM|ActiveRecord|GORM
Table(s): <involved tables>
Estimated rows: <approximate counts>
Current time: <ms> Target: <ms>
# Extract ORM-generated SQL
# Prisma: new PrismaClient({ log: ['query'] })
# Django: django.db.connection.queries
# Rails: ActiveRecord::Base.logger = Logger.new(STDOUT)
-- PostgreSQL (most informative)
EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON) <query>;
-- Safe mode (no execution)
EXPLAIN (COSTS, FORMAT JSON) <query>;
Red flags:
[ ] Seq Scan on > 10K rows — needs index
[ ] Nested Loop on large tables — use hash join
[ ] Estimated vs actual off > 10x — stale stats
[ ] Sort on disk — needs work_mem or index
[ ] Filter removes > 90% scanned — index needed
[ ] Seq Scan inside loop — N+1 pattern
IF MongoDB: db.collection.find().explain("executionStats")
Check totalDocsExamined vs nReturned ratio.
IF Redis: SLOWLOG GET 10 for slow commands.
Missing Index:
Evidence: Seq Scan on <table> filtering by <col>
Fix: CREATE INDEX idx_<table>_<col> ON <table>(<col>)
N+1 Query:
Evidence: <N> identical queries in loop
Fix: JOIN or eager loading (includes/select_related)
ORM: Django select_related, Prisma include,
Rails includes, SQLAlchemy joinedload
Inefficient Join:
Evidence: Nested Loop on <N>x<M> rows
Fix: Ensure join columns indexed both sides
Over-fetching:
Evidence: SELECT * returning <N> unused columns
Fix: SELECT only needed columns
Stale Statistics:
Evidence: Estimated <N> vs actual <M> (off by >10x)
Fix: ANALYZE <table>
IF improvement < 10% after optimization: diminishing returns. IF query still > 1s after indexes: consider materialized view.
B-tree (default): equality, range, sort, LIKE 'prefix%'
GIN: full-text search, JSONB, arrays
BRIN: very large tables with natural ordering
Partial: WHERE active=true (smaller, faster)
Covering (INCLUDE): enables index-only scan
-- ALWAYS use CONCURRENTLY in production PostgreSQL
CREATE INDEX CONCURRENTLY idx_name ON table(col);
Trade-off: every index speeds reads, slows writes. IF write-heavy table (> 1000 writes/sec): limit to 3-5 indexes.
# Run EXPLAIN ANALYZE on optimized query
# Run 3 times, take median
# Run full test suite — verify correctness
# Check write performance — new indexes slow writes
# Analyze query performance
psql -c "EXPLAIN (ANALYZE, BUFFERS) SELECT 1"
npx prisma studio
Append .godmode/query-results.tsv:
timestamp database queries_optimized indexes_added latency_pct status
KEEP if: time improved AND tests pass AND
write overhead acceptable.
DISCARD if: correctness changed OR no improvement.
STOP when FIRST of:
- Query meets target (default < 50ms)
- No seq scans on > 10K row tables
- All N+1 eliminated
- Improvement < 10% last iteration
On failure: git reset --hard HEAD~1. Never pause.
| Failure | Action |
|---|---|
| Wrong results | Check JOINs, WHERE, NULL handling |
| Still slow > 1s | Check missing indexes, full scans |
| ORM inefficiency | Use raw SQL for complex queries |