Individual skill

sql-optimizer

Diagnose a slow SQL query and produce a concrete optimization plan. Use when asked to optimize SQL, speed up a slow query, reduce a query's cost/scan, fix a timeout, or review a query plan. Produces an analysis — the likely bottleneck, what the plan is doing wrong (full scans, bad joins, spills), the specific rewrite and index/partition changes, and the expected impact, with the optimized query.

skills/sql-optimizer/SKILL.md

Read pinned source

Source commit e0009a385c480fb0b5687e7412df67c7c64f7cee

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
No
Repository scan complete
No
Skill scan complete
No
Observed behavior
Not checked yet
Last checked
Nov 12, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
1,541
Repository last updated
Nov 11, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# SQL Optimizer Skill

A slow query almost always has a specific, findable cause — a missing index, a non-sargable predicate, a
join that explodes rows, a scan that should be a seek. This skill diagnoses it: read what the query (and
plan, if given) is actually doing, name the bottleneck, and produce a concrete rewrite plus the index /
partition / structural changes — with the expected impact, not vague "add indexes" advice.

## Required Inputs

Ask for these only if they aren't already provided:

- **The query** (and the engine — Postgres, BigQuery, Snowflake, MySQL… optimizations differ).
- **The symptom** — slow, expensive (bytes scanned), timing out, or just under review.
- **Context if available** — `EXPLAIN`/query plan, table sizes/row counts, existing indexes, partitioning/clustering.
Back to top