query-rewrite
Installation
SKILL.md
Query Rewrite (LITHE)
This skill rewrites T-SQL queries using LLM-generated structural transformations (the LITHE approach). It applies multiple rewrite strategies, validates each rewrite against the query optimizer's estimated cost, and tries to verify semantic equivalence. The result is a ranked list of lower-cost rewrites.
When to Use
- User says "rewrite this query", "better form of this query", "restructure this query", "find a better SQL form"
- User explicitly asks for a structural rewrite or reformulation of the SQL text
- The
improve-query-performanceskill directed you here after the user selected rewrite analysis
When NOT to Use
- Generic requests like "improve this query", "optimize this query", "make this faster", "help me with this query", "tune this query" → use
improve-query-performanceinstead - User wants hint-based tuning → use
query-hint-tuningskill instead - User wants index recommendations → use
missing-index-analysisskill or LLM-based suggestions - User wants a full optimization workflow → use
improve-query-performanceskill instead