Search CTRL + K

Transactional Storage Manager

存储管理器(storage manager) 负责管理数据库文件,它将一组 组织为文件,有的 数据库管理系统 使用文件层次结构,有的使用单一文件(比如 SQLite)。

也有非文件形式

1980 年代早期 数据库管理系统 在裸块设备上使用自建文件系统。直到今天还有部分企业级 数据库管理系统 支持这种方式。[1]

通常 DBMS 不负责管理 的复本

数据复本通常在存储管理器的上下层实现。

文件存储

不同 数据库管理系统 使用不同文件存储方式去组织

Heap File

heap file 是一组无序 元组 的集合,它将元组以任意顺序存储到文件中。

对于单文件 heap file,可以直接通过 id 拿到偏移量,访问对应

对于多文件 heap file,系统维护特殊的目录 记录其他数据 所在路径。需要保证目录 的目录信息和数据 同步。同时,目录 还记录其他可用空间的元信息:

File Storage

In its most basic form, a DBMS stores a database as files on disk. Some may use a file hierarchy, others may use a single file (e.g., SQLite).[2]

What is the responsibility of storage manager?

The DBMS’s storage manager is responsible for managing a database’s files. It represents the files as a collection of pages. It also keeps track of what data has been read and written to pages as well how much free space there is in these pages.[2:1]

What is heap file?

There are a couple of ways to find the location of the page a DBMS wants on the disk, and heap file organization is one of those ways. A heap file is an unordered collection of pages where tuples are stored in random order.[2:2]


  1. https://15445.courses.cs.cmu.edu/fall2023/slides/03-storage1.pdf ↩︎

  2. https://15445.courses.cs.cmu.edu/fall2023/notes/03-storage1.pdf ↩︎ ↩︎ ↩︎