Skip to Content
数据库系统内幕
book

数据库系统内幕

by Alex Petrov
May 2020
Beginner to intermediate
319 pages
7h 3m
Chinese
China Machine Press
Content preview from 数据库系统内幕
B
树的变体
|
113
缓存无关算法允许我们以两层存储模型对数据结构进行推断,同时具备多级层次结构模
型的优点。这种方法可以没有特定平台的参数,但是仍保证了层次结构的两个级别之间
的传输数量在一个常数内。如果数据结构专门为在任何双层存储层次结构中最优化运行
进行了优化,则它也可以在任何两个
相邻
存储层次结构上最优化运行。这是通过尽可能
地在最高缓存层下进行工作来实现的。
van Emde Boas
布局
一个缓存无关 B 树由一个静态 B 树和一个打包的数组结构组成 [BENDER05]。静态 B
树使用
van Emde Boas
布局构建。它在中间层的边上将树分裂开,然后以类似的方式递
归分裂每个子树,最后得到大小为 sqr(N) 的子树。这种布局的关键思想是,任何递归
树都存储在一个连续内存块中。
图 6-8 是一个 van Emde Boas 布局的例子,其中逻辑上分组在一起的节点紧密地放置在
一起。在顶部,你可以看到逻辑上的布局表示(即节点如何形成树),而在底部,你可以
看到树节点如何在内存和磁盘上布局。
逻辑布局
物理布局
图
6-8
:
van Emde Boas
布局
为了使数据结构动态化(即允许插入、更新和删除),缓存无关树使用
打包数组
(packed
array)数据结构,该数据结构使用连续的内存段来存储元素,但为将来插入的元素保留
间隙。间隙之间的间隔基于
密度阈值
(density threshold)。 图 6-9 展示了一个打包数组结
构,其中元素被间隔开以产生间隙。
图
6-9
:打包数组
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