CMU15445 Lecture 19: Multi-Version Concurrency Control

MVCC不是单纯的用来实现并发控制,一般是用来与2PL,OCC,T/O结合使用

Multi-Version Concurrency Control

read-only txn can read a consistent snapshot without acquiring locks?txn可以做到像是全程在读一个静态的数据库

这里只依赖mvcc,达不到serializable,得去和2PL之类的结合,才能达到serializable
这里还不是serializable,为什么要等待?mvcc可以解决写与读之间的阻塞,但是写与写之间的阻塞需要等待?这里应该是一种当前读当前读就是锁

Concurrency Control Protocol

Version Storage

既然能够遍历查找,那么为什么不能能够建立,上面T2的问题?

Append-Only Storage

oldest-to-newest:不需要更新索引,但是需要遍历查找最version
newest-to-oldest:需要更新索引,但是不需要遍历查找

Time-Travel Storage

time-travel table

delta storage segment

Garbage Collection

不能够无限的存储历史版本,删除历史版本需要处理的问题:

  • 怎样去找到需要删除的历史版本
  • 如何决定什么什么时候去删除历史版本

Tuple-level

Background Vacuuming


优化版本,只对dirty的page做scan

Cooperative Cleaning

index查找时顺便清除历史版本,但是只适合O2N chain

Transaction-level GC

Index Management



secondary index 指向 physical address

secondary index 指向 primary index

secondary index 指向 tuple id的indirect layer

MVCC index


mvcc需要存储duplicate key?

由于mvcc必须存储duplicate key,那么对于unique constraint需要额外的处理

MVCC DELETES

posted @ 2022-03-10 12:07  抿了抿嘴丶  阅读(81)  评论(0编辑  收藏  举报