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. (Note that each image below is linked to a higher resolution version of the same image.)

On learning InnoDB: A journey to the core中,我介绍了innodb_diagrams项目来记录InnoDB内部结构,该项目提供了本文中使用的图表。(请注意,下面的每个图像都链接到相同图像的更高分辨率版本。)

The basic structure of the space and each page was described in The basics of InnoDB space file layout, so now we’ll expand on that to describe InnoDB’s structures related to management of pages and extents, and “free space” management, and how it tracks pages allocated to the many different purposes for which pages are used.

空间和每个页面的基本结构在InnoDB空间文件布局基础知识中已经描述过,现在我们将进一步描述InnoDB与页面和范围管理相关的结构,以及“空闲空间”管理,以及它如何跟踪分配给页面的许多不同用途。

Extents and extent descriptors

范围和范围描述符

As described previously, InnoDB pages are normally 16 KiB, and are grouped into 1 MiB blocks of 64 contiguous pages, which is called an “extent”. InnoDB allocates FSP_HDR and XDES pages at fixed locations within the space, to keep track of which extents are in use, and which pages within each extent are in use. These pages have a pretty simple structure:

如前所述,InnoDB页面通常为16 KiB,并且分组为64个连续页面的1 MiB块,称为“范围”。InnoDB在空间内的固定位置分配FSP_HDR和XDES页面,以跟踪哪些范围正在使用以及每个范围内的哪些页面正在使用。这些页面具有相当简单的结构:

They contain the usual FIL header and trailer, an FSP header (discussed a bit later), and 256 “extent descriptors” or just “descriptors”. They also contain a sizable amount of unused space.

它们包含通常的FIL头和尾部,一个FSP头(稍后讨论),以及256个“extent描述符”或仅称为“描述符”。它们还包含相当数量的未使用空间。

Extent descriptors have the following structure:

范围描述符具有以下结构:

The purpose of the various fields in an extent descriptor are:

范围描述符中各个字段的目的是:

  • File Segment ID: The ID of the file segment to which the extent belongs, if it belongs to a file segment.
  • 文件段ID:如果范围属于文件段,则为该范围所属的文件段的ID。
  • List node for XDES list: Pointers to previous and next extents in a doubly-linked extent descriptor list.
  • XDES列表的列表节点:指向双向链接的范围描述符列表中的前一个和后一个范围。
  • State: The current state of the ext...
开通本站会员,查看完整译文。

Home - Wiki
Copyright © 2011-2024 iteam. Current version is 2.139.0. UTC+08:00, 2024-12-22 23:38
浙ICP备14020137号-1 $Map of visitor$