← ClaudeAtlas

database-index-designlisted

Designing and governing an index portfolio across SQL Server, MySQL/InnoDB, and PostgreSQL: deriving composite keys from a workload, equality/range/order trade-offs, covering and partial indexes, write amplification, redundant-index consolidation, engine-specific semantics, and safe production creation or removal. Use when changing schema indexes for several queries or reviewing a table's index set. Not the diagnosis of one slow statement, which belongs to sql-query-performance.
robsonkades/agent-skills · ★ 2 · API & Backend · score 75
Install: claude install-skill robsonkades/agent-skills
# Database Index Design ## Purpose Produce the smallest index set that supports the measured workload while making write, storage, locking, maintenance, and rollout costs explicit. 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: ``` If the workload or engine is unknown, do not emit DDL. State what must be measured first. 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; SQL Server features require the actual version and edition. Do not upgrade the application or database to match a proposed index feature. ## Workflow 1. Normalize each target query into equality predicates, all range predicates, ordering, joins, projection-only columns, and non-sargable expressions. 2. Derive c