Library > operate > SQL Performance

SQL Performance

Analyze queries and indexes to reduce latency and cost.

Overview

Review a representative query, schema, and plan before proposing an optimization. Explain which observation supports each change. Prefer read-only EXPLAIN; executing a query with ANALYZE requires separate approval.

Referenced source

PostgreSQLUsing EXPLAIN
Install preview
npx reporadars add sql-performance

CLI coming soon — preview only.

Download draft
Status

Draft. Independent runtime review pending.

Source

Reference linked; draft instructions are original.

Version

0.1.0, pinned in this draft.

Scope

Explicit permissions and limits below.

Agents

Claude Code, Codex, Cursor

Permissions

Read supplied schema and plans. No production queries, index creation, or EXPLAIN ANALYZE without approval.

Capabilities

  • Identify expensive scans, joins, and sorts
  • Compare estimates with supplied measurements
  • Review predicate selectivity and index coverage
  • Spot unbounded result sets and repeated queries
  • Propose a measured validation plan
  • Explain write overhead and index trade-offs

How it works

  1. Ask for a redacted query, schema, and representative plan.
  2. Locate the dominant cost and verify relevant assumptions.
  3. Propose the smallest supported query or index change.
  4. Describe the experiment and rollback; do not apply it automatically.

This is an original Reporadars draft, informed by the linked source. Compatibility has not been independently runtime-tested; inspect the instructions, permissions, and placement for your agent before use.

Keep exploring

Drafts in the same category appear first, followed by other catalog samples.