InnoDB data page storage Shi Hongbao

Time:2020-10-22

1、 Introduction

  1. MySQL is the most popular relational database management system, which has the advantages of small size, fast speed and open source. InnoDB is the most widely used storage engine in MySQL. InnoDB designs row locks, supports mvcc, and provides consistent non lock reads. Learning InnoDB data page storage can help us understand some features of InnoDB more deeply.
  2. Program = data structure + algorithm, which is also true for MySQL. Due to the need for data persistence, MySQL data is not only stored in memory, but also persisted to files. The storage structure is shown in the figure below,

InnoDB data page storage Shi Hongbao

  • From the disk, we can easily see the persistent files.
  • The files in the disk need to be loaded into the memory to be used by the program. Obviously, it is impossible to load all the disk files into the memory. When the data in the memory changes, it is also necessary to refresh them to the disk files. When to refresh and how to refresh are the issues that MySQL needs to consider. However, these contents are not the focus of this article. We can learn a little about them here.
  • This paper focuses on the storage of data pages, which may exist with system table space, independent table space or temporary table space. As you can see, these are just a small part of the picture.
  1. Before learning, let’s consider a few questions,
  • Both memory storage and disk storage are inseparable from memory management. How does InnoDB divide and manage memory?
  • InnoDB uses B + tree to store the data in our table. What data should be stored by B + tree index node and leaf node? And how?
  • When we use it, we create a database and data table. How are these metadata stored? When querying a table, how to find the index of the table according to the metadata? How to select the index? After selecting the index, how to locate the root page of the index? After finding the following node, how to find a specific data step by step?
  1. explain
  • MySQL version: 8.0.12-debug
  • The storage engine uses InnoDB
  • We will use the XXD command, and use XXD (or hexdump) to view files in hexadecimal mode.

2、 InnoDB storage structure

The storage structure of InnoDB is shown below. We will only give a brief introduction here. We will elaborate on more details in the following articles,

InnoDB data page storage Shi Hongbao

  1. The table space can be considered as the highest level of storage structure of InnoDB storage engine. All data is in the table space. In addition to the shared table space, each table can create an independent table space. The specific parameter is InnoDB_ file_ per_ The table parameter determines that the table space consists of various segments.
  2. Common segments include data segment, rollback segment and index segment. The data segment in InnoDB is the leaf node of B + tree, and the index segment is the non leaf node of B + tree.
  3. A segment is composed of an extent. By default, the size of the zone is 1MB, and the default page size of InnoDB is 16kb. Therefore, an area is composed of 16 consecutive pages.
  4. The default page size of InnoDB is 16kb, which can also be accessed through InnoDB_ page_ Size.
  5. InnoDB storage is row oriented. The storage formats of rows are compact, redundant, compressed and dynamic.

3、 Data page storage

3.1 independent table space

Through InnoDB_ file_ per_ For the table parameter, we can create a table space for each table. This is the independent table space of the table. The index segments and data segments of the table will be stored in the independent table space, but redo log and undo log are still in their respective table spaces. The table space storage is shown in the following figure,

InnoDB data page storage Shi Hongbao

  1. Page 0 of the table space is the first page of the table space, which stores the information of the table space and is also used to manage the first 256 extents. Page 16384 type is fil_ PAGE_ TYPE_ Xdes is also used to manage the next 256 extents, and so on, every 16384 pages need a fil_ PAGE_ TYPE_ Xdes page.
  2. Page 1 type is fil_ PAGE_ IBUF_ Bitmap is used to manage the change buffer of each page (16384 pages of the first 256 extensions). And fil_ PAGE_ TYPE_ Similar to xdes, a fil is required every 16384 pages_ PAGE_ IBUF_ Bitmap page.
  3. Page 2 type is fil_ PAGE_ Inode, used to manage segments.
  4. Page 3 type is fil_ PAGE_ SDI, which stores serialized dictionary information (SDI), stores some data dictionary information of this table space.
  5. Page 4 is usually the root page of the primary key index of this table.

3.2 page storage

The page storage structure of InnoDB is as follows. Each page is composed of three parts: file header (38 bytes), file body and file Trailer (8 bytes). The contents stored in file body of different pages are different,

InnoDB data page storage Shi Hongbao

  1. File Header
