db-advisor
/db-advisor
Automated database query monitoring and N+1 detection. Analyzes ORM query logs, detects repeated queries (N+1 pattern), suggests eager loading or batching fixes, and tracks query count per request. Use when adding DB monitoring, investigating slow endpoints, or reviewing ORM query patterns in a PR.
- Author
- andersonlimahw ↗
- Repository
- lemon-ai-hub ↗
- Licence
- MIT
- Last repository change
- 16.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 16.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
Automated database query monitoring and N+1 detection. Analyzes ORM query logs, detects repeated queries (N+1 pattern), suggests eager loading or batching fixes, and tracks query count per request. Use when adding DB monitoring, investigating slow endpoints, or reviewing ORM query patterns in a PR.
Original author description
Automated database query monitoring and N+1 detection. Analyzes ORM query logs, detects repeated queries (N+1 pattern), suggests eager loading or batching fixes, and tracks query count per request. Use when adding DB monitoring, investigating slow endpoints, or reviewing ORM query patterns in a PR.
How it works
- Commands
- N+1 Detection
- Health Report
SKILL.md preview
---
name: "db-advisor"
description: "Automated database query monitoring and N+1 detection. Analyzes ORM query logs, detects repeated queries (N+1 pattern), suggests eager loading or batching fixes, and tracks query count per request. Use when adding DB monitoring, investigating slow endpoints, or reviewing ORM query patterns in a PR."
---
# DB Advisor Plugin
Continuous query monitoring. N+1 caught before production.
## Commands
```
/db-advisor monitor — enable query logging for current session
/db-advisor n+1 — detect N+1 patterns in ORM logs
/db-advisor slow-queries — list queries slower than 100ms
/db-advisor explain <query> — run EXPLAIN ANALYZE on a query
/db-advisor health — overall DB health report
/db-advisor weekly-report — generate markdown health report
```
## N+1 Detection
Automatically detects patterns like:
```
SELECT * FROM users WHERE id = 1 ─┐
SELECT * FROM users WHERE id = 2 │ N+1 detected
SELECT * FROM users WHERE id = 3 │ 50 identical queries
... ─┘
```
Suggests fix:
```typescript
// ❌ N+1 — 1 query per order
const orders = await prisma.order.findMany()
for (const order of orders) {
const user = await prisma.user.findUnique({ where: { id: order.userId } })
}
// ✅ eager load — 1 query total
const orders = await prisma.order.findMany({
include: { user: true }
})
```
## Health Report
```
DB HEALTH — 2026-06-14
========================
Connections: 28/50 (56%) ✅
Slow queries (>100ms): 14 this hour ⚠️
Slowest: SELECT * FROM events (avg 820ms) — add index on event_type
N+1 patterns: 3 detected in last hour
/api/products endpoint: 48 user queries per request → use include
Table bloat: orders_archive 4.2 GB (87% dead rows) — run VACUUM ANALYZE
Replication lag: 0ms ✅
```
Pairs with `/db-index-advisor` skill for index optimization.
Files in this package (3)
- SKILL.md 2 KB
- plugin.json 1 KB
- skills/db-advisor/SKILL.md 2 KB
Versions
The database has no other skills named db-advisor.
Identical content appears in 1 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version ef6e50542275 (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
- 90n-plus-one-queries
Find and eliminate N+1 database access where one query per row replaces one query for the set, using eager loading, batching, or a dataloader. Use when a list endpoint is slow, query counts scale with result size, or an ORM lazy-loads inside a loop. - 100n-plus-one-hunter
Detect ORM loop-of-queries (N+1) patterns from query logs and eliminate them with batched eager loading, keeping the N+1s that are cheap. Use when a list endpoint is slow, a request issues many near-identical SELECTs differing only by an id, query logs show repeated SELECTs in a… - 80Backend Queries
Write secure, performant database queries using parameterized statements, proper indexing, and query optimization techniques. Use this skill when writing SQL queries, ORM query methods, or database access code. When implementing data fetching logic that retrieves or updates… - 90query-pattern-analysis
Analyzes query behavior for correctness and performance risk. Use when a request changes filtering, pagination, aggregation, eager loading, write batching or another query path that real data volume could regress. - 100performance
Use when optimizing application performance — caching strategies, eager loading, query optimization, Redis patterns, or background job design. - 90find-n-plus-one
This skill should be used when the user reports or suspects slow pages or endpoints caused by many repeated queries, for example "N+1", "n plus one", "too many queries", "query per row", "lazy loading", "eager loading", "includes", "preload", "select_related",…