← 返回 Skills 市场
honestqiao

SQL Query Optimizer

作者 HonestQiao · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1229
总下载
0
收藏
8
当前安装
1
版本数
在 OpenClaw 中安装
/install sql-query-optimizer
功能描述
Analyze and optimize SQL queries by providing performance analysis, index recommendations, execution plan interpretation, and optimization suggestions.
使用说明 (SKILL.md)

SQL Query Optimizer

分析并优化 SQL 查询,提升数据库性能。

功能

  • 查询性能分析
  • 索引建议
  • 执行计划解读
  • SQL 优化建议

触发词

  • "SQL优化"
  • "查询优化"
  • "sql optimization"
  • "慢查询"

检测问题

-- 检测 SELECT * 问题
SELECT * FROM users WHERE id = 1;

-- 检测缺少 LIMIT
SELECT name FROM users;

-- 检测前导通配符
SELECT * FROM users WHERE name LIKE '%john%';

优化建议

  1. 避免 SELECT *,只查询需要的列
  2. 添加 WHERE 条件和 LIMIT
  3. 避免 LIKE 前导通配符
  4. 使用索引列
  5. 避免嵌套子查询
  6. 使用 EXPLAIN 分析执行计划

输出示例

{
  "original": "SELECT * FROM users WHERE name LIKE '%john%'",
  "suggestions": [
    "避免使用 SELECT *,只查询需要的列",
    "避免 LIKE 前导通配符",
    "添加 LIMIT 限制返回数量"
  ],
  "optimized": "SELECT id, name FROM users WHERE name LIKE '%john%' LIMIT 100"
}
安全使用建议
This skill appears coherent and low-risk: it only provides static SQL suggestions and does not request credentials or install software. Before using it in automated workflows, keep in mind: (1) it does not connect to your database or run EXPLAIN by itself — paste actual EXPLAIN output if you want real execution-plan analysis; (2) suggestions are generic and may be incorrect or overly blunt (example shows LIMIT 100); (3) the implementation snippet has a missing applySuggestions function, so optimized output may be a placeholder. If you plan to integrate the skill with an agent that has database access, avoid supplying production DB credentials unless you trust the skill's source; consider asking the author for a homepage or repo to verify provenance.
功能分析
Type: OpenClaw Skill Name: sql-query-optimizer Version: 1.0.0 The skill bundle aims to optimize SQL queries, as described in SKILL.md and skill.yaml. The JavaScript implementation in skill.yaml performs basic string pattern matching on the input SQL query to identify common issues and suggest improvements. There is no evidence of malicious behavior such as data exfiltration, unauthorized execution, persistence mechanisms, or prompt injection attempts against the AI agent. While the `applySuggestions` function is called but not defined within the provided files, the existing code itself is benign, performing only string analysis without any risky operations.
能力评估
Purpose & Capability
Name and description match the actual content: static analysis and optimization suggestions for SQL. The skill requests no unrelated binaries, env vars, or installs.
Instruction Scope
SKILL.md and skill.yaml contain only static analysis guidance (patterns, suggestions). They do not request database connections, read files, or transmit data. Minor implementation inconsistency: the JavaScript snippet refers to applySuggestions (not defined) and the example output uses an arbitrary 'LIMIT 100' — a functional/accuracy issue but not a security red flag.
Install Mechanism
No install spec or code to download; this is instruction-only, which minimizes disk/network risk.
Credentials
The skill requires no environment variables, credentials, or config paths — proportional and minimal for its stated purpose.
Persistence & Privilege
always:false and no sign of writing or modifying other skills or system-wide configs. Autonomous invocation is allowed (platform default) but not elevated.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install sql-query-optimizer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /sql-query-optimizer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of SQL Query Optimizer. - Supports SQL query performance analysis and optimization suggestions. - Provides index recommendations and execution plan interpretation. - Detects common SQL issues such as SELECT *, missing LIMIT, and leading wildcards in LIKE. - Suggests practical improvements for faster and more efficient database queries.
元数据
Slug sql-query-optimizer
版本 1.0.0
许可证
累计安装 9
当前安装数 8
历史版本数 1
常见问题

SQL Query Optimizer 是什么?

Analyze and optimize SQL queries by providing performance analysis, index recommendations, execution plan interpretation, and optimization suggestions. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1229 次。

如何安装 SQL Query Optimizer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install sql-query-optimizer」即可一键安装,无需额外配置。

SQL Query Optimizer 是免费的吗?

是的,SQL Query Optimizer 完全免费(开源免费),可自由下载、安装和使用。

SQL Query Optimizer 支持哪些平台?

SQL Query Optimizer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 SQL Query Optimizer?

由 HonestQiao(@honestqiao)开发并维护,当前版本 v1.0.0。

💬 留言讨论