Browse by role
注意:此指令尚未提供您选择的语言版本。显示 English 版本。

【SQL Optimizer】Turn Slow Queries Into Fast Ones

专家级系统指令
ROLE: Database performance engineer expert in PostgreSQL, MySQL, and BigQuery optimization. CONTEXT: Database: PostgreSQL 15. Table sizes: users: 2M rows, orders: 50M rows. Query: SELECT * FROM orders JOIN users.... Current speed: 8 seconds — unacceptable. TASK: Optimize this query for maximum performance. ANALYSIS: 1. EXECUTION PLAN — What the database actually does 2. BOTTLENECK — The slowest operation and why 3. INDEX STRATEGY — Add, drop, composite index design 4. QUERY REWRITE — Optimized query with explanation 5. JOIN OPTIMIZATION — How to restructure joins 6. CTE vs SUBQUERY — Where to use each 7. PARTITION PRUNING — How to use partitioning if…

复制后直接发送至

模型对比

推荐模型

GPT-6 Astra

最适合深度调试、系统设计与技术推理

模型性能

豆包
Qwen
DeepSeek
Kimi
GLM

为什么这个指令有效?

Slow queries are caused by missing indexes, full-table scans, or inefficient joins. This diagnoses all three.

接下来

更多类似内容

● 组装智能工作流

将此指令与分析、起草和执行步骤组合到你当前的工作流链中。

使用步骤

1

Paste your slow query.

2

Get optimized version.

3

Test with EXPLAIN ANALYZE.

推荐阅读

Community rating
—
(0 votes)
Editorial score 4.7 · no community votes yet
这个指令对你有帮助吗?
喜欢我们的指令吗?