MVCC 详解
2023-02-05 21:03:02 4 举报
MYSQL MVCC 机制
作者其他创作
大纲/内容
begin
trx_id : 1001trx_ids: []up_limit_id:1001low_limit_id:1001creator_trx_id = 1001trx_id = creator_trx_id可见: 蚩尤
select name from person;
创建 ReadViewtrx_id : 1000trx_ids: []up_limit_id:1001low_limit_id:1001trx_id < up_limit_id可见: 黄帝
创建 ReadViewtrx_id : 1001trx_ids: []up_limit_id:1001low_limit_id:1001creator_trx_id = 1001trx_id = creator_trx_id可见: 蚩尤
commit;
创建ReadViewtrx_id : 1001trx_ids: [1001]up_limit_id:1001low_limit_id:1002font color=\"#ff0000\
Read Committed 读已提交
id | name | age | position | DB_TRX_ID | DB_ROLL_PTR | DB_ROW_ID 1 | 黄帝 | 789 | Leader | 1000 | 0x13251345 | ————
事务1001
update 后的数据
id | name | age | position | DB_TRX_ID | DB_ROLL_PTR | DB_ROW_ID 1 | 蚩尤 | 789 | Leader | 1000 | 0x24459715 | ————
trx_id : 1001trx_ids: []up_limit_id:1001low_limit_id:1001font color=\"#ff0000\
数据
创建 Read Viewtrx_id : 1001trx_ids: []up_limit_id:1002low_limit_id:1002trx_id < up_limit_id可见: 蚩尤
Read Repeatable 可重复读
事务
update person set name='蚩尤' where id = 1;
创建ReadViewtrx_id : 1001trx_ids: []up_limit_id:1002low_limit_id:1002trx_id < up_limit_id 可见: 蚩尤
指向redo log 的版本链数据,用于回滚和版本查找
原始数据update 后放入redo log 里
0 条评论
下一页
为你推荐
查看更多