指数如何应对 MVCC?
问候溢出者,
- 据我了解(我希望我是错的)索引的更改不能进行 MVCC。
- 我想知道大记录是否也是如此,因为副本可能很昂贵。
- 由于记录是通过索引访问的(通常),MVCC 如何有效?
- 例如,索引是否跟踪不同版本的 MVCC 记录?
最近有关于这个主题的好读物吗?真的很感激!
问候
Greetings Overflowers,
- To my understanding (and I hope I'm not right) changes to indices cannot be MVCCed.
- I'm wondering if this is also true with big records as copies can be costly.
- Since records are accessed via indices (usually), how MVCC can be effective ?
- Do, for e.g., indices keep track of different versions of MVCCed records ?
Any recent good reading on this subject ? Really appreciated !
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
索引本身可以拥有可以在返回之前修剪的记录。所以在这种情况下不能单独使用ondex来获取记录(PostGres完成的MVCC)。 InnoDB/Oracle 仅保留数据/索引的一个版本,并使用撤消部分为旧事务重建旧版本。
一般使用数据库时,您不会有太多副本,因为定期副本将被垃圾收集(在 PostGres 中),并且 Oracle/InnoDB 将具有撤消部分,当事务中止/提交时,这些部分将被重用。如果你有太多长时间运行的事务,显然你会遇到问题。
索引是为了加快访问速度,更快地找到记录,而不需要触及所有记录,索引在第一遍中不需要准确,您可能需要查看元组以查看其在某个特定事务中是否有效(就像在 PostGres 中一样)。 racle或InnoDB甚至索引都是版本化的,因此您可以从索引本身获取数据。
阅读本文详细了解两种实现 MVCC 的方法(PresGres 和Oracle/InnoDB)。
InnoDB MVCC 和 这里的评论也很有用
PS:我不是 mysql/oracle/postgres 专家内部,仍在学习事物如何运作。
Index itself can have both the records which can be pruned before returning. So in this case ondex alone can't be used to get the records (the MVCC done by PostGres). InnoDB/Oracle keeps only one version of data/index and using undo section it rebuilds the older versions for older transactions.
You wont have too many copies when DB is use in general as periodically copies will be garbage collected (In PostGres) and Oracle/InnoDB will have undo sections which will be reused when transaction is aborted/committed. If you have too many long running transaction obviously you will have problems.
Indexes are to speed up the access, find the record faster, without touch all of them, Index need not be accurate in first pass, you may need to look at tuple to see if its valid in one particular transaction or not (like in PostGres). racle or InnoDB even index is versioned so you can get data from indexes itself.
Read this to get detail idea of two ways of implementing MVCC (PresGres and Oracle/InnoDB).
InnoDB MVCC and comments here are useful too
PS: I'm not expert in mysql/oracle/postgres internal, still learning how things work.