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 atalovesyou-sql-optimization-patterns npx -- -y @trustedskills/atalovesyou-sql-optimization-patterns
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"atalovesyou-sql-optimization-patterns": {
"command": "npx",
"args": [
"-y",
"@trustedskills/atalovesyou-sql-optimization-patterns"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides SQL query optimization patterns to improve database performance. It analyzes provided SQL queries and suggests improvements based on common best practices, such as indexing strategies, avoiding full table scans, and rewriting inefficient joins. The goal is to reduce query execution time and resource consumption for databases.
When to use it
- Slow Query Analysis: When you have a specific SQL query that's taking too long to execute.
- Database Performance Tuning: As part of a broader effort to optimize database performance and identify bottlenecks.
- Learning Best Practices: To understand common SQL optimization techniques and apply them proactively.
- Code Review Assistance: To help review SQL code written by others and suggest improvements.
Key capabilities
- Suggests indexing strategies for improved query performance.
- Identifies full table scans and recommends alternatives.
- Provides guidance on rewriting inefficient joins.
- Offers general SQL optimization best practices.
Example prompts
- "Optimize this SQL query:
SELECT * FROM orders WHERE customer_id = 123;" - "I'm seeing slow performance with this query. Can you suggest improvements?
SELECT product_name, price FROM products JOIN categories ON products.category_id = categories.id WHERE category_name = 'Electronics';" - "What are some common SQL optimization patterns I should be aware of?"
Tips & gotchas
The effectiveness of the suggestions depends on the complexity and structure of the provided SQL query, as well as the underlying database schema. Providing context about the table sizes and data distribution can help improve the quality of recommendations.
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.