database-query-performance
БесплатноЗапускает вложенные скриптыНе проверенDiagnose database latency with explain plans, index ownership, and query amplification review. Use when a query is slow, an index is missing, or scans, loops…
от HoangNguyen0403★ 598 звёзд на GitHubОб этом скилле
Database Query Performance
Priority: P0 (CRITICAL)
Slow query work starts with the query shape and evidence, not with random index creation.
Rules
- Capture the exact query, parameters, and access path; redact sensitive values.
- Run explain or equivalent plan inspection before adding indexes; do not use explain as a request counter.
- Match indexes to filter, join, sort, and coverage needs; evaluate index write cost.
- Classify amplification evidence: static loops/serializers are
suspected, architectural proposals aredesign risk, and telemetry/statement logs areobserved. - Distinguish true query amplification (loops, serializer lazy loads, per-record aggregates, resolver fan-out) from constant-count queries and non-query redundancy.
- Fix N+1 amplification with the smallest justified remedy: push down aggregates (
GROUP BY), use bounded batch key lookups ($Q_{base} + R \cdot \lceil N / B \rceil$), or use request-scoped DataLoaders. - Preserve parent pagination (
LIMIT/OFFSET), tenant/authorization scope, empty collections, and deterministic ordering across batch loading.
Verify
- Explain plan was reviewed; query plan verified.
- Proposed index maps to a named query path with acceptable write cost.
- Amplification classified by evidence tier (suspected vs design risk vs observed).
- Remedy uses smallest justified loading strategy; preserves pagination and tenant scope.
- Negative controls verified: constant-count queries, already-batched queries, and spare-instance redundancy are rejected as N+1 defects.
Anti-Patterns
- No blind indexes: every index needs a query owner; indexing does not fix $O(N)$ query loops.
- No cache-first latency fix: fix query shape before hiding it; never use a global cache for request-scoped DataLoaders.
- No blanket giant JOIN: joining 1:N relations multiplies rows, inflates memory, and breaks parent pagination.
- No ORM opacity: inspect generated SQL when the ORM is involved.
- No conflation of redundancy: high-availability N+1 spare compute nodes are not database query amplification.
References
Установить database-query-performance в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл database-query-performance?
Diagnose database latency with explain plans, index ownership, and query amplification review. Use when a query is slow, an index is missing, or scans, loops, and N+1 patterns appear.
Как установить скилл database-query-performance?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл database-query-performance запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
patterns
Find patterns worth sharing from recent PRs and repo history, both repeats to fix and good practices worth spreading. Use when a champion wants to know what…
от Anthropiccopilot-cli-quickstart
Use this skill when someone wants to learn GitHub Copilot CLI from scratch. Offers interactive step-by-step tutorials with separate Developer and…
от GitHubvardoger-analyze
Use when the user asks to personalize the GitHub Copilot CLI assistant, adapt Copilot to their style, use vardoger, or analyze their Copilot CLI conversation…
от GitHubpolicy-lookup
Find and explain company policies in plain language. Trigger with "what's our PTO policy", "can I work remotely from another country", "how do expenses work"…
от Anthropic