Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
98
|
第
5
章
尽管这比直接从父节点下降遍历效率略低,并且需要访问一个额外的页,但这能保证遍
历过程的正确性,同时简化了并发访问。考虑到分裂是相对少见的操作,并且 B 树很少
收缩,因此这种情况十分罕见,其成本微不足道。这种方法有很多好处:它减少了锁竞
争,在分裂期间不用保留父节点的锁,并把在树结构变化期间持有锁的数量减少到一个
常数。更重要的是,读操作和树结构变化可以并发地进行,并防止死锁
—
并发的修改
操作在向父节点传播时可能引起死锁。
5.4
本章小结
在本章中,我们讨论了负责事务处理和恢复的存储引擎组件。在实现事务处理时,我们
面临两个问题:
•
为了提高效率,我们要允许事务并发执行。
•
为了保持正确性,我们要确保并发执行的事务遵守 ACID 性质。
并发事务执行可能导致多种读异常和写异常。隔离级别描述并限制了这些异常是否可以
出现。并发控制机制决定了事务如何被调度和执行。
页缓存负责减少磁盘访问的次数:它将页缓存在内存中,并允许对其进行读写访问。当
缓存达到容量时,页将被换出并刷写回磁盘。为了确保节点崩溃时不会丢失未落盘的更
改,以及为了支持事务回滚,我们会记录预写日志。页缓存和预写日志使用 force 和 steal
策略进行协调,确保在不失持久性的前提下,每个事务可以高效执行并且能够回滚。
更多阅读
如果你想了解更多有关本章中提到的概念的内容,可以参考以下资源:
事务处理和恢复
Weikum, Gerhard, and Gottfried Vossen. 2001.
Transactional Information ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787111655169