What problem does it solve?
This Skill helps you diagnose and eliminate slow database queries by turning inefficient SQL patterns into measurable performance improvements.
Core Features & Use Cases
- EXPLAIN-driven analysis: Interpret query plan output (including EXPLAIN ANALYZE) to pinpoint bottlenecks like sequential scans, join inefficiencies, and costly row estimates.
- Index strategy design: Choose appropriate index types (B-Tree, GIN, GiST, BRIN, functional/expression, composite, partial, covering) based on query predicates and access patterns.
- Practical optimization patterns: Apply common fixes for N+1 queries, pagination inefficiencies, heavy aggregations, correlated subqueries, and batch operation improvements.
- Advanced performance techniques: Use materialized views, partitioning strategies, and maintenance guidance (VACUUM/ANALYZE/REINDEX) to sustain gains at scale.
- Built-in resources checklist: Leverage included scripts and guides to generate actionable next steps for indexing and slow-query investigation.
Quick Start
Use the skill to optimize a slow query by asking: "Analyze this SQL and its EXPLAIN (or EXPLAIN ANALYZE) output, identify the biggest performance issues, then recommend specific indexes and rewrite the query using safer optimization patterns."