Data Sql Optimization
Helps with data, optimization 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 data-sql-optimization npx -- -y @trustedskills/data-sql-optimization
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"data-sql-optimization": {
"command": "npx",
"args": [
"-y",
"@trustedskills/data-sql-optimization"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill provides checklists, patterns, and templates for optimizing transactional (OLTP) SQL queries within databases. It focuses on a measurement-first approach to triage performance issues, interpreting query execution plans, creating balanced indexes, monitoring performance, managing schema changes, backups/recovery, high availability, and security. The skill supports PostgreSQL, MySQL, SQL Server, Oracle, and SQLite databases.
When to use it
- Diagnose slow queries and identify missing indexes.
- Identify performance bottlenecks in a production database environment.
- Find unused or inefficient indexes.
- Manage version-controlled database schema changes using tools like Flyway or Liquibase.
- Implement point-in-time recovery and disaster recovery strategies.
- Set up high availability and read scaling for databases.
Key capabilities
- Query Performance Analysis (using
EXPLAIN ANALYZE) - Finding Slow Queries (using
pg_stat_statementsor slow query logs) - Index Analysis (using
pg_stat_user_indexesorSHOW INDEX) - Schema Migration (with Flyway/Liquibase)
- Backup & Recovery (using
pg_dump/mysqldump) - Replication Setup (Streaming/GTID)
- Safe Tuning Loop (Measure -> Explain -> Change -> Verify)
Example prompts
- "Can you help me analyze the execution plan for this SQL query?"
- "How can I identify slow queries in my PostgreSQL database?"
- "What's the best way to manage schema changes in MySQL using version control?"
Tips & gotchas
- This skill is specifically designed for OLTP (transactional) databases. For OLAP/Analytics workloads, consider using the
data-lake-platformskill instead. - Always follow a "Measure -> Explain -> Change -> Verify" approach to avoid regressions when tuning SQL queries.
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.