database-query-performance
/database-query-performance
Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.
- Author
- HoangNguyen0403 ↗
- Repository
- agent-skills-standard ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 3
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.
Original author description
Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.
How it works
- Priority: P0 (CRITICAL)
- Rules
- Verify
- Anti-Patterns
- References
SKILL.md preview
---
name: database-query-performance
description: Diagnose database latency with explain plans, index ownership, and query-shape review. Use when a query is slow, an index is missing, or scans and N+1 patterns appear.
metadata:
triggers:
files:
- '**/*.sql'
- '**/*.entity.ts'
- 'prisma/schema.prisma'
keywords:
- slow query
- explain
- index
- scan
- n+1
---
# 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.
- Run explain or equivalent plan inspection before adding indexes.
- Match indexes to filter, join, sort, and coverage needs.
- Fix N+1 at the query pattern or loading strategy, not by caching first.
## Verify
- [ ] Explain plan was reviewed.
- [ ] Proposed index maps to a named query path.
- [ ] Write cost of the index is acceptable.
- [ ] Pagination or batch loading avoids deep scans or N+1 loops.
## Anti-Patterns
- **No blind indexes**: every index needs a query owner.
- **No cache-first latency fix**: fix query shape before hiding it.
- **No ORM opacity**: inspect generated SQL when the ORM is involved.
## References
- [Framework Map](../references/framework-map.md)
- [Index Strategies](references/index-strategies.md)
Files in this package (3)
- SKILL.md 1 KB
- evals/evals.json 1 KB
- references/index-strategies.md 2 KB
Versions
The database has no other skills named database-query-performance.
Database snapshot: 13.11.2026 · package version 4225b0e44e60 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100database-slow-query-logging-optimization
Use this skill when capturing, analyzing, and tuning slow database queries using slow query logs and automated index recommendations. - 95database
Guide database design, migration, and query optimization. Use when: schema design, migration planning, query optimization, index strategy. Not for: application code migration or framework upgrades — use /migrate; the API contract over the data — use /api-design. Keywords:… - 100database-optimizer
Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution. - 100database-optimizer
Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies,… - 100flux-query
Optimize slow database queries — analyze execution plans, add indexes, rewrite queries. Use when asked about "slow query", "optimize SQL", "query performance", or "explain this query". - 100database-optimization
Schema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a migration, or diagnosing a slow query. SKIP: writing ORM model code (use python-patterns); generic backend patterns (use python-patterns).