Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
B
树的变体
|
109
得不额外传输一些空字节以及页的其余部分。第三个问题是解决并发问题和处理闩锁的
复杂性。
为了同时解决这三个问题,我们必须采取一种与目前已经讨论过的方法完全不同的方
法。缓冲更新有助于减轻写放大和空间放大问题,但不能解决并发问题。
我们可以通过使用仅追加存储来对不同节点进行批量更新,将节点链接成链,并使用
内存数据结构
—
该结构允许通过单个 CAS 操作在节点之间
建立
指针,从而使树无锁。
这种方法称为 Buzzword 树(Bw 树) [LEVANDOSKI14]。
6.5.1
更新链
Bw 树区分
基节点
的写入与修改。修改(
增量节点
)形成一个链:一个从最新修改到旧修
改的链表,该链表末尾则是
基节点
(base node)。每个更新都可以单独存储,而不需要
重写磁盘上的现有节点。
增量节点
(delta node)可以表示插入、(与插入无法区分的)更
新或删除。
由于基节点和增量节点的大小不太可能是页对齐的,所以将它们连续存储是有意义的,
而且由于在更新期间基节点和增量节点都不会被修改(所有修改只是将一个节点插入现
有链表头部),所以我们不需要预留任何额外的空间。
将节点作为逻辑实体而不是物理实体是一种有趣的范式转变:我们不需要预先分配空间,
不需要节点具有固定的大小,甚至不需要将它们保持在连续的内存段中。这当然有一个
缺点:在读取过程中,必须遍历所有增量并将其应用到基节点上,以重建实际的节点状
态。这有点类似于 LA 树所做的事情(参见 6.3.2 节):更新与主结构分开存放,并在读
取时重放。
6.5.2 ...
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