Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    PostgreSQL Query & Index Optimizer

    1

    Audits EXPLAIN (ANALYZE, BUFFERS) plans, N+1 loops, and designs zero-downtime composite/partial/GIN indexes for PostgreSQL.

    $7

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    PostgreSQL Query & Index Optimizer

    PostgreSQL Query & Index Optimizer

    Example session with this skill installed

    Optimize this query on our 4M-row orders table: SELECT id, total_cents FROM orders WHERE org_id = $1 AND status = 'pending' AND deleted_at IS NULL ORDER BY created_at DESC LIMIT 20 OFFSET 4000;

    • Read your context and instructions
    • Compiled the postgresql query

    Root causes

    1. Missing ESR-ordered partial covering index
    2. Deep OFFSET 4000 scans and discards 4000 rows.

    Zero-downtime fix

    CREATE INDEX CONCURRENTLY idx_orders_org_status_created
      ON orders (org_id, status, created_at DESC)
      INCLUDE (id, total_cents)
      WHERE deleted_at IS NULL;
    

    Switch to keyset pagination (created_at, id) < ($2, $3) to drop p95 from 1,800ms to <3ms.

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

    About this skill

    Stop guessing indexes or running blocking migrations.

    This skill directs your AI coding agent to:

    • Inspect EXPLAIN (ANALYZE, BUFFERS) plans for Seq Scans, disk sorts, and row-estimate mismatches
    • Apply the ESR rule (Equality, Sort, Range) for composite B-Tree indexes
    • Add partial indexes (WHERE deleted_at IS NULL) and covering INCLUDE columns
    • Emit zero-downtime CREATE INDEX CONCURRENTLY migrations and replace OFFSET with keyset pagination.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.

    Requires EXPLAIN (ANALYZE, BUFFERS) output for accuracy. Does not perform auto-tuning of postgresql.conf parameters. Skip hardware-level scaling advice.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    Permissions

    No special permissions declared or detected

    Listed7 days ago
    Updated5 days ago

    What's inside

    Frequently Asked Questions

    The skill specializes in PostgreSQL performance, auditing EXPLAIN ANALYZE plans to eliminate bottlenecks like sequential scans and designing high-concurrency indexes that reduce p95 latency.

    It works with standard PostgreSQL (versions 12+) and is compatible with major managed providers like AWS RDS, Supabase, and Heroku Postgres.

    The skill prioritizes production safety by generating CREATE INDEX CONCURRENTLY statements, ensuring new indexes are built without locking your tables or causing application downtime.

    The skill provides optimized DDL (Data Definition Language) for index creation and refactored SQL queries, but it does not directly access or modify your database for security reasons.

    Simply paste the output of your 'EXPLAIN (ANALYZE, BUFFERS)' command into the agent, and it will immediately begin identifying row-estimate mismatches and disk-based sorts.

    While generic AI often misses indexing nuances, this skill strictly enforces the Equality-Sort-Range (ESR) rule and identifies advanced opportunities like covering indexes and GIN indexes for JSONB.

    New in Data & Databases