【CMU15-445 Part-5】Buffer Pools

Part05-Buffer Pools

Bifurcated Environment

“分叉”,OLTP和OLAP的DB是分离的。OLTP Data Silos(孤岛),相互独立的数据存储区,ETL(Extract Transform Load)操作:将业务系统的数据经过抽取、清洗、转换之后加载到数据仓库的过程。最后OLAP push to the frontend

image-20220927141434018

如何把磁盘中的数据库文件或者Page放到内存里面?

DB不可以在磁盘上对数据进行操作

Buffer Pool Manager

also called Buffer Cache

缓冲池是一段内存,是由数据库系统控制的而不是操作系统分配控制的。 Buffer Pool分frame,页框/帧。

当发出一个请求页

  • 查看Buffer Pool里面是否存在这个Page
    • 如果不存在 从磁盘中copy,放到内存
    • 如果存在 读

Buffer Pool的Page顺序和磁盘的Page顺序并不一致,需要额外indirection层来find某个特定的page 在哪个frame。即Page Table

Page Table

  1. 记录内存中有哪些page
  2. 根据page id找到特定page

BufferPool Meta-Data

image-20221025133710859

Locks VS. Latches

image-20221025133746547

Page Directory VS. Page Table

image-20221025133830881

Allocation Polices

image-20221025133941731

Buffer Pool Optimizations

Multiple Buffer Pools

image-20221025134045089

Pre-Fectching

image-20221025134107917

Scan Sharing

扫描共享

image-20221025134202074 image-20221025134218262

BufferPool Bypass

image-20221025134243444

OS Page Cache

image-20221025134304779

Buffer Replacement Policies

Goals

image-20221025134339124

LRU&CLOCK&LRU-K

image-20221025134407628

Localization & Priority Hints

image-20221025134459730

Dirty Pages

image-20221025134519076

猜你喜欢

转载自blog.csdn.net/qq_47865838/article/details/127511918
今日推荐