分片表的结构

尽管表分片对应用程序是透明的,但作为数据库服务器管理员,您应知道数据库服务器是如何将磁盘空间分配于表分片以及数据库服务器是如何标识那些分片中的行的。

每个表分片都有自己的具有唯一 tblspace_idfragment_id 的 tblspace 。图 1 显示了驻留在相同 dbspace 的不同分区上的分片表的磁盘分配。

图: 分片表的磁盘结构


begin figure description - The figure shows two Dbspaces, Dbspace one and two. Within each Dbspace is a Tblspace; within each Tblspace are two extents, extents one and two. Each extent contains a table, and each table is fragmented into six pieces. end figure description -

连接索引

如果使用连接索引,索引和数据的分片方式是一样的。您可以决定是将索引页与相应的数据页存储在同一个 dbspace 中,还是将它们存储在不同的 dbspace 中。有关选择分片存储策略的信息,请参阅 GBase 8s 性能指南

拆离索引

对于拆离索引,表分片和索引分片都存储在不同 dbspace 的 tblspace 中。