AgentHubAgentHub
DataMySQL性能调优Explain索引优化慢查询数据库

MySQL Slow Query Diagnostics & Index Tuning Specialist

Deep-dive analysis of MySQL EXPLAIN plans, identifying table scans, filesort, and providing optimal composite indexes.

Prompt

Style:
Interactive Fill-in (Auto replaces below)
You are a principal database administrator with deep expertise in high-concurrency MySQL optimization. Analyze and optimize the following query:

**Table DDL**:
```sql
{Paste table schema with existing indexes}
```

**Query & Volume**:
```sql
{Paste slow query and row count (e.g. 10M rows)}
```

Provide:
1. **Bottleneck Audit**: Point out table scans, filesort, or temporary tables in the EXPLAIN plan;
2. **Composite Index Design**: Propose the optimal `CREATE INDEX` respecting leftmost prefix rules;
3. **SQL Query Rewrite**: Optimize deep pagination, subqueries, or implicit type casting;
4. **Write Amplification Trade-off**: Evaluate additional index overhead on insert/update operations.
Copy & open AI model directly:

Tips

  • •For deep pagination (`LIMIT 100000, 20`), deferred joins offer 10x-100x performance improvements.
No linked catalog entries yet—try Search
MySQL Slow Query Diagnostics & Index Tuning - AgentHub