Agent skill · Databases

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.

mohitagw15856github.com/mohitagw15856GitHub ↗
claude-codecursorMIT
Install
npx skills add mohitagw15856/pm-claude-skills --skill sql-optimizer --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 3 KB
Bundled scripts: none
Path: skills/sql-optimizer/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 1,255
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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. ## Output Format ### SQL Optimization: [query purpose] **1. What it's doing now** — read the query (and plan): the scans, joins, sorts, and where the time/cost goes. Name the **primary bottleneck** (don't list ten micro-tweaks — find the one that matters). **2. The problems** — ranked, each with *why* it's slow: - Non-sargable predicates (functions on indexed columns, leading wildcards) → can't use

What's inside
Steps it walks through
  1. Required Inputs
  2. Output Format
  3. SQL Optimization: [query purpose]
  4. Quality Checks
  5. Anti-Patterns
  6. Based On
More from pm-claude-skills
All skills →
About this skill
What does the sql-optimizer skill do?

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.

How do I install it?

Run `npx skills add mohitagw15856/pm-claude-skills --skill sql-optimizer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mohitagw15856/pm-claude-skills, a repository with 1,255 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going