← Back to Skills Marketplace
SQL Query Optimizer
by
HonestQiao
· GitHub ↗
· v1.0.0
1229
Downloads
0
Stars
8
Active Installs
1
Versions
Install in OpenClaw
/install sql-query-optimizer
Description
Analyze and optimize SQL queries by providing performance analysis, index recommendations, execution plan interpretation, and optimization suggestions.
README (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%';
优化建议
- 避免 SELECT *,只查询需要的列
- 添加 WHERE 条件和 LIMIT
- 避免 LIKE 前导通配符
- 使用索引列
- 避免嵌套子查询
- 使用 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"
}
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install sql-query-optimizer - After installation, invoke the skill by name or use
/sql-query-optimizer - Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Frequently Asked Questions
What is SQL Query Optimizer?
Analyze and optimize SQL queries by providing performance analysis, index recommendations, execution plan interpretation, and optimization suggestions. It is an AI Agent Skill for Claude Code / OpenClaw, with 1229 downloads so far.
How do I install SQL Query Optimizer?
Run "/install sql-query-optimizer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is SQL Query Optimizer free?
Yes, SQL Query Optimizer is completely free (open-source). You can download, install and use it at no cost.
Which platforms does SQL Query Optimizer support?
SQL Query Optimizer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created SQL Query Optimizer?
It is built and maintained by HonestQiao (@honestqiao); the current version is v1.0.0.
More Skills