- Home
- Skills
- Jeremylongshore
- Claude Code Plugins Plus Skills
- Optimizing Sql Queries
optimizing-sql-queries_skill
- Python
1.4k
GitHub Stars
1
Bundled Files
3 weeks ago
Catalog Refreshed
2 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstart where the catalogue uses aiagentskills.
npx veilstart add skill jeremylongshore/claude-code-plugins-plus-skills --skill optimizing-sql-queries- SKILL.md4.7 KB
Overview
This skill automates SQL query performance analysis and delivers practical guidance to speed up slow queries. It helps you assess current query behavior, design optimization changes, implement and validate them safely, and deploy improvements to production. Outputs include scripts, monitoring dashboards, documentation, and runbooks to operationalize results.
How this skill works
The skill inspects query plans, execution metrics, schema and index usage, and system resource patterns to identify bottlenecks and anti-patterns. It generates prioritized recommendations, automated scripts or configuration changes, and test plans to validate improvements in non-production first. It also produces monitoring and rollback artifacts so you can observe impact and recover if needed.
When to use it
- When queries or reports are consistently slow or have high resource usage
- Before scaling infrastructure to see if query improvements reduce costs
- When adding indexes, refactoring schema, or changing database settings
- During incident response for production query performance regressions
- As part of release validation to prevent performance regressions
Best practices
- Run analysis and implement changes in staging before touching production
- Establish baseline metrics and compare after each change
- Use least-privilege service accounts for automation and changes
- Automate validation, monitoring, and rollback procedures
- Document every change, expected outcome, and success criteria
Example use cases
- Analyze slow JOIN-heavy reports and produce indexing and rewrite recommendations
- Automate index creation and removal scripts with pre/post validation
- Tune database configuration knobs and measure latency/throughput impact
- Create dashboards and alerts to catch regressions after deploy
- Prepare runbooks for on-call teams to troubleshoot query-related incidents
FAQ
You should have read-only access to production metrics and query plans; implement changes in non-production first and schedule production work with appropriate approvals.
What if an optimization causes regressions?
Follow the rollback plan included in the implementation artifacts and use the monitoring dashboards to quickly detect and revert problematic changes.