当前位置:网站首页>MySQL:redo log日志——笔记自用
MySQL:redo log日志——笔记自用
2022-08-09 04:13:00 【_索伦】
前言
事务的ACD特性(原子性、一致性、持久性),都是依靠undo log和redo log日志保证的,redo log 并不是事务commit了才记录,而是begin开始后就记录。
redo log
redo log:重做日志,用于记录事务操作的变化,确保事务的持久性。redo log是在事务开始后就开始记录,不管事务是否提交都会记录下来,在异常发生时(如数据持久化过程中掉电),InnoDB会使用redo log恢复到掉电前的时刻,保证数据的完整性。
innodb_log_buffer_size默认是16M,就是redo log缓冲区的大小,它随着事务开始,就开始写redo
log,如果事务比较大,为了避免事务执行过程中花费过多磁盘IO,可以设置比较大的redo log缓存,节省磁盘IO。
InnoDB修改操作数据,不是直接修改磁盘上的数据,实际只是修改Buffer Pool中的数据。InnoDB总是先把Buffer Pool中的数据改变记录到redo log中,用来进行崩溃后的数据恢复。 优先记录redo log,然后再慢慢的将Buffer Pool中的脏数据刷新到磁盘上。
innodb_log_group_home_dir指定的目录下的两个文件:ib_logfile0,ib_logfile1,该文件被称作重做
日志。
buffer pool缓存池:
作用:加速读和加速写,直接操作data page,写redo log修改就算完成,有专门的线程去做把buffer
pool中的dirty page写入磁盘。
边栏推荐
- 荣耀路由(WS831)做无线中继时LAN网段与WAN网段冲突解决方法
- [Server data recovery] A case of data recovery when the Ext4 file system cannot be mounted and an error is reported after fsck
- driftingblues靶机wp
- Grid 布局介绍
- 月报总结|Moonbeam 7月份大事一览
- 5.索引优化实战
- 了解CV和RoboMaster视觉组(五)统计特征和global-based方法
- 2022年起重机司机(限桥式起重机)考试题库及模拟考试
- Query the size of the total points obtained in a certain time period to sort
- gopacket源码分析
猜你喜欢
随机推荐
How to resolve the conflict between LAN segment and WAN segment when Honor router (WS831) is used as wireless relay
A few words about Microsoft's 2022/2023 autumn recruits
MySql.Data.MySqlClient.DBNull
Talking about the process and how to create it
NanoDet代码逐行精读与修改(五.1)检测头的构造和前向传播
【21 基础纹理(二、凹凸映射的理论)】
33 基本统计知识——单项非参数检验
给一时兴起想要学习 “ 测试 ” 的同学的几条建议.....
[Graphics] 19 Lighting model (four, Blinn-Phong lighting model)
记录一次腾讯实习投递经历(一)
leetcode 5724. 绝对差值和
Moonriver与Shiden的XCM集成现已上线
H264之sps解析分辨率
[Server data recovery] A case of data recovery when the Ext4 file system cannot be mounted and an error is reported after fsck
Query the size of the total points obtained in a certain time period to sort
医学影像分割系统综述Data preparation for artificial intelligence in medical imaging: A comprehensive guide ...
leetcode 1805. 字符串中不同整数的数目
From brute force recursion to dynamic programming leetcode Question 62: Different paths
MKNetworkKit replacing domain name wrong solution
【服务器数据恢复】Ext4文件系统fsck后mount不上并报错的数据修复案例