database-index-designlisted
Install: claude install-skill robsonkades/agent-skills
# Database Index Design
## Purpose
Choose an index set that supports the measured workload at justified write, storage, locking,
maintenance, and rollout cost. Retain an adequate portfolio; fewer indexes can still cost more
if consolidation widens keys or loses useful access paths. This skill owns the portfolio and DDL decision;
`sql-query-performance` owns reading one statement's executed plan.
## Required inputs
```text
engine, exact version/edition, table shape, row count, and growth:
representative query workload with frequency and tail parameter distributions:
equality, range, join, ordering, projection, and uniqueness requirements per query:
current indexes, constraints, usage window, write/update rate, and replica roles:
executed plans and actual work for the target statements:
DDL availability, lock, log/WAL, disk, rollback, and maintenance constraints:
```
Inspect existing schema/migrations, captured plans and usage windows before asking for new
evidence. If the workload or engine is unknown, do not emit DDL; identify the missing decision
input. Estimated plans can support candidates when actuals are unavailable, with runtime benefit
explicitly unverified.
This skill has no Java language minimum: its compatibility boundary is the database and
migration tooling. In Java projects inspect resolved JDBC/ORM versions, generated SQL and
parameter types, plus migration transaction settings. The references use PostgreSQL 18 and
MySQL 8.4 for version-sensitive examples;