postgres-indexing-and-query-optimization
Installation
SKILL.md
Postgres Indexing and Query Optimization
When to use
Invoke when a PostgreSQL workload has a stated or suspected performance problem, when validating that an existing schema meets performance budgets before a scale event, when auditing indexes for redundancy or bloat, or when remediating slow queries, N+1 access, or bad join orders.
Do not use for: greenfield schema modeling or new-table design (use postgres-schema-and-migration), migration authoring, replication or HA topology (use postgres-replication-and-ha-readiness), backup/restore (use postgres-backup-and-operational-readiness), or access-control hardening (use postgres-security-and-data-access-hardening).
Inputs
Required:
- Connection to the target database or a representative copy with production-like data distribution and volume.
- The performance budget in scope: per-query latency targets, throughput expectations, or the specific slow path. Sourced from
performance-architecture.mdwhere it exists. - The access patterns the database serves, from
data-architecture.mdorbackend-architecture.md.
Optional: