Skip to main content
在 Manus 中运行任何 Skill
一键导入

query-rewrite

星标3
分支0
更新时间2026年6月16日 02:15

Rewrite a slow or inefficient SQL query for performance when an index alone won't fix it — full-table or per-row aggregates that should be rollups, SELECT * with deep pagination, redundant or accidental joins, ORM-generated CASE/subquery noise, or queries already using the right index but still scanning millions of rows. Because a safe rewrite depends on business meaning the SQL text does NOT carry (what a status code means, whether a column is effectively nullable, which columns the caller truly consumes, whether stale/approximate results are acceptable), this skill INTERVIEWS the domain owner with targeted questions before proposing anything, then validates that the rewrite preserves results and improves the plan. Use when the user wants to rewrite, refactor, simplify, or speed up a specific SQL query, or when find-impacting-queries hands off a "rewrite candidate". Triggers: "rewrite this query", "this query is slow and indexing didn't help", "simplify this SQL", "optimize this SELECT/JOIN", "make this aggr

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

SKILL.md
readonly