InnoDB中记录的物理结构

In On learning InnoDB: A journey to the core, I introduced the innodb_diagrams project to document the InnoDB internals, which provides the diagrams used in this post. Later on in A quick introduction to innodb_ruby I walked through installation and a few quick demos of the innodb_space command-line tool.

On learning InnoDB: A journey to the core中,我介绍了innodb_diagrams项目来记录InnoDB内部结构,该项目提供了本文中使用的图表。稍后在A quick introduction to innodb_ruby中,我介绍了安装和使用innodb_space命令行工具的一些快速演示。

The physical structure of InnoDB’s INDEX pages was described in The physical structure of InnoDB index pages, and the logical structure was described in B+Tree index structures in InnoDB. Now we’ll look in detail at the physical structure of records used in those pages.

InnoDB的INDEX页的物理结构在InnoDB索引页的物理结构中有所描述,逻辑结构在InnoDB中的B+树索引结构中有所描述。现在我们将详细了解这些页中使用的记录的物理结构。

In this post, only COMPACT row format (for Barracuda table format) is considered.

在本文中,仅考虑COMPACT行格式(用于Barracuda表格式)。

Record offsets

记录偏移量

In previous posts, record offsets have been described in many structures that need to “point” to records. Record offsets point to the start of the record data itself, which is variable-length, but each record is preceded by a record header, which is also variable-length. In this post and the illustrations in it, I use N to mean the start of the record, where the record data is at N and using positive offsets (e.g. N+1), and the record header uses negative offsets (e.g. N-1). InnoDB often refers to the start of the record data, location N as the “origin”.

在之前的帖子中,已经描述了许多需要“指向”记录的结构中的记录偏移量。记录偏移量指向记录数据本身的起始位置,该位置是可变长度的,但每个记录都是由记录头部(也是可变长度的)之前的。在本帖子及其中的插图中,我使用N表示记录的起始位置,其中记录数据位于N,并使用正偏移(例如N+1),而记录头部使用负偏移(例如N-1)。InnoDB通常将记录数据的起始位置称为“起点”。

The record header

记录头

In previous posts, the record header was mentioned a few times, but hasn’t been fully described. As above, the record header precedes the record itself, and is structured as follows:

在之前的帖子中,记录头已经被提到了几次,但还没有完全描述。如上所述,记录头位于记录本身之前,并且结构如下:

The fields in the record header are (in order, backwards from N):

记录头中的字段(...

开通本站会员,查看完整译文。

Home - Wiki
Copyright © 2011-2024 iteam. Current version is 2.129.0. UTC+08:00, 2024-07-05 07:55
浙ICP备14020137号-1 $Map of visitor$