数据库:什么是多版本并行控制(MVCC)和谁支持它? [英] Database: What is Multiversion Concurrency Control (MVCC) and who supports it?

查看:307
本文介绍了数据库:什么是多版本并行控制(MVCC)和谁支持它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,Jeff曾经张贴了有关与阅读相关的数据库死锁的问题。 多版本并发控制(MVCC)声称可解决此问题。

Recently Jeff has posted regarding his trouble with database deadlocks related to reading. Multiversion Concurrency Control (MVCC) claims to solve this problem. What is it, and what databases support it?

更新:这些支持它(其他人?)

updated: these support it (which others?)


  • oracle

  • postgresql

推荐答案

Oracle已经有一个非常好的多版本控制系统(至少从oracle 8.0开始)

Oracle has had an excellent multi version control system in place since very long(at least since oracle 8.0)

以下应该有帮助。


  1. 用户A开始一个事务,并且在时间T1更新了1000行。

  2. 用户B读取相同的1000行

  3. 用户A更新行543,值为Y(原始值X)

  4. 用户B到达行543,

  5. 数据库从日志中返回未修改的记录。返回的值是小于或等于T2时提交的值。

  6. 如果无法从重做日志中检索到记录,则表示数据库未正确设置。需要为日志分配更多空间。

  7. 以这种方式实现读取一致性。返回的结果对于事务的开始时间总是相同的。因此,在一个事务中,读取的一致性是可以实现的。

  1. User A starts a transaction and is updating 1000 rows with some value At Time T1
  2. User B reads the same 1000 rows at time T2.
  3. User A updates row 543 with value Y (original value X)
  4. User B reaches row 543 and finds that a transaction is in operation since Time T1.
  5. The database returns the unmodified record from the Logs. The returned value is the value that was committed at the time less than or equal to T2.
  6. If the record could not be retreived from the redo logs it means the database is not setup appropriately. There needs to be more space allocated to the logs.
  7. This way the read consitency is achieved. The returned results are always the same with respect to the start time of transaction. So within a transaction the read consistency is achieved.



我尝试用最简单的术语解释...有很多到数据库中的多元化。

I have tried to explain in the simplest terms possible...there is a lot to multiversioning in databases.

这篇关于数据库:什么是多版本并行控制(MVCC)和谁支持它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