One UPDATE Statement Without Index Crashed the Business!
TL;DR · AI Summary
A single UPDATE statement without an index caused full table scan, lock contention, and connection exhaustion, ultimately crashing the business.
Key Takeaways
- Unindexed UPDATE triggered full table scan, taking 12 minutes to execute
- Single operation consumed over 100 connections, exhausting connection pool
- Lack of pre-execution slow query detection and change approval process
Outline
Jump quickly between sections.
A business system experienced severe database performance degradation during an early-morning UPDATE execution due to missing index.
Slow query logs revealed the UPDATE took over 10 minutes with no index support.
The operation caused widespread lock waits, leading to timeouts and eventual service unavailability.
The developer failed to create an index on the WHERE clause field, and the change was not tested or reviewed.
Long-running transaction was terminated immediately, index rebuilt, and service restored with traffic replay validation.
Mindmap
See how the topics connect at a glance.
查看大纲文本(无障碍 / 无 JS 友好)
- 一条没带索引的UPDATE语句导致业务崩溃
- 事故起因
- 缺少WHERE字段索引
- 未经过SQL审核
- 技术后果
- 全表扫描,耗时12分钟
- 锁竞争加剧
- 连接池耗尽
- 管理缺陷
- 缺乏变更审批流程
- 无慢查询预警机制
Highlights
Key sentences worth saving and sharing.
One UPDATE statement without index crashed the business!
Execution time reached 12 minutes, scanning nearly one million rows, triggering a chain reaction.
Connection pool exhausted, new requests couldn't establish connections, service completely collapsed.
Environment Exception
The current environment is abnormal. You can continue accessing after completing verification.