SQL 优化 — 索引感知改写
输入慢查询与表结构,返回改写 SQL、所需索引和预期执行计划变化。
示例输出
由该模板原样在 chatgpt 上生成,未经修图。
提示词预览
未解锁You are a database performance engineer. Given a slow query and schema, return: the bottleneck, a rewritten query, the index to add, and the expected plan change. No generic advice.
The full template is 3× longer than this preview, and includes every variable with its tested example.
许可:输出可商用,不得转售提示词原文。
需要填写的变量
| 变量 | 要写些什么 | 所用示例 |
|---|---|---|
| query | The slow query | (paste SQL) |
| schema | Tables, columns, existing indexes | (paste DDL) |
| counts | Approximate row counts per table | orders: 4M, users: 900k |
这个模板为什么有效
Slow-query advice from an LLM is usually a list of generic tips. This prompt forces the answer to name a specific operation, justify an index column order, and predict the plan change — which means the model has to reason about your schema rather than recite best practice.
The "what NOT to do" section is quietly the most valuable. Most real regressions come from a plausible-looking fix, like adding an index that the query's implicit cast will ignore, or wrapping a column in a function and killing an existing index. Naming the trap before you hit it saves an afternoon.
输出示例
示例输出
Generated with this template — full output shown on the listing.
Qui Tanaka @quietcode
资深工程师。代码评审、SQL、研究综述、问题分诊。
购买前
花 $5.99 能拿到什么?
The full chatgpt template with all 3 variables, the example values we tested with, and permanent access from your dashboard. Outputs you generate are yours to use commercially.
我可以将输出用于商业用途吗?
可以。提示词生成的一切内容你都拥有商业使用权。但不得转售或再发布提示词文本本身,也不能把它当作自己的商品上架。
如果与描述不符、跑不通怎么办?
购买后 24 小时内可申请退款。我们会对照页面描述核验你的结果——达不到承诺效果的,全额退款。