当前位置:网站首页>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中的日志进行数据的恢复
边栏推荐
猜你喜欢
随机推荐
Power strings [KMP cycle section]
Setinterval, setTimeout and requestanimationframe
To 3 --- 最后的编程挑战
两个栈的模拟题
SymPy Tutorial(译)
HDU 6778 car (group enumeration -- > shape pressure DP)
完全二叉树的权值 递归做法 ——最后的编程挑战
2019.11.3学习总结
2019.11.17训练总结
Dynamic linking of virtual machine stack of JVM
Signal works: time varying and time invariant
L2-031 go deep into the tiger's den (25 points)
This open source project is super wow, and handwritten photos are generated Online
Codeforces Round #652 (Div. 2)
L1-009 N个数求和 (20 分)
任务调度器之Azkaban的使用
2021 team programming ladder competition - Simulation Competition
函数指针、函数指针数组、计算器+转移表等归纳总结
To 3 -- the last programming challenge
Codeforces - 1151b thinking








