Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add DeepSQLAI/deepsql --skill slow-query-optimizegit clone --depth 1 https://github.com/DeepSQLAI/deepsqlWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/deepsqlai/deepsql/slow-query-optimize)<a href="https://agentmods.dev/skills/deepsqlai/deepsql/slow-query-optimize"><img src="https://agentmods.dev/badge/skills/deepsqlai/deepsql/slow-query-optimize/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/deepsqlai/deepsql/slow-query-optimize"><img src="https://agentmods.dev/badge/skills/deepsqlai/deepsql/slow-query-optimize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00028 | $0.00502 |
| Opus 5.5 | $0.00011 | $0.00201 |
| Sonnet 5.5 | $0.00006 | $0.00100 |
| Haiku 4.5 | $0.00003 | $0.00050 |
Grade A, and why
slow-query-optimize scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Slow Query Optimize
Use when the user points at a specific query and asks "why is this slow?" or "make this faster." For workload-level "what's slow overall?" use workload-analysis instead.
Procedure
-
Resolve the connection (
list_connections→ UUID). -
Analyze the plan.
analyze_query_plan(connectionId, sql)returns the parsed plan tree, performance issues, missing-index hints, and a written summary that already accounts for the connection's schema and business rules. UseuseAnalyze: falseby default —useAnalyze: trueactually executes the query (and for a mutation, triggers the same admin + confirm gate asexecute_sql). -
Get an AI rewrite for a specific statement with
optimize_slow_query(connectionId, sql, avgExecutionTimeMs=…). Pass the average execution time to anchor the impact estimate. Note: this is single-query scoped and does NOT recommend indexes — route index questions to theindex-advisorskill. -
If the query came from the live workload, identify it by fingerprint first:
analyze_slow_queries(recent slow queries with fingerprints) →get_query_samples(fingerprint)for a real statement with bind values to plan against →get_slow_query_timeline(queryId)to confirm whether it's actually getting slower. -
Report: the root cause (slow node, bad estimate, missing index, plan drift), the proposed rewrite, and the expected improvement. If the real fix is an index, say so and hand off to
index-advisor.
Guardrails
- Don't run a mutation just to time it.
useAnalyze: trueon anUPDATE/DELETEexecutes it — only do that with admin role and explicit confirmation. - A rewrite that changes result semantics is a bug, not an optimization. Preserve the business rules (filters, soft-deletes) the original query respected.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 32 lines · 28 tokens per session scan A 2bff054cb253
slow-query-optimize is a skill published in the GitHub repository DeepSQLAI/deepsql (41 stars, last pushed 5d ago), licensed Apache-2.0. It adds 28 tokens to every session and 502 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
slow-query-optimize compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| slow-query-optimizeDeepSQLAI/deepsql | Skill | 41 | 5d ago | Apache-2.0 | A | 28 | Claude Code, Codex |
| reproduce-buggoogleapis/mcp-toolbox | Skill | 17k | 3d ago | Apache-2.0 | A | 130 | Claude Code, Codex |
| fix-failing-testsgoogleapis/mcp-toolbox | Skill | 17k | 3d ago | Apache-2.0 | A | 87 | Claude Code, Codex |
| triage-issuesgoogleapis/mcp-toolbox | Skill | 17k | 3d ago | Apache-2.0 | A | 164 | Claude Code, Codex |
| graphjin-evaldosco/graphjin | Skill | 3.2k | yesterday | Apache-2.0 | A | 27 | Claude Code, Codex |
| solr-querygriddynamics/rosetta | Skill | 382 | 5d ago | Apache-2.0 | A | 27 | Claude Code, Codex |
| exasol-mcp-serverexasol/mcp-server | Skill | 18 | today | MIT | A | 36 | Claude Code, Codex |