什么是多版本并发控制(MVCC),谁支持它? [英] What is Multiversion Concurrency Control (MVCC) and who supports it?

查看:398
本文介绍了什么是多版本并发控制(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 8.0起),Oracle就已经拥有了出色的多版本控制系统。

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

以下内容应该有所帮助。

Following should help.


  1. 用户A在时间T1开始事务并更新具有某些值的1000行

  2. 用户B读取相同的1000行时间T2。

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

  4. 用户B到达行543,并发现正在进行一笔交易从时间T1开始操作。

  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天全站免登陆