# Index Candidate Evaluation and Optimization Suggestions

Provide index candidate recommendations based on queries and existing indexes to help optimize database performance. Output includes candidate DDL, assumptions about read benefits, write maintenance costs, and space impact, without creating indexes or guaranteeing performance gains.

**Canonical URL:** https://skillshunter.net/skills/github-eosphoros-ai-db-gpt-assets-suites-sql-optimization-expert-skills-index-candidates-5e74452aab51

**JSON URL:** https://skillshunter.net/api/public/v1/skills/github-eosphoros-ai-db-gpt-assets-suites-sql-optimization-expert-skills-index-candidates-5e74452aab51

**Markdown URL:** https://skillshunter.net/skills/github-eosphoros-ai-db-gpt-assets-suites-sql-optimization-expert-skills-index-candidates-5e74452aab51.md

**Instructions download URL:** https://skillshunter.net/skills/github-eosphoros-ai-db-gpt-assets-suites-sql-optimization-expert-skills-index-candidates-5e74452aab51/download

**Category:** Data & Research

**Source URL:** https://github.com/eosphoros-ai/DB-GPT/blob/bb9c5e8a62a2c3ee3ea62e4c42d88f4deea2f372/assets/suites/sql-optimization-expert/skills/index-candidates/SKILL.md

**Source commit:** bb9c5e8a62a2c3ee3ea62e4c42d88f4deea2f372

**Listing approved at:** 2026-11-27

**Created at:** 2026-11-26T10:41:25.000000Z

**Updated at:** 2026-11-27T07:43:08.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Ensure that the target tables, common queries, and read/write workload are provided before initiating the evaluation. The recommendations are based on the supplied queries and existing indexes, and do not account for overall system load if not specified.

### When to use it

- Recommend new indexes to improve query performance
- Evaluate redundancy of existing indexes
- Design composite indexes to reduce query overhead

## Skill instructions

---
name: index-candidates
name_zh: 索引候选评估
name_en: Index Candidates
description: Recommend index candidates from supplied queries and existing indexes. Use for index advice or redundancy review. Do not create indexes or promise measured gains.
description_zh: 用户要求索引推荐、联合索引设计或冗余索引评估时使用；输出候选 DDL、适用条件、写入代价与实测方案。
command: /index-advise
argument-hint-zh: 提供目标表、常用 SQL 和已知读写负载
argument-hint-en: Supply target tables, common queries and read/write workload
user-invocable: true
---

# 索引候选评估

遵守[生产读取规则](../../references/production-readonly.md)，核对[结构与索引证据](../../references/database-evidence.md)。

1. 收集目标查询、已有索引定义、约束、谓词、排序和 JOIN 条件。缺少整体负载时限定建议只适用于已提供查询。
2. 比较已有索引与候选的列顺序、前缀、覆盖范围、唯一性、部分/表达式索引及方言支持。前缀相同不自动意味着可以删除旧索引。
3. 将选择性未知、参数分布未知和统计缺失列为验证项；不执行大表 DISTINCT/COUNT 来猜测选择性。
4. 给出候选 DDL 文本，列出读取收益假设、写入维护成本、空间影响的依据及建索引锁/在线能力待确认项。
5. 交付候选清单、可复制 DDL、保留/合并理由与测试方案。未经实测不写“提升 X%”，不执行 CREATE/DROP INDEX。综合报告使用[报告模板](../../templates/optimization-report.md)。

