Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    DB Query Optimizer

    2

    Detects and fixes N+1 queries, missing indexes, and ORM performance bottlenecks in SQL, Prisma, Django, and more.

    $5

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    3 installsSecurity scanned
    DB Query Optimizer

    DB Query Optimizer

    Example session with this skill installed

    Why is this Prisma call slow? It fetches all posts, and then for each post, my UI displays the author name and the count of comments. It works fine locally but hangs in production.

    • Read your context and instructions
    • Compiled the db query optimizer

    This is a classic N+1 query. You are fetching N posts, then triggering 2 additional queries per post for the author and comments. In production with 100 posts, this is 201 queries.

    Fix: Update your Prisma findMany to include:
    include: { author: true, _count: { select: { comments: true } } }

    Connects securely to your tools. The creator never sees your data.

    What you get

    Eliminate N+1 queries by implementing framework-specific eager loading.Identify missing indexes on foreign keys and filter columns.Convert application-side filtering into efficient database-level queries.Resolve connection pool exhaustion by reducing query volume per request.

    About this skill

    The problem

    Database performance issues often stay hidden during development because ORM code looks clean despite executing inefficiently. N+1 queries and missing indexes only reveal themselves as catastrophic slowdowns or connection pool exhaustion once your data volume grows in production.

    What it does

    • Identifies N+1 query patterns in ORM code and provides the exact eager-loading or batching syntax for your specific framework.
    • Analyzes EXPLAIN and EXPLAIN ANALYZE output to detect sequential scans and inefficient query plans.
    • Flags missing indexes on foreign keys, WHERE clauses, and ORDER BY statements, accounting for composite index column order.
    • Detects application-level filtering and pagination bugs that should be handled at the database layer.
    • Diagnoses connection pool exhaustion caused by high query volume per request.

    Frameworks & tools

    Supports Prisma, Sequelize, TypeORM, Django ORM, ActiveRecord, SQLAlchemy, and Eloquent. Works with PostgreSQL, MySQL, and SQLite.

    Why this beats prompting it yourself

    General LLMs often suggest generic fixes or hallucinate ORM methods that do not exist. This skill uses framework-specific reference patterns to ensure the suggested fix is syntactically correct and actually addresses the underlying execution plan rather than just making the code look better.

    Use cases

    • Auditing an API endpoint that has become progressively slower as the database grows.
    • Refactoring legacy ORM code to eliminate N+1 queries in serializers and view layers.
    • Optimizing database performance by analyzing slow query logs and execution plans.
    • Troubleshooting intermittent database timeouts and connection pool errors under load.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    3 installs

    Downloaded by developers to date

    30-day refund

    Not a fit? Get your money back

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • Passed all security checks, Safe to install

    Listed1 month ago
    Updated23 days ago

    What's inside

    Frequently Asked Questions