name size explain
FIL_PAGE_SPACE_OR_CHKSUM 4 bytes Page check code
FIL_PAGE_OFFSET 4 bytes The cheapness of pages in a table space
FIL_PAGE_PREV 4 bytes previous page
FIL_PAGE_NEXT 4 bytes next page
FIL_PAGE_LSN 8 bytes The log sequence position when the page was last modified
FIL_PAGE_TYPE 2 bytes Page type
FIL_PAGE_FILE_FLUSH_LSN 8 bytes There is a definition in the system table space, which represents the LSN to which the file is updated
FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID 4 bytes Table space ID of the page
  1. File Type
name value explain
FIL_PAGE_TYPE_ALLOCATED 0x0000 not used
FIL_PAGE_UNDO_LOG 0x0002 undo log
FIL_PAGE_INODE 0x0003 Segment information is stored
FIL_PAGE_IBUF_FREE_LIST 0x0004 Insert buffer free list
FIL_PAGE_IBUF_BITMAP 0x0005 Insert buffer bitmap
FIL_PAGE_TYPE_SYS 0x0006 System page
FIL_PAGE_TYPE_TRX_SYS 0x0007 Transaction system data
FIL_PAGE_TYPE_FSP_HDR 0x0008 Table space header information
FIL_PAGE_TYPE_XDES 0x0009 Extended description page
FIL_PAGE_TYPE_BLOB 0x000A Blob page
FIL_PAGE_SDI 0x45bd SDI index page
FIL_PAGE_RTREE 0x45be R-tree
FIL_PAGE_INDEX 0x45bf B-tree

3.3 data page

After looking at the InnoDB page structure, let’s look at the storage of data pages,

InnoDB data page storage Shi Hongbao

  1. Page Header
name size explain
PAGE_N_DIR_SLOTS 2 bytes Number of slots in page directory
PAGE_HEAP_TOP 2 bytes The first record pointer in the heap
PAGE_N_HEAP 2 bytes Number of records in the heap
PAGE_FREE 2 bytes Point to free space first address
PAGE_GARBAGE 2 bytes Number of records deleted
PAGE_LAST_INSERT 2 bytes Last insertion position
PAGE_DIRECTION 2 bytes Last insertion direction
PAGE_N_DIRECTION 2 bytes Number of consecutive records inserted in one insertion direction
PAGE_N_RECS 2 bytes The total number of records on this page
PAGE_MAX_TRX_ID 8 bytes Modify the maximum transaction ID of the current page
PAGE_LEVEL 2 bytes The layer of the current page in the index. The leaf node is 0x00
PAGE_INDEX_ID 8 bytes INDEX ID
PAGE_BTR_SEG_LEAF 10 bytes The non leaf node segment is defined only in the root page of the B + tree
PAGE_BTR_SEG_TOP 10 bytes The segment of the data page is only defined in the root page of the B + tree
  1. Infimun & Supermum

Virtual record, infimum is 13 bytes, and supermum is also 13 bytes. We will introduce the specific storage content below.

  1. Page Directory
  • Page directory, because row records are linked in the form of a linked list in the data page, but when looking for records, the linked list search speed is very slow. In order to speed up the record search, create a page directory, and the page directory can be used for binary search.Each directory entry takes 2 bytes, starting from the end of the page and stored in reverse order.
  • In order to understand the page directory easily, let’s take an example. If 200 pieces of data are stored in the table, and the data is linked through the linked list, we need to traverse the whole linked list to find the data when querying, which is undoubtedly slow. We can speed up the search by building an index. We can store the primary keys of these 200 records in order. The page directory of InnoDB is the same idea. However, it does not store the value of the primary key, but stores the location of the corresponding records. Not every row record is stored in the page directory, but a sparse index is established.

3.4 InnoDB row storage

Limited to space, we mainly introduce the row record storage in compact format. The storage format is shown in the figure below,

InnoDB data page storage Shi Hongbao

  1. As can be seen from the figure, each record row occupies at least 5 bytes (record header) + primary key length + 6 bytes (transaction ID) + 7 bytes (rollback pointer)
  2. We need to pay attention to the next in the record header_ Record field, which occupies 16 bits, that is, 2 bytes. Through this field, InnoDB links all records in a page together in a linked list.

4、 Example explanation

In this part, we give some examples for your understanding,

  1. This section gives an example of how a table in InnoDB is stored. It mainly introduces two situations: one is that there is little data in the table; the other is that there is too much data in the table and one page cannot be stored.
  2. Table structure definition,
