agentleFS
huiferhuifer/CloudSaver/skills/index-optimizer/SKILL.md

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.

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
  1. Very specific:

    Check sequential scans and slow queries.

    line 39

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Database Index Optimization Expert

Index Types

TypeUse CaseTrade-off
Single ColumnSimple equality/rangeLow overhead
CompositeMulti-column queriesColumn order matters
PartialSubset of rowsSmaller, faster
CoveringIndex-only scansLarger, eliminates lookups

Common Anti-Patterns

Anti-PatternProblemReference
Missing composite indexMulti-column queries slowreferences/composite-index.md
Missing covering indexTable lookups requiredreferences/covering-index.md
Missing partial indexIndexing all rowsreferences/partial-index.md
Unused indexesWrite overheadreferences/unused-index.md
Redundant indexesDuplicate coveragereferences/redundant-index.md
Index skip scanWrong column orderreferences/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

OptimizationBeforeAfterImprovement
Composite index500ms5ms99%
Partial index50MB5MB90% size reduction
Covering index50ms10ms80% faster
Remove unused100ms write70ms write30% faster
Remove redundant200MB100MB50% 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.