index-optimizer
Skill2 starsChanged 5 months agoApache-2.0View on GitHub
Database indexing optimization expert. Identifies missing, redundant, and unused indexes, and provides optimization recommendations. Trigger when user mentions index optimization, query performance, or database tuning.
In this repository8 other files it gives its agents.
- cloudflare-auditSkill
- cost-audit-masterSkill
- cost-monitorSkill
- d1-cost-optimizerSkill
- query-rewriterSkill
- redis-auditSkill
- spend-cap-managerSkill
- supabase-auditSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Check sequential scans and slow queries.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database Index Optimization Expert
Index Types
| Type | Use Case | Trade-off |
| Single Column | Simple equality/range | Low overhead |
| Composite | Multi-column queries | Column order matters |
| Partial | Subset of rows | Smaller, faster |
| Covering | Index-only scans | Larger, eliminates lookups |
Common Anti-Patterns
| Anti-Pattern | Problem | Reference |
| Missing composite index | Multi-column queries slow | references/composite-index.md |
| Missing covering index | Table lookups required | references/covering-index.md |
| Missing partial index | Indexing all rows | references/partial-index.md |
| Unused indexes | Write overhead | references/unused-index.md |
| Redundant indexes | Duplicate coverage | references/redundant-index.md |
| Index skip scan | Wrong column order | references/index-skip-scan.md |
Audit Workflow
Step 1: Identify Missing Indexes
Check sequential scans and slow queries.
See references/composite-index.md for multi-column patterns.
Step 2: Check Redundant Indexes
Find indexes that are subsets of other indexes.
See references/redundant-index.md for detection.
Step 3: Detect Unused Indexes
Monitor index usage statistics.
See references/unused-index.md for detection and removal.
Step 4: Optimize Index Design
Apply appropriate index type based on query patterns:
- Multi-column WHERE →
references/composite-index.md - Subset queries →
references/partial-index.md - SELECT-heavy →
references/covering-index.md
Benchmark Reference
| Optimization | Before | After | Improvement |
| Composite index | 500ms | 5ms | 99% |
| Partial index | 50MB | 5MB | 90% size reduction |
| Covering index | 50ms | 10ms | 80% faster |
| Remove unused | 100ms write | 70ms write | 30% faster |
| Remove redundant | 200MB | 100MB | 50% reduction |
Output Format
## Index Optimization Report
### 1. Current State
- Total indexes: X
- Missing indexes: X
- Redundant indexes: X
- Unused indexes: X
### 2. Anti-Patterns Detected
| Table | Anti-Pattern | Reference | Fix |
|-------|--------------|-----------|-----|
| ... | ... | ... | ... |
### 3. Recommendations (by priority)
1. [P0] Fix: <anti-pattern> → Expected improvement: XX%
Reference: references/<file>.md
### 4. Implementation
Apply fixes from referenced files.Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

