Index Design

B-tree indexes, composite indexes, covering indexes, UNIQUE indexes, and index trade-offs.

48 stars 10 forksOther Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add sethdford/claude-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add sethdford/claude-skills --skill index-design
Manual install
git clone --depth 1 https://github.com/sethdford/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/engineer/database-engineering/skills/index-design ~/.claude/skills/index-design

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Index Design

Strategic indexing for query performance without write overhead.

## Context

You are deciding which indexes to create. Index every query path, but don't overdo it.

## Domain Context

- **B-tree**: Default; works for most queries
- **Composite**: Multiple columns; order matters for range queries
- **Covering**: Includes all columns query needs; avoids table lookup
- **Unique**: Enforce uniqueness; sometimes performance benefit
- **Tradeoff**: Faster reads, slower writes, more storage

## Instructions

1. **Index WHERE Clauses**: Columns filtered
2. **Index JOIN Columns**: Foreign keys and join conditions
3. **Index ORDER BY**: Sorted columns
4. **Composite Order**: Equality first, then range, then sorts
5. **Covering Indexes**: Include SELECT columns; avoid table lookup
6. **Monitor**: Check that indexes are actually used
7. **Remove Unused**: Unused indexes waste storage and slow writes

## Anti-Patterns

- Too many indexes; slows writes, confuses optimizer
- Wrong index order in composite; doesn't help range queries
- Indexes on low-cardinality columns; sequential scan is faster
- Not considering write cost; read optimization kills write performance
- Indexes on every column; shotgun approach

## Further Reading

- PostgreSQL indexes documentation
- MySQL indexes documentation
- SQL Performance Explained (Markus Winand)
Read the full skill on GitHub

Details

Skill name
index-design
Path
engineer/database-engineering/skills/index-design/SKILL.md
License
MIT
Repo updated
11 March 2026

FAQ

What does the Index Design skill do?

B-tree indexes, composite indexes, covering indexes, UNIQUE indexes, and index trade-offs.

How do I install the Index Design skill?

Claude Code plugin: /plugin marketplace add sethdford/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Index Design popular?

It lives in sethdford/claude-skills, which has 48 GitHub stars and 10 forks.

Related skills

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.