当前位置:网站首页>数据库日志
数据库日志
2022-06-27 18:05:00 【无敌的神龙战士】
redo log
redo log:重做日志,用于记录事务操作的变化,确保事务的持久性。redo log是在事务开始后就开始记录(并不是事务commit时才记录,因为整个事务改的可能有很多,如果在commit的时候才写redo log的话,可能花的时间特别长了。而是事务begin开始后就记录了,随着事务执行过程中对数据的修改,实时写redo log),不管事务是否提交都会记录下来,在异常发生时(如数据持久化过程中掉电),InnoDB会使用redo log恢复到掉电前的时刻,保证数据的完整性。

innodb_log_buffer_size默认是16M,就是redo log缓冲区的大小,它随着事务开始,就开始写redolog,如果事务比较大,为了避免事务执行过程中花费过多磁盘IO,可以设置比较大的redo log缓存,节省磁盘IO。往磁盘上刷是有刷新的时机。达到时机就花费磁盘IO,如果buffer比较大,会更慢的达到刷新的时机,效率更快。
InnoDB修改操作数据,不是直接修改磁盘上的数据,实际只是修改Buffer Pool中的数据。InnoDB总是先把Buffer Pool中的数据改变记录到redo log中,用来进行崩溃后的数据恢复。 优先记录redo log,然后再找时机慢慢的将Buffer Pool中的脏数据刷新到磁盘上。
innodb_log_group_home_dir指定的目录下的两个文件:ib_logfile0,ib_logfile1,该文件被称作重做日志。
buffer pool缓存池:(B+树索引,自适应哈希)
作用:加速读和加速写,直接操作data page,写redo log修改就算完成,有专门的线程去做把buffer pool中的dirty page写入磁盘。
undo log回滚日志
undo log:回滚日志,保存了事务发生之前的数据的一个版本,用于事务执行时的回滚操作,同时也是实现多版本并发控制(MVCC)下读操作的关键技术。
undolog回滚日志的主要作用:
- 1.事务发生错误时侯回滚rollback,回滚日志(数据在更新的时候,把改之前的数据存下来在回滚日志中,目的是为了事务万一出错回滚了或者我们手动回滚的时候,能够把最初的数据在回滚日志中找到)
- 2.提供了MVCC的非锁定读(快照读)
边栏推荐
- Bit. Store: long bear market, stable stacking products may become the main theme
- Pyhton爬取百度文库文字写入word文档
- Mathematical derivation from perceptron to feedforward neural network
- 使用MySqlBulkLoader批量插入数据
- Data intelligence enters the "deep water area", and data governance is the key
- 现在网上买股票开户身份证信息安全吗?
- 谈谈线程安全
- What is ssr/ssg/isr? How do I host them on AWS?
- 1023 Have Fun with Numbers
- 流程判断-三目运算-for循环
猜你喜欢

爬取国家法律法规数据库

429- binary tree (108. convert the ordered array into a binary search tree, 538. convert the binary search tree into an accumulation tree, 106. construct a binary tree from the middle order and post o

A simple calculation method of vanishing point

Solution of adding st-link to Huada MCU Keil

多伦多大学博士论文 | 深度学习中的训练效率和鲁棒性

Online text batch inversion by line tool

Array exercises follow up

Bit. Store: long bear market, stable stacking products may become the main theme

Mathematical derivation from perceptron to feedforward neural network

Observable, reliable: the first shot of cloudops series Salon of cloud automation operation and maintenance
随机推荐
Photoshop-图层相关概念-LayerComp-Layers-移动旋转复制图层-复合图层
使用MySqlBulkLoader批量插入数据
GIS遥感R语言学习看这里
带你认识图数据库性能和场景测试利器LDBC SNB
Talk about graduation season
通过 Cargo 管理 Rust 项目
海底电缆探测技术总结
Determine whether a variable is an array or an object?
What is ssr/ssg/isr? How do I host them on AWS?
Error reported by Huada MCU Keil_ Weak's solution
实战回忆录:从Webshell开始突破边界
Is it safe to buy stocks online and open an account?
买股票在券商经理的开户链接上开户安全吗?求大神赐教
【bug】联想小新出现问题,你的PIN不可用。
Running lantern experiment based on stm32f103zet6 library function
什么是SSR/SSG/ISR?如何在AWS上托管它们?
A simple calculation method of vanishing point
Cdga | what is the core of digital transformation in the transportation industry?
Solution of adding st-link to Huada MCU Keil
今晚战码先锋润和赛道第2期直播丨如何参与OpenHarmony代码贡献