Database
A ruthlessly strict algorithmic optimization methodology for AI coding agents. Forces your agent to profile, benchmark, and mathematically prove performance gains before writing code.
npx -y skills add v0idOS/performance-deity --skill databaseAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Diagnose and fix slow database queries. Runs EXPLAIN ANALYZE, identifies missing indexes, eliminates N+1 ORM patterns, and provides exact CREATE INDEX statements.
SKILL.md
1.2 KB, as published. Nobody here has run it
Execute all three phases in order.
Phase 1 — Analysis
- Take the slow query or ORM code.
- Generate the equivalent raw SQL.
- Either instruct the user to run
EXPLAIN QUERY PLAN(SQLite) orEXPLAIN ANALYZE(Postgres/MySQL), or infer missing indexes directly from theWHERE,JOIN, andORDER BYclauses.
Phase 2 — N+1 Audit
Check whether queries are issued inside a loop. If yes, rewrite using:
IN (...)batch clause- SQL
JOIN - ORM eager loading:
.include()— Prisma.populate()— Mongooseselect_related()/prefetch_related()— Django
Phase 3 — Rewrite
- Provide the optimized SQL or ORM code.
- Provide the exact
CREATE INDEXstatements required. - Explain the disk I/O reduction: Full Table Scan O(N) → Index Lookup O(log N).
Before/after query plan summary:
| Metric | Before | After |
|---|---|---|
| Scan type | Full Table Scan | Index Lookup |
| Complexity | O(N) | O(log N) |
| Query count (per page load) | N+1 | 1 |