> 文章列表 > 2023-04-13 monetdb-str类型变长存储-分析

2023-04-13 monetdb-str类型变长存储-分析

2023-04-13 monetdb-str类型变长存储-分析

摘要:

monetdb的列的基本抽象是BAT,但是对于列数据的存储方式, 对于固定长度和不固定长度,使用了不同的存储方式。

固定长度的数据比如int,int64之类的, 直接存储在了数据tail文件

但是对于不固定长度比如string, 则使用另外一个独立的theap文件存储, tail文件仅保留对于threap的文件的偏移。

本文对str数据类型的存储进行详细的分析

BAT中的数据存储方式说明

Design Overview | MonetDB Docs

https://github.com/MonetDB/MonetDB/blob/master/gdk/gdk.h#L583

The above figure shows what a BAT looks like. It consists of two
columns, called head and tail, such that we have always binary
tuples (BUNs). The overlooking structure is the @strong{BAT
record}.  It points to a heap structure called the @strong{BUN
h