Sbspace 结构

Sbspace 类似于 blobspace ,除了它拥有智能大对象外。

当 sbspace 在数据库创建时,它包含一个 sbspace 描述符。每个 sbspace chunk 包含以下结构:
  • Sbspace chunk 描述符
  • Chunk 可用页列表
  • Sbspace元数据区域(每个 chunk 最多一个)
  • 保留数据区域(每个 chunk 最多两个)
  • 用户数据区域(每个 chunk 最多两个)

为了获得最佳性能,建议元数据区域位于 sbspace 的中间。数据库服务器自动将元数据区域置于正确的位置。然而,要指定元数据区域的位置,请在 onspaces 命令中指定 -Mo 标志。

如果您未在 onspaces 命令的 -Ms 标志中指定元数据区域的大小,那么数据库服务器使用 AVG_LO_SIZE 的值(缺省值为 8千字节)计算元数据区域的大小、有关更多信息,请参阅 使用 -Df 选项创建 Sbspace

正常情况下,可以让系统计算元数据的大小。如果想要估计元数据区域的大小,请参阅 GBase 8s 性能指南 中的 [ 表性能注意事项 ] 一章。

图 1 图说明了 sbspace 中 chunk 的结构,它是在 sbspace 创建之后立即显示的,每个保留区域可以分配给用户数据或元数据区域。保留其总是在 chunk 的用户数据区域中。

图: 一个简单的 Sbspace Chunk


begin figure description - The figure shows a single sbspace chunk as it looks immediately after it is created. The sbspace chunk is represented by a column divided into rows or sections; the sections are labeled: header pages (pages 0 through 52 compose the chunk header), User data areas 1 and 2, Reserved areas 1 and 2, and the metadata area, which is in the middle. - end figure description

由于 图 1 图中的 chunk 是 sbspace 的一个 chunk ,所以它包含一个 sbspace 描述符。chunk 1 中的 chunk 描述符 tblspace 包含有关 chunk 1 和其后添加到 sbspace 中的所有块的信息。