(Three) Mysql InnoDB architecture full solution

1. InnoDB overall architecture

Insert picture description here
Let's look at the memory structure first.

1.1 Memory structure

Buffer Pool is mainly divided into 3 parts: Buffer Pool. Change Buffer, Adaptive Hash Index, and another (redo) log buffer

1.1.1 Buffer Pool

Buffer Pool caches page information, including data pages and index pages.
The default size of the Buffer Pool is 128M (134217728 bytes), which can be adjusted.
View system variables:

SHOW VARIABLES like '%innodb_buffer_pool%';

Check the server status, there are a lot of information related to Buffer Pool:

SHOW STATUS LIKE '%innodb_buffer_pool%';

The detailed meaning of these parameters can be found on the official website, using the search function.
https://dev.mvsQl.eom/doc/refman/5.7/en/server-svstem-variables.html

What if the memory buffer pool is full? (What if the memory set by Redis is full?) InnoDB uses the LRU algorithm to manage the buffer pool (linked list implementation, not traditional LRU, divided into young and old), and the eliminated data is the hot data.

1.1.2 LRU algorithm

The LRU algorithm can be downloaded on Baidu, and a separate article will be written later

1.1.3 Change Buffer write buffer

Change Buffer is part of Buffer Pool.
If the data page is not a unique index, there is no data duplication, and there is no need to load the index page from the disk to determine whether the data is duplicate (uniqueness check). In this case, you can first record the modification in the memory buffer pool to improve the execution speed of the update statement (Insert. Delete. Update).
This area is called Insert Buffer before Change Buffero 5.5, and now it can also support delete and update.

1.1.4 Adaptive Hash Index

1.1.5 Redo Log Buffer

To be continued

Guess you like

Origin blog.csdn.net/nonage_bread/article/details/112847353