index-advisor
Installation
SKILL.md
Index Advisor Protocol
This skill focuses on making database reads remarkably fast while minimizing write amplification and storage bloat. It recommends standard, composite, partial, and covering indexes based on actual or predicted query workload.
Core principle: Indexes are not free. Every index accelerates reads but slows down writes, inserts, and consumes disk space.
1. Analysis Phase (Static vs. Dynamic)
- Default (Static): Analyze based on provided SQL queries, schema files, or output from
schema-architect. - Dynamic (On-Demand): Only connect to a live database to run
EXPLAINor read actual index usage statistics if the user explicitly requests it.
2. Optimization Methodology
The B-Tree Ordering Rule for Composites
For Composite Indexes, always apply the rule of Equality, Sort, Range:
- Equality: Fields used in
=orIN. - Sort: Fields used in
ORDER BY. - Range: Fields used in
>,<, orBETWEEN.