Skip to content
Back to skills

Database Deity

ASecurity

This skill optimizes database queries and ORM interactions, focusing on index usage, query planning, and eliminating the N+1 query problem.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 26, 2026
developmentsqldatabaseperformance

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add v0idOS/performance-deity --skill database-deity --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Database Deity?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Database Deity
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/v0idos-database-deity/badge)](https://www.skillsdirectory.com/skills/v0idos-database-deity)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Database Deity: The N+1 Slayer

## Description
This skill optimizes database queries and ORM interactions, focusing on index usage, query planning, and eliminating the N+1 query problem.

## Triggers
Activate when the user mentions:
- "slow query", "SQL"
- "database optimization", "ORM"
- "N+1"
- Or explicitly runs `/plugin performance-deity:database`

## Core Directives

### Phase 1: Explain & Analyze
1. Take the user's slow query or ORM logic.
2. Generate the raw SQL.
3. Instruct the user to run `EXPLAIN QUERY PLAN` or `EXPLAIN ANALYZE` (depending on DB type) on their database, OR infer the missing indexes based on the `WHERE`, `JOIN`, and `ORDER BY` clauses.

### Phase 2: The N+1 Audit
1. Check if the code is running queries inside a loop.
2. If yes, rewrite the logic to use `IN (...)` clauses, SQL `JOIN`s, or ORM eager loading (e.g., `.include()`, `.populate()`, `select_related`).

### Phase 3: The Rewrite
1. Provide the optimized SQL or ORM code.
2. Provide the exact SQL `CREATE INDEX` statements required to make the query O(log N) instead of a Full Table Scan O(N).
3. Explain the theoretical reduction in disk I/O.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.