Sql Optimization Patterns
Helps with optimization, patterns as part of working with databases and data persistence workflows.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add ynulihao-sql-optimization-patterns npx -- -y @trustedskills/ynulihao-sql-optimization-patterns
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"ynulihao-sql-optimization-patterns": {
"command": "npx",
"args": [
"-y",
"@trustedskills/ynulihao-sql-optimization-patterns"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill helps optimize SQL queries by suggesting and implementing common optimization patterns. It analyzes provided SQL queries, identifies potential bottlenecks, and proposes improvements such as adding indexes, rewriting joins, or simplifying complex subqueries. The goal is to improve query performance and reduce database load.
When to use it
- Slow Query Analysis: When you have a specific SQL query that's taking an unexpectedly long time to execute.
- Database Performance Tuning: As part of a broader effort to optimize the overall performance of your database system.
- Complex Query Refactoring: When dealing with intricate queries involving multiple tables and subqueries where simplification could improve efficiency.
- Identifying Indexing Opportunities: To discover missing indexes that could significantly speed up query execution.
Key capabilities
- SQL query analysis
- Index suggestion
- Join optimization
- Subquery simplification
- Pattern identification (e.g., full table scans)
Example prompts
- "Optimize this SQL query:
SELECT * FROM orders WHERE customer_id = 123;" - "Can you suggest ways to improve the performance of this complex join query?"
- "Analyze this SQL statement and identify any potential indexing opportunities:
...[SQL Query]..."
Tips & gotchas
The skill requires a valid SQL query as input. It's best suited for standard SQL dialects; highly specialized or proprietary syntax might not be supported.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.