MySQL 5.7 引入獨立臨時表空間,導致 Undo Log 分配邏輯發生變化。
| 版本 | Undo Log 分類 | 預留段數 | 配置要求 |
|---|---|---|---|
| 5.6 | 無區分 | - | innodb_undo_logs (舊 innodb_rollback_segments) |
| 5.7.2+ | 1. 臨時表空間回滾段 2. 普通回滾段 | 32 個段預留給臨時表 (ibtmp1) | 系統表空間存放:innodb_undo_logs > 32獨立 undo 表空間: innodb_undo_logs > 33 |
As of MySQL 5.7.2, 32 undo logs are reserved for use by temporary tables and are hosted in the temporary table tablespace (ibtmp1). To allocate additional undo logs for data-modifying transactions... innodb_undo_logs must be set to a value greater than 32 if undo logs are stored in the system tablespace only. If you have configured separate undo tablespaces, innodb_undo_logs must be set to a value greater than 33...
innodb_undo_tablespaces),便於管理與磁盤隔離SHOW ENGINE INNODB STATUS 中 History list length,防止長事務導致 undo 膨脹