当前位置:网站首页>MySQL中update一条record的过程
MySQL中update一条record的过程
2022-06-29 09:26:00 【一缕阳光a】
在MySQL中,update是原地更新数据,原地更新数据,原地更新数据。重要的事情说3遍。这是不同于PGSQL的。
update的具体过程是:
(1)、先对该条record对应的索引加X锁
(2)、将修改后的数据写入到redo.log中
(3)、将修改之前的数据备份到undo.log中
(4)、备份完毕,原地更新数据,修改txid,将roll_ptr指向undo.log中该条记录的备份,最后提交事务tx
(5)、提交事务tx过程中,服务器突然宕机,再次重启时,重放redo.log中的日志进行数据的修复。
如果在还未提交tx之前服务器突然宕机了,但是对应的dirty page已经flush到磁盘文件中,那么再次启机时,可以根据undo.log中的日志进行数据的恢复
边栏推荐
- Dev使用过程中的基本操作
- L2-031 go deep into the tiger's den (25 points)
- Codeforces Round #645 (Div. 2)
- The stones game
- Recyclerview sticky (suspended) head
- Codeforces Round #652 (Div. 2)
- 同花顺炒股软件可靠吗,安全吗?
- JVM method return address
- 2020-09-21 visual studio header file and Library Directory configuration
- Simulation problem of two stacks
猜你喜欢
随机推荐
C#中IEqualityComparer接口的实现
子串分值-超详细版——最后的编程挑战
指针数组、数组指针和传参的相关问题
弧形 View 和弧形 ViewPager
Talk about threads and concurrency
2019.11.20训练总结
DevExpress的双击获取单元格数据
两个栈的模拟题
Picture verification code control
acwing271【杨老师的照相排列】【线性DP】
Symphony tutorial
Codeforces Round #657 Div. 2
1146 Topological Order (25 分)
Nacos环境隔离
Judgment of points inside and outside polygon
1147 Heaps (30 分)
SymPy Tutorial(译)
We can't tell the difference between distributed and cluster. Let's tell the story of two cooks cooking
2021 team programming ladder competition - Simulation Competition
Ce projet Open source est super wow, des photos manuscrites sont générées en ligne









