database-optimization
Skill0 starsChanged 8 months agoMITView on GitHub
Use when reviewing database schemas, slow queries, missing indexes, or planning migrations
3 other projects use a version of this.
Adopted by
Most recently taken up by
- komluk/scaffoldingtheir own version, first seen Sep 28, 2026
- valentinesamuel/claude-skillstheir own version, first seen Apr 19, 2026
- rohitg00/awesome-claude-code-toolkittheir own version, first seen Feb 4, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- rohitg00/awesome-claude-code-toolkit★ 2.7ksame name
- komluk/scaffolding★ 15same name
- valentinesamuel/claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository190 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-auditSkill
- accessibility-complianceSkill
- ado-api-cliSkill
- ado-artifactsSkill
- ado-container-deploymentsSkill
- ado-organizationSkill
- ado-pipeline-designSkill
- ado-pipeline-optimizationSkill
- ado-pipeline-securitySkill
- ado-pipelines-opsSkill
- ado-release-managementSkill
- ado-security-policiesSkill
- ado-work-trackingSkill
- adr-writingSkill
- agentic-ai-patternsSkill
- agentic-evalSkill
- agentic-memorySkill
- agentic-reliabilitySkill
- agentic-securitySkill
- ai-data-moatSkill
- ai-harnessSkill
- ai-product-designSkill
- ai-product-monetizationSkill
- ai-product-positioningSkill
- ai-product-retentionSkill
- ai-product-validationSkill
- ai-safety-guardrailsSkill
- add-analytics-instrumentationSkill
- analyze-account-healthSkill
- analyze-ai-topicsSkill
- analyze-chartSkill
- analyze-dashboardSkill
- analyze-experimentSkill
- analyze-feedbackSkill
- compare-user-journeysSkill
- create-chartSkill
- create-dashboardSkill
- daily-briefSkill
- debug-replaySkill
- diagnose-errorsSkill
- diff-intakeSkill
- discover-analytics-patternsSkill
- discover-event-surfacesSkill
- discover-opportunitiesSkill
- instrument-eventsSkill
- investigate-ai-sessionSkill
- monitor-ai-qualitySkill
- monitor-reliabilitySkill
- replay-ux-auditSkill
- review-agent-insightsSkill
- taxonomySkill
- weekly-briefSkill
- what-would-lenny-doSkill
- analytics-reportingSkill
- api-contract-testingSkill
- api-designSkill
- authentication-patternsSkill
- blockchain-auditSkill
- brainstormingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
When designing schemas, reviewing slow queries, planning migrations, or auditing database performance.
- Distinctive: line 35
Add columns as nullable first, backfill, then add NOT NULL
- Distinctive: line 36
Create indexes CONCURRENTLY when possible
- Distinctive: line 37
Never rename columns in one step — add new, migrate, drop old
- Distinctive: line 38
Always include rollback migration
- Distinctive: line 39
Test on production-size dataset
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Database Optimization
When to Use
When designing schemas, reviewing slow queries, planning migrations, or auditing database performance.
Process
- Schema review — normalization, types, constraints, naming
- Index analysis — identify missing indexes from query patterns
- Query optimization — rewrite N+1, subqueries, full scans
- Migration safety — check for locks, data loss, rollback plan
Schema Checklist
- Primary keys on all tables
- Foreign keys with appropriate ON DELETE
- NOT NULL where business logic requires
- Appropriate column types (no text for dates, etc.)
- Created/updated timestamps
- Indexes on foreign keys and frequent WHERE/JOIN columns
Query Red Flags
SELECT *in production code- Missing
LIMITon unbounded queries - N+1 query patterns (loop of individual selects)
- Subqueries that could be JOINs
- Missing indexes on WHERE/ORDER BY columns
- Full table scans on large tables
Migration Safety
- Add columns as nullable first, backfill, then add NOT NULL
- Create indexes CONCURRENTLY when possible
- Never rename columns in one step — add new, migrate, drop old
- Always include rollback migration
- Test on production-size dataset
Output Format
- 🔴 Critical — data loss risk or production outage
- 🟡 Warning — performance issue or schema smell
- 🟢 Suggestion — optimization opportunity
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.