create table `t` (`id` int not null, primary key(`id`)) engine=InnoDB ROW_FORMAT=Compact;
  • To make it easier to understand, we have only created a very simple table and only one primary key index. The primary key type is int and takes 4 bytes.
  • After creating the table, you can see the t.ibd file in the corresponding directory. Here, I created the table in the test database, so it is in the test directory.
  • From the disk file, we can see that the size of the t.ibd file is 112kb, that is, 7 * 16kb, that is, 7 pages, which means that InnoDB initializes 7 pages by default after the table is created.
  • There is no variable length field in our table. The length of the primary key is 4 bytes, so the length of a single record is 5 (record header) + 4 (primary key ID) + 6 (transaction ID) + 7 (rollback pointer) = 22 bytes
  1. Example of B + tree

InnoDB data storage is organized through a B + tree. A very simple B + tree is shown below,

InnoDB data page storage Shi Hongbao

  • There are many properties of B + tree. The operation of adding, deleting, querying and modifying is more complex than the conventional binary tree. If you are interested, you can query relevant information. Here is a basic concept.
  1. If there is no special explanation, the first page of the table space is page 0, the second page is page 1, and so on.

4.1 single page storage

Let’s first look at how the data is organized when there is little data in the table. The specific operation steps are as follows,

  1. We insert two records into the table,
insert into t values (2);
insert into t values (1);
  • Note here that we first insert the row record with the primary key value of 2, and then insert the row record with the primary key value of 1.
  1. T.ibd is represented in hexadecimal by XXD. Execute the command XXD t.idb t.txt, or view it with the hexdump command.
  2. Look at the contents in t.txt. Here we will seepage 4Data for
0010000: a76e 6043 0000 0004 ffff ffff ffff ffff  .n`C............
0010010: 0000 0000 012e 6d9d 45bf 0000 0000 0000  ......m.E.......
0010020: 0000 0000 0005 0002 00a4 8004 0000 0000  ................
0010030: 0093 0001 0001 0002 0000 0000 0000 0000  ................
0010040: 0000 0000 0000 0000 0091 0000 0005 0000  ................
0010050: 0002 0272 0000 0005 0000 0002 01b2 0100  ...r............
0010060: 0200 3069 6e66 696d 756d 0003 000b 0000  ..0infimum......
0010070: 7375 7072 656d 756d 0000 10ff f380 0000  supremum........
0010080: 0200 0000 001c 0481 0000 00fa 0110 0000  ................
0010090: 18ff ea80 0000 0100 0000 001c 0582 0000  ................
00100a0: 012c 0110 0000 0000 0000 0000 0000 0000  .,..............
00100b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
......
......
0013fe0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0013ff0: 0000 0000 0070 0063 a76e 6043 012e 6d9d  .....p.c.n`C..m.
  • The first 38 bytes are the file header [00100000010026]
  • The next 56 bytes are the data page header [0010027001005d]
  • The next 26 bytes are the minimum record [001005e, 001006a] and the maximum record [001006b, 0010077]. Here we can see the n of the minimum record_ Owns value is 1 (only one record of its own), and the maximum record n_ Owns value is 3 (in addition to itself, there are two records we inserted)
  • This is followed by the first inserted record [0010078, 001008d]
0010070: .... .... .... .... 0000 10ff f380 0000
0010080: 0200 0000 001c 0481 0000 00fa 0110 ....
  • Finally, the second record just inserted [001008e, 00100a3]
  • For int type, InnoDB storage mode is different from the conventional mode, [0x00000000, 0x7fffffff] represents [- 2147483648, – 1], and [0x80000000, 0xFFFFFFFF] represents [0, 21473647].
  1. The storage structure is shown in the figure below

InnoDB data page storage Shi Hongbao

  1. Here is an example of how to find the largest record from the smallest record
  • Firstly, the position of the minimum record is located. The minimum record occupies 5 bytes (record header) + 8 bytes (content) = 13 bytes. The position of the minimum record is 001005e. According to the record header information of the minimum record, the next record position 001005e + 0030 = 001008e can be calculated
  • 001008e is the location of the record with the primary key of 1, and then calculate the position of the next record 001008e + FFEA = 0010078. It should be noted here that in addition operation, only the results of the last four bits are retained. It can be seen that this position is the record with primary key 2 inserted for the first time
  • After that, continue to calculate the location of the next record, 0010078 + fff3 = 1006b, which is the location of the largest record
  • When looking for a specific row record, the page directory can be used for approximate binary search, and then the linked list search can be carried out.
  1. page directory
  • There are two slots at the end of the page
