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 xfstudio-sql-optimization-patterns npx -- -y @trustedskills/xfstudio-sql-optimization-patterns
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"xfstudio-sql-optimization-patterns": {
"command": "npx",
"args": [
"-y",
"@trustedskills/xfstudio-sql-optimization-patterns"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides AI agents with patterns and techniques for optimizing SQL queries. It helps identify common performance bottlenecks, suggests appropriate indexing strategies, and recommends query rewriting approaches to improve database efficiency. The goal is to reduce query execution time and overall system load.
When to use it
- Slow Query Analysis: When a specific SQL query takes an unexpectedly long time to execute.
- Database Performance Tuning: As part of a broader effort to optimize the performance of a database application.
- Identifying Indexing Opportunities: To determine if adding or modifying indexes could improve query speed.
- Query Refactoring: When needing to rewrite complex SQL queries for better readability and efficiency.
Key capabilities
- SQL Query Analysis
- Indexing Recommendations
- Query Rewriting Suggestions
- Performance Bottleneck Identification
Example prompts
- "Analyze this SQL query:
SELECT * FROM orders WHERE customer_id = 123;and suggest optimizations." - "I'm seeing slow performance on a join between the 'customers' and 'orders' tables. What indexing strategies should I consider?"
- βCan you rewrite this query to be more efficient:
SELECT COUNT(*) FROM products WHERE price > 100 AND category = 'electronics';β
Tips & gotchas
The skill requires a valid SQL query as input; it cannot operate without one. While the suggestions are based on best practices, always test changes in a non-production environment before applying them to live data.
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.