Mysql的InnoDB引擎中MVCC在实际操作中有关update的问题
ringa_lee
ringa_lee 2017-04-17 11:53:24
0
1
634

《高性能mysql》这本书上说有关MVCC中update的说法是:
InnoDB会为每个需要更新的行, 建立一个新的行拷贝, 并且为新的行拷贝, 记录当前的系统版本号。 同时, 也为更新前的旧行, 记录系统的版本号, 作为旧行的删除版本标识。

那么我的问题是:
1.在执行update操作后,原有的记录不是被删除而是在数据库表中与新记录共存?
2.如果不是使用MVCC, 而是普通的update更新操作, 是否会保存原来的旧的记录, 还是在原记录上更新并保存?
求指点!

ringa_lee
ringa_lee

ringa_lee

reply all(1)
大家讲道理

1. No matter what, it is not really deleted, set the delete mark and record the transaction ID.
2. mvcc is a multi-version mechanism. It is not a question of whether you use it or not. When up, it is for the current read, and only select is a snapshot read.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!