- Home
- Skills
- Data & Databases
- PostgreSQL Query & Index Optimizer
Works with the AI Agents you already use
PostgreSQL Query & Index Optimizer
Audits EXPLAIN (ANALYZE, BUFFERS) plans, N+1 loops, and designs zero-downtime composite/partial/GIN indexes for PostgreSQL.
$7
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
- Missing ESR-ordered partial covering index
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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