0013ff0: 0000 0000 0070 0063 .... .... .... ....
  • 0063 is the location of the first slot, and the corresponding record location is 0010063, which is the minimum record. [001005e, 0010062] this is the record header of the minimum record, [0010063, 001006a] is the content of the minimum record.
  • 0070 is the location of the second slot, and the corresponding record location is 0010070, which is the starting position of the content where the largest record is located.
  1. Summary
  • You can see that from the minimum record to the end of the maximum record, the data is linked in the form of a linked list according to the order of the primary key.
  • Row data is stored in the order of insertion, not in the order of primary key. After the data is deleted, the space released can be reused. The details of the reuse part will be introduced in detail in the following article.

4.2 multi page storage

On the basis of 4.1, we continue to insert data. The operation steps are as follows,

  1. We continue to insert data into the table through the script
<?php
$servername = "localhost:8083";
$username = "root";
$password = "password";
$dbname = "test";

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    for($i = 3; $i < 1000; $i++){
        $sql = "INSERT INTO t VALUES (" . strval($i) . ")";
        $conn->exec($sql);
    }
}
catch(PDOException $e){
    echo $sql . "<br>" . $e->getMessage();
}
$conn = null;
?>
  • Two records have been inserted into the table before, and 997 records have been inserted here, so there are now 999 records in the table, and the primary key ID ranges from 1 to 999.
  • A single record needs to occupy 22 bytes. You can know that at this time, a single data page cannot store all the data.
  1. View the t.ibd file in hexadecimal: XXD t.ibd t.txt
  2. To view the contents of t.txt, first viewpage 4Content of
0010000: df67 193d 0000 0004 ffff ffff ffff ffff  .g.=............
0010010: 0000 0000 0132 5500 45bf 0000 0000 0000  .....2U.E.......
0010020: 0000 0000 0005 0002 0092 8004 0000 0000  ................
0010030: 008a 0002 0001 0002 0000 0000 0000 0000  ................
0010040: 0001 0000 0000 0000 0091 0000 0005 0000  ................
0010050: 0002 0272 0000 0005 0000 0002 01b2 0100  ...r............
0010060: 0200 1a69 6e66 696d 756d 0003 000b 0000  ...infimum......
0010070: 7375 7072 656d 756d 1000 1100 0d80 0000  supremum........
0010080: 0100 0000 0500 0019 ffe6 8000 0153 0000  .............S..
0010090: 0006 0000 0000 0000 0000 0000 0000 0000  ................
.......
.......
0013fe0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0013ff0: 0000 0000 0070 0063 df67 193d 0132 5500  .....p.c.g.=.2U.
  • As you can see, there is only a small amount of content on page 5, because page 5 is the index page and the root of the B + tree. No specific data is stored, only the primary key index is stored.
  • File header, page header, infimum & Supreme are basically similar to the previous ones, so we will not introduce them in detail here.
  • A single index needs 5 bytes (record header) + 4 bytes (primary key) + 4 bytes (record page) = 13 bytes.
  • First index information
0010070: .... .... .... .... 1000 1100 0d80 0000
0010080: 0100 0000 05.. .... .... .... .... ....

The primary key ID is 0x80000001, that is, 1, and page no is 0x00000005page 5

  • Second index information
0010080: .... .... ..00 0019 ffe6 8000 0153 0000
0010090: 0006 .... .... .... .... .... .... ....

The primary key ID is 0x80000153, that is, 339, and page no is 0x00000006page 6

  • From these two index information, we can know that,page 5It stores data with primary key ID from 1 to 338,page 6It stores data with primary key ID from 339 to 999
  1. seepage 5
