query-optimize
Installation
SKILL.md
SQL Query Optimization
This skill provides procedural guidance for optimizing SQL queries effectively, with emphasis on proper benchmarking, query plan analysis, and iterative refinement.
Core Optimization Workflow
1. Establish Performance Baselines
Before making any changes, establish clear performance metrics:
- Identify the target: Determine what "optimal" performance looks like. Look for reference implementations, documented benchmarks, or theoretical analysis of query complexity.
- Measure the original query: Record execution time with multiple runs to account for caching effects.
- Document the goal: Define success as "as fast as possible" not just "faster than the original."
2. Analyze Query Plans
Always use query plan analysis before and after optimization: