AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Query Optimizer

skill-m-binimran-dev-pack-query-optimizer · by m-binimran

Diagnose and fix slow Postgres queries using EXPLAIN ANALYZE, index suggestions, and N+1 detection. Use when a query is slow, a page is slow because of the DB, or before shipping a query that touches a large table.

No reviews yet
0 installs
32 views
0.0% view→install

Install

$ agentstack add skill-m-binimran-dev-pack-query-optimizer

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-m-binimran-dev-pack-query-optimizer)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Query Optimizer? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

query-optimizer

Make the query fast based on evidence, not guesses.

Process

  1. Get the plan: run EXPLAIN (ANALYZE, BUFFERS) . Never optimize without it.
  2. Read the plan top-down: find the costliest node. Look for:
  • Seq Scan on a big table where an index could be used.
  • Rows Removed by Filter high → missing/!selective index.
  • Estimated vs actual rows far apart → stale stats (ANALYZE).
  • Nested loop over many rows → maybe a hash/merge join is better.
  1. Propose the smallest fix: an index, a rewritten predicate, a LIMIT, or pagination.
  2. Re-measure with EXPLAIN ANALYZE and report before/after timing. Don't claim a win without it.

Common fixes

  • Composite index ordered by selectivity for multi-column filters.
  • Partial index (where active) for queries that always filter the same way.
  • Replace OFFSET pagination with keyset (where id > $last) for deep pages.
  • Kill N+1: one query per row in app code → use a join or IN (...)/= ANY.

Output

  • The plan's bottleneck in one sentence.
  • The fix (SQL/DDL).
  • Before/after timing from real EXPLAIN ANALYZE runs.

Guardrails

  • An index isn't free — it slows writes. Only add what the plan justifies.
  • Don't add an index that duplicates an existing one's prefix.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.