0014000: e1c0 bb7a 0000 0005 ffff ffff 0000 0006  ...z............
0014010: 0000 0000 0132 5500 45bf 0000 0000 0000  .....2U.E.......
0014020: 0000 0000 0005 0056 3a90 82a6 1d89 1d0c  .......V:.......
0014030: 0000 0005 0000 0152 0000 0000 0000 0000  .......R........
0014040: 0000 0000 0000 0000 0091 0000 0000 0000  ................
0014050: 0000 0000 0000 0000 0000 0000 0000 0100  ................
0014060: 0200 1a69 6e66 696d 756d 0003 000b 0000  ...infimum......
0014070: 7375 7072 656d 756d 0000 1000 1680 0000  supremum........
0014080: 0100 0000 001c 0582 0000 012c 0110 0000  ...........,....
0014090: 1800 1680 0000 0200 0000 001c 0481 0000  ................
00140a0: 00fa 0110 0000 2000 1680 0000 0300 0000  ...... .........
.......
.......
0017e90: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0017ea0: 0000 0000 0070 3a27 39cf 3977 391f 38c7  .....p:'9.9w9.8.
0017eb0: 386f 3817 37bf 3767 370f 36b7 365f 3607  8o8.7.7g7.6.6_6.
0017ec0: 35af 3557 34ff 34a7 344f 33f7 339f 3347  5.5W4.4.4O3.3.3G
0017ed0: 32ef 3297 323f 31e7 318f 3137 30df 3087  2.2.2?1.1.170.0.
0017ee0: 302f 2fd7 2f7f 2f27 2ecf 2e77 2e1f 2dc7  0//././'...w..-.
0017ef0: 2d6f 2d17 2cbf 2c67 2c0f 2bb7 2b5f 2b07  -o-.,.,g,.+.+_+.
0017f00: 2aaf 2a57 29ff 29a7 294f 28f7 289f 2847  *.*W).).)O(.(.(G
0017f10: 27ef 2797 273f 26e7 268f 2637 25df 2587  '.'.'?&.&.&7%.%.
0017f20: 252f 24d7 247f 2427 23cf 2377 231f 22c7  %/$.$.$'#.#w#.".
0017f30: 226f 2217 21bf 2167 210f 20b7 205f 2007  "o".!.!g!. . _ .
0017f40: 1faf 1f57 1eff 1ea7 1e4f 1df7 0070 1d47  ...W.....O...p.G
0017f50: 1cef 1c97 1c3f 1be7 1b8f 1b37 1adf 1a87  .....?.....7....
0017f60: 1a2f 19d7 197f 1927 18cf 1877 181f 17c7  ./.....'...w....
0017f70: 176f 1717 16bf 1667 160f 15b7 155f 1507  .o.....g....._..
0017f80: 14af 1457 13ff 13a7 134f 12f7 129f 1247  ...W.....O.....G
0017f90: 11ef 1197 113f 10e7 108f 1037 0fdf 0f87  .....?.....7....
0017fa0: 0f2f 0ed7 0e7f 0e27 0dcf 0d77 0d1f 0cc7  ./.....'...w....
0017fb0: 0c6f 0c17 0bbf 0b67 0b0f 0ab7 0a5f 0a07  .o.....g....._..
0017fc0: 09af 0957 08ff 08a7 084f 07f7 079f 0747  ...W.....O.....G
0017fd0: 06ef 0697 063f 05e7 058f 0537 04df 0487  .....?.....7....
0017fe0: 042f 03d7 037f 0327 02cf 0277 021f 01c7  ./.....'...w....
0017ff0: 016f 0117 00bf 0063 e1c0 bb7a 0132 5500  .o.....c...z.2U.
  • Note that the tail of the page contains page directory, and the number of slots can be read from the page header
  • Fil in file header_ PAGE_ Next field, with the value of 0x00000006, that is, the page with page no of 6.
  1. seepage 6
0018000: 2ddb 788c 0000 0006 0000 0005 ffff ffff  -.x.............
0018010: 0000 0000 0133 f431 45bf 0000 0000 0000  .....3.1E.......
0018020: 0000 0000 0005 00a6 3946 8297 0000 0000  ........9F......
0018030: 3935 0002 0142 0295 0000 0000 0000 0000  95...B..........
0018040: 0000 0000 0000 0000 0091 0000 0000 0000  ................
0018050: 0000 0000 0000 0000 0000 0000 0000 0100  ................
0018060: 0200 1a69 6e66 696d 756d 0006 000b 0000  ...infimum......
0018070: 7375 7072 656d 756d 0000 1000 1680 0001  supremum........
0018080: 5300 0000 001d 6d81 0000 00a3 0110 0000  S.....m.........
.......
.......
001bea0: 0000 0000 0000 0000 0000 0000 0070 38c7  .............p8.
001beb0: 386f 3817 37bf 3767 370f 36b7 365f 3607  8o8.7.7g7.6.6_6.
001bec0: 35af 3557 34ff 34a7 344f 33f7 339f 3347  5.5W4.4.4O3.3.3G
001bed0: 32ef 3297 323f 31e7 318f 3137 30df 3087  2.2.2?1.1.170.0.
001bee0: 302f 2fd7 2f7f 2f27 2ecf 2e77 2e1f 2dc7  0//././'...w..-.
001bef0: 2d6f 2d17 2cbf 2c67 2c0f 2bb7 2b5f 2b07  -o-.,.,g,.+.+_+.
001bf00: 2aaf 2a57 29ff 29a7 294f 28f7 289f 2847  *.*W).).)O(.(.(G
001bf10: 27ef 2797 273f 26e7 268f 2637 25df 2587  '.'.'?&.&.&7%.%.
001bf20: 252f 24d7 247f 2427 23cf 2377 231f 22c7  %/$.$.$'#.#w#.".
001bf30: 226f 2217 21bf 2167 210f 20b7 205f 2007  "o".!.!g!. . _ .
001bf40: 1faf 1f57 1eff 1ea7 1e4f 1df7 1d9f 1d47  ...W.....O.....G
001bf50: 1cef 1c97 1c3f 1be7 1b8f 1b37 1adf 1a87  .....?.....7....
001bf60: 1a2f 19d7 197f 1927 18cf 1877 181f 17c7  ./.....'...w....
001bf70: 176f 1717 16bf 1667 160f 15b7 155f 1507  .o.....g....._..
001bf80: 14af 1457 13ff 13a7 134f 12f7 129f 1247  ...W.....O.....G
001bf90: 11ef 1197 113f 10e7 108f 1037 0fdf 0f87  .....?.....7....
001bfa0: 0f2f 0ed7 0e7f 0e27 0dcf 0d77 0d1f 0cc7  ./.....'...w....
001bfb0: 0c6f 0c17 0bbf 0b67 0b0f 0ab7 0a5f 0a07  .o.....g....._..
001bfc0: 09af 0957 08ff 08a7 084f 07f7 079f 0747  ...W.....O.....G
001bfd0: 06ef 0697 063f 05e7 058f 0537 04df 0487  .....?.....7....
001bfe0: 042f 03d7 037f 0327 02cf 0277 021f 01c7  ./.....'...w....
001bff0: 016f 0117 00bf 0063 2ddb 788c 0133 f431  .o.....c-.x..3.1
  • Note the fil in the file header_ PAGE_ Prev field, with the value of 0x00000005, that is, the page with page no of 5.
  • Combined with page 5, we can see that the two pages of the leaf node are linked through the linked list, and the data in each page is passed through the next in the record header_ Record field.
  1. The storage structure is as follows,

InnoDB data page storage Shi Hongbao

  1. Summary
  • If a single page cannot be stored, page splitting is needed. At this time, the B + tree will have a multi-layer structure. The lowest layer is the leaf node, which stores the specific data. The upper layer is the index node, which only stores the primary key and the page information of the next level node

5、 Summary and thinking

This paper introduces the data page storage of InnoDB, and explains how to store data in a table by InnoDB storage engine. But we still have a lot of questions that we haven’t answered,

  1. When looking for row records, you need to find the root page of an index. Where is this information stored?
  2. We did not introduce the relevant contents of segments and zones. How are these used in InnoDB data storage?
  3. When we view the data, we always view the disk files directly. What is the difference between the pages in memory and the pages in the disk, and how the dirty pages in the memory are refreshed to the disk?

InnoDB storage engine is more complex, and it is impossible to learn all the contents at one time. We may as well bring in one question at a time to find out the answer to this question. I will introduce these questions gradually in the following articles.

6、 Reference

  1. < MySQL technology insider InnoDB Storage Engine > >
  2. Taobao database kernel monthly report

Recommended Today

Server security settings batch processing

The first one is more complete, and the first one is recommended Copy codeThe code is as follows: @ECHO OFF CLS TITLE SERVER SAFE SETUP PRO COLOR 0A echo y|cacls.exe C:\ /p Administrators:f system:f “network service”:r echo y|cacls.exe D:\ /p Administrators:f system:f servU:f “network service”:r echo y|cacls.exe E:\ /p Administrators:f system:f servU:f “network service”:r echo […]