index-advisor

index-advisor is a skill for Claude Code, Codex from DeepSQLAI/deepsql. It costs 32 tokens per session (609 once invoked), scanned A, original, Apache-2.0.

A database helper that recommends which indexes—lookup structures that can speed up queries—to add or remove for a connection’s overall workload.

In plain words
What is it for?
Use it to review index health, investigate slow workloads, find unused or duplicate indexes, and assess add or drop recommendations for specific tables.
Why use it?
It avoids choosing an index based on one query while overlooking slower writes, unused indexes, or competing queries. It can also estimate changes before they are applied.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to review index health, investigate slow workloads, find unused or duplicate indexes, and assess add or drop recommendations for specific tables.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/deepsqlai/deepsql/index-advisor
Install

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.

Any agent
npx skills add DeepSQLAI/deepsql --skill index-advisor
Clone the repo
git clone --depth 1 https://github.com/DeepSQLAI/deepsql

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for index-advisor

README.md
[![agentmods](https://agentmods.dev/badge/skills/deepsqlai/deepsql/index-advisor/github.svg)](https://agentmods.dev/skills/deepsqlai/deepsql/index-advisor)
Your own site
<a href="https://agentmods.dev/skills/deepsqlai/deepsql/index-advisor"><img src="https://agentmods.dev/badge/skills/deepsqlai/deepsql/index-advisor/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.

agentmods 80×15 button for index-advisor

Your own site · 80×15
<a href="https://agentmods.dev/skills/deepsqlai/deepsql/index-advisor"><img src="https://agentmods.dev/badge/skills/deepsqlai/deepsql/index-advisor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 609 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.00609
Opus 5.5 $0.00013 $0.00244
Sonnet 5.5 $0.00006 $0.00122
Haiku 4.5 $0.00003 $0.00061

Measured 1mo ago against content hash 401a2b9d1090, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

index-advisor 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 1mo 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.

agent/skills/index-advisor/SKILL.md · 35 lines

How it starts

The opening of the file, as written. The whole thing — 35 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Index Advisor

Use when the user asks what indexes to add or drop, or "how do I speed up this workload with indexes?" Indexes are a whole-workload decision — never recommend one off a single query in isolation; that's what this advisor is for.

Procedure

  1. Resolve the connection (list_connections → UUID).

  2. Get the workload-weighted recommendations. get_index_recommendations(connectionId) returns the pre-computed top-N (default 5) ranked by net benefit (Σ calls × mean_exec_time − write cost). Each carries the contributing query fingerprints, the role each column played, and (on Postgres) a HypoPG cost-delta. This covers both CREATE_INDEX and DROP_INDEX (unused / redundant-prefix) candidates.

  3. Add catalog context when relevant: get_index_health(connectionId) for the overall picture, get_unused_indexes / get_duplicate_indexes for dead weight, get_missing_indexes for catalog-level suggestions, get_table_index_usage(table) for one hot table.

  4. Explain each recommendation in terms the user can act on: which queries it helps, expected benefit, and write-cost trade-off. Don't just dump the list.

  5. Estimate impact before applying. apply_index_recommendation(recommendationId, mode="DRY_RUN") (default) uses HypoPG on Postgres to install a virtual index and EXPLAIN the contributing queries — zero writes. Report the planner cost delta.

  6. Apply only on explicit request, admin only. mode="APPLY" (real CREATE/DROP INDEX CONCURRENTLY) or APPLY_AND_MEASURE (also runs EXPLAIN ANALYZE before/after) require confirm: true. The DDL is server-generated from the recommendation row — you never supply index SQL. Surface what will run and get a human OK first.

Guardrails

  • Recommend against an existing covering index/constraint instead of a redundant single-column one — get_index_health / get_table_index_usage will show it.
  • A DROP_INDEX recommendation for an "unused" index still deserves a sanity check: confirm with the user it isn't a rarely-used-but-critical path before applying.
  • apply_index_recommendation is the only write-capable MCP tool. Treat every APPLY like a production change.

Read the full file on GitHub · 35 lines

Changes

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.

  1. 1mo ago First seen · 35 lines · 32 tokens per session scan A 401a2b9d1090

Subscribe to this mod's changes

index-advisor is a skill published in the GitHub repository DeepSQLAI/deepsql (39 stars, last pushed 5d ago), licensed Apache-2.0. It adds 32 tokens to every session and 609 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.

Related

Other skills, from other repositories

sql-expert

Expert-level SQL database design, querying, optimization, and administration across PostgreSQL, MySQL, and SQL Server. Use when the user mentions database, PostgreSQL, MySQL, or query optimization, or when the task involves Database Design, Advanced Queries, Indexes and Performance, or Transactions and Concurrency.

personamanagmentlayer/pcl · 66 tokens

docsite-link-sweep

Sweep the googleapis/mcp-toolbox docs for broken and non-canonical links, report each finding with its cause, and apply the safe class of internal link fixes. CI does not check links on this repo, so this skill is the only link check that runs. Use when a maintainer asks for a link sweep or a docs health check, before…

googleapis/mcp-toolbox · 148 tokens

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

openloomi-api

OpenLoomi ships a local-first HTTP API served from the desktop app (port 3414, fallback 3515). All auth, Memory, AI, RAG, Loop, and Audit data live in a local SQLite database — your data stays on your machine and the OpenLoomi app is the source of truth. The only externally-routed auth path is the Composio OAuth…

melandlabs/openloomi · 106 tokens

output-dev-credentials

Store and reference encrypted secrets in Output SDK workflows using @outputai/core/credentials. Use when integrating API keys, database passwords, or third-party tokens.

growthxai/output · 36 tokens

change

Track and inspect graph changes, diffs, temporal updates, and the impact of new data on VeritasReason knowledge graphs.

bibinprathap/VeritasGraph · 27 tokens