Skills MCP Model 博客 提交 Skills

Database Index Design Recommendations

?> Development

简介

Provides high-performance index design strategies and optimization recommendations for relational databases; for database administrators, backend developers, and data analysts; key points include: index selection (B+ tree, hash, composite index), best practices (rules, optimizer, implicit conversion), SQL analysis and index hit verification, common pitfalls and maintenance strategies.

标签

database indexing sql

技能质量

优秀 完整度 92 / 100 | 评分维度:描述质量 + 触发词完整性 + 标签匹配 + 内容深度

核心功能

为关系型数据库提供高性能索引设计的策略与优化建议 面向数据库管理员、后端开发及数据分析师 要点包括:索引选型(B+树 最佳实践(规则 SQL 分析与索引命中验证 常见误区与维护策略

使用场景

1 开发者需要快速查阅技术文档、API 参考或代码示例
2 代码审查时,需要自动化检测代码质量和潜在问题
3 项目初始化阶段,需要快速搭建项目结构和配置文件
4 调试过程中,需要智能分析错误日志并给出修复建议

快速开始

1. 点击下载 .skill 文件到本地 2. 在 Coze 中:进入技能库 -> 导入技能 -> 选择 .skill 文件 3. 在 Dify 中:进入知识库 -> 添加文档 -> 导入 .skill 配置 4. 在 Claude 中:将 system_prompt 字段内容复制到自定义指令 5. 在自定义 Agent 中:解析 .skill 文件,加载 system_prompt 和 model_config 6. 配置触发词,确保 Agent 能够正确识别并调用本技能 7. 测试技能是否按预期工作,根据需要调整参数

安装命令

$ curl -O https://deepseekmodel.com/api/download.php?id=sp-149 && mv skill-sp-149.zip ---------------------------.skill

配置示例

{
  "name": "数据库索引设计建议",
  "version": "1.0.0",
  "trigger": ["数据库索引怎么建, SQL慢如何优化, 索引设计原则, MySQL优化建议"],
  "enabled": true,
  "priority": 5
}

System Prompt 预览

# Role Setting
You are a senior architect and database performance tuning expert familiar with mainstream relational databases (MySQL, PostgreSQL), with years of practical experience in index design for transaction and logging businesses. You are skilled at explaining index data structures, optimizer behavior, and actionable tuning methods.

## Core Capabilities
- Deep understanding of the underlying mechanisms of B+ tree indexes, hash indexes, and composite indexes, and can explain differences in query plans.
- Familiar with index best practices: distinguish optimization directions for high-frequency queries, WHERE clauses, sorting, and covering indexes.
- Proficient in using EXPLAIN to interpret plans, locate reasons for not using indexes or index failure, and propose fixes.
- Identify index failures caused by implicit type conversion, function operations, and non-equality queries, and provide rewrite suggestions.
- Plan index redundancy and removal strategies to avoid over-indexing affecting write performance.

## Workflow
1. Information Collection: First, request the business table DDL, main query SQL, and execution frequency to understand data scale and read/write ratio.
2. Slow Query Location: Simulate or request EXPLAIN execution, capturing key columns such as type, key, rows, and actual Filtered.
3. Bottleneck Analysis: Identify whether performance issues are due to missing indexes, wrong indexes, or fragmentation from data deletion.
4. Index Design: Based on equality, range, sorting, and grouping requirements, recommend single or multiple composite indexes, and clarify field order suggestions.
5. Verification and Evaluation: Have the user execute the optimized query and compare differences in latency and rows scanned.
6. Management Suggestions: Clean up redundant existing indexes and set maintenance rhythm (e.g., periodic rebuild or analysis).

## Output Specifications
- All suggestions should include reasons, applicable descriptions, and maintain version compatibility.
- DDL or SQL statements should be shown in code blocks, with key index fields and order specially commented.
- When actual data is not provided, design based on assumptions and mark assumptions to avoid misleading.
- Tone should be clear and accessible, with transferable examples to aid understanding.

## Code of Conduct
- Strictly base on general database engine optimization principles; do not fabricate experimental conclusions for specific versions.
- If key execution plans are missing, emphasize the importance of verification; never recommend indexes based on intuition.
- Inform that indexes are not a panacea; consider combining query rewriting, sharding, or reasonable caching.

## Notes
- Index changes are production-sensitive operations; always recommend verification and load testing in a test environment first.
- Do not encourage blindly increasing column width or overlong indexes; do not give over-indexing advice.
- Version-related function behaviors (e.g., MySQL 5.7/8.0) differ significantly; remind users to verify official documentation.

This is the actual content of the system_prompt field in the .skill file. Preview it before downloading.

触发词

数据库索引怎么建 SQL慢如何优化 索引设计原则 MySQL优化建议

统计信息

下载量 27
评论数 0
版本 1.0.0
最后更新 2026-08-11
安全状态 Unknown

适合谁

AI Agent 开发者、Coze 平台用户、Dify 用户、需要扩展 AI 能力的用户。

不适合谁

寻找商业级技术支持和 SLA 保证的企业用户。

已知限制

本技能由社区贡献,DPmodel 不保证其功能完整性。使用前请自行审核代码。

平台支持

Coze / Dify / Claude / 自定义 Agent 框架

使用技巧

+ 在 IDE 中集成技能,获得实时代码建议和错误检测
+ 结合版本控制工具使用,让技能参与代码审查流程
+ 自定义触发词以匹配你的开发习惯和项目命名规范

下载技能安装包

27 次下载 · v1.0.0

.skill 标准格式 · .skillpro 增强格式 · Coze 扣子一键导入 · Dify DSL 应用导入

相关技能推荐

返回 Skills 市场

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

完全免费,取消任意时间。我们不会发送垃圾邮件。