sql-query-optimizer
Skill26 starsChanged 4 months agoMITView on GitHub
Analyzes SQL queries, execution plans, index usage, and lock contention to optimize database operations.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- myclaude-sh/sql-query-optimizertheir own version, first seen Aug 26, 2026
- mDevsLabs/Skillstheir own version, first seen Jul 29, 2026
- Nikoxkx/Agent-Skillstheir own version, first seen Jun 8, 2026
- 4444J99/a-i--skillstheir own version, first seen Jun 7, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- 4444J99/a-i--skills★ 17same name
- mDevsLabs/Skills★ 2same name
- Nikoxkx/Agent-Skills★ 2same name
- myclaude-sh/sql-query-optimizer★ 0same 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 repository119 other files it gives its agents.
- adr-writerSkill
- architecture-reviewerSkill
- cache-strategy-plannerSkill
- cost-optimization-auditorSkill
- cqrs-event-sourcing-designerSkill
- disaster-recovery-plannerSkill
- event-driven-architectSkill
- feature-flag-lifecycle-managerSkill
- migration-plannerSkill
- multi-tenant-data-partitionerSkill
- project-plannerSkill
- rate-limiting-architectSkill
- tech-debt-assessorSkill
- zero-downtime-migration-plannerSkill
- api-designerSkill
- bug-hunterSkill
- code-reviewerSkill
- concurrency-race-detectorSkill
- database-architectSkill
- dependency-auditorSkill
- error-handling-architectSkill
- graphql-schema-designerSkill
- legacy-code-refactorerSkill
- memory-leak-detectorSkill
- microservices-boundary-definerSkill
- performance-auditorSkill
- pr-reviewerSkill
- refactor-expertSkill
- resilience-circuit-breaker-designerSkill
- security-auditorSkill
- state-machine-designerSkill
- typescript-guardianSkill
- websocket-protocol-designerSkill
- adr-generatorSkill
- changelog-generatorSkill
- codebase-glossary-builderSkill
- commit-message-expertSkill
- contributor-guide-writerSkill
- documentation-writerSkill
- executive-summary-writerSkill
- readme-builderSkill
- release-notes-writerSkill
- rfc-proposal-writerSkill
- runbook-generatorSkill
- sdk-getting-started-writerSkill
- status-update-writerSkill
- ci-cd-pipeline-optimizerSkill
- context-window-optimizerSkill
- git-conflict-resolverSkill
- interview-question-generatorSkill
- meeting-notes-distillerSkill
- monorepo-workflow-architectSkill
- onboarding-guide-generatorSkill
- on-call-handover-writerSkill
- prompt-enhancerSkill
- retro-facilitatorSkill
- task-breakdown-assistantSkill
- tech-debt-burndown-plannerSkill
- cognitive-bias-detectorSkill
- decision-makerSkill
- The first 60 shown.
The file
Files
Purpose
Analyze slow or resource-intensive SQL queries, interpret EXPLAIN / ANALYZE execution plans, and rewrite queries or recommend precise indexes to eliminate sequential scans and lock contention.
When to Use
- A query causes high CPU, memory pressure, or connection saturation on the database.
- Designing complex joins, aggregations, window functions, or subqueries.
- Diagnosing deadlocks or table lock contention under concurrent writes.
What to Analyze
- Execution Plan: Inspect cost nodes, Seq Scans, Index Scans, Bitmap Index Scans, Nested Loops vs Hash Joins.
- Predicate SARGability: Identify functions on indexed columns (e.g.
WHERE DATE(created_at) = ...) preventing index hits. - Join & Subquery Efficiency: Convert correlated subqueries to CTEs, Window Functions, or Hash Joins.
- Indexing Strategy: Single-column, composite (ordering column matches query pattern), partial, or covering indexes.
- Pagination Mechanics: Replace large offset pagination (
OFFSET 100000) with keyset/cursor pagination.
Output Format
- Diagnosis: Why the query is slow (missing index, scan type, cardinality misestimate).
- Optimized SQL: Clean rewritten query with explanation.
- DDL Changes: Exact
CREATE INDEX CONCURRENTLYstatements needed. - Before vs After Metrics: Expected scan cost reduction and latency impact.
Avoid
- Adding indexes on every column without considering write throughput degradation.
- Omitting
CONCURRENTLYon production index creation statements.
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.

