文章目录
1 问题背景
前面了解了InnoDB磁盘架构之redo log,今天了解undo log
2 回顾
InnoDB架构如下所示:
3 undo log
原文
An undo log is a collection of undo log records associated with a single read-write transaction. An undo log record contains information about how to undo the latest change by a transaction to a clustered index record. If another transaction needs to see the original data as part of a consistent read operation, the unmodified data is retrieved from undo log records. Undo logs exist within undo log segments, which are contained within rollback segments. Rollback segments reside in undo tablespaces and in the global temporary tablespace.
一个undo log是一个与单个读写事务有联系的undo log记录的集合。undo log记录包含有关如何撤销事务对聚集索记录的最新更改的信息。如果另一个事务需要看到原来的数据作为一致性读操作的一部分,未修改的数据从undo log记录恢复。undo logs存在于undo log的回滚段。回滚段居于undo表空间和全局缓存表空间中。
原文
Undo logs that reside in the global temporary tablespace are used for transactions that modify data in user-defined temporary tables. These undo logs are not redo-logged, as they are not required for crash recovery. They are used only for rollback while the server is running. This type of undo log benefits performance by avoiding redo logging I/O.
全局表空间的undo log被用于某些事务,这些事务是修改用户自定义的临时表的数据。这些undo log不可以作为redo log,因为他们不需要恢复。他们仅仅是用于服务器正在运行时的回滚。这类型的undo log通过避免redo 日志的I/O来提高性能。