What problem does it solve?
Slow or resource-heavy SQL queries caused by poor query patterns, suboptimal indexes, inefficient pagination, and lack of monitoring guidance, leading to high latency and increased database load. This Skill provides actionable, database-agnostic advice to identify bottlenecks and convert anti-patterns into efficient, maintainable SQL.
Core Features & Use Cases
- Query performance analysis: Interpret execution plans, recommend rewrites, and replace correlated subqueries with window functions or joins where appropriate.
- Indexing and schema guidance: Propose composite, partial, and covering indexes tailored to query patterns and advise on avoiding over-indexing.
- Pagination, aggregation, and batching: Recommend cursor or ID-based pagination, optimized aggregation queries, and bulk operation strategies to reduce overhead.
- Use case: Improve an orders reporting query that currently does full table scans by suggesting selective indexing, JOIN restructuring, and a cursor-based pagination approach to reduce query time and resource consumption.
Quick Start
Analyze the selected slow SQL query, identify the primary bottlenecks, and provide concrete index, rewrite, and monitoring recommendations.