Main components of the InnoDB engine architecture

Source: Internet
Author: User
Tags dedicated server

1.Buffer Pool
A region in the primary buffer that caches table and index data. Allows data to be used frequently from memory directly to speed up data processing. On a dedicated server, more than 80% of the physical memory is allocated to the buffer pool.
For efficient query operation, the buffer pool is divided into pages (which can contain one or more records, depending on the amount of data recorded).
For efficient cache management, the buffer pool is implemented as a linked list of pages, using the LRU algorithm to remove data from the buffer pool with a small amount of access.


2.change Buffer
Change buffer stores changes to the two-level index pages when the affected pages are not in buffer pool. Cached data changes resulting from insert,update, or delete operations, are loaded and merged into the buffer pool when the read operation is executed by the modified pages.
In memory, change buffer is part of the buffer pool. On the hard disk, change buffer is part of the system tablespace.
The data type of the change buffer cache is managed by the Innodb_change_buffering configuration item.
Show ENGINE INNODB STATUS command to view information about change buffer, buffer pool, and more
Information_schema. The Innodb_buffer_page table provides metadata for all the PAGE in the BUFFER pool.


3.Adaptive Hash Index
If the query can benefit from the hash index, InnoDB automatically creates a hash index in memory to speed up the query operation of the = and in operators.
The Innodb_adaptive_hash_index option is used to configure the switch for hash index. The Hash index is also stored in the buffer pool, so whether or not it is turned on requires some testing to be done to ensure that other performance is not compromised.


4.redo Log Buffer
is the memory area where data is written to redo log. The innobd_log_buffer_size is used to configure the size of the redo log buffer. Larger buffers support large running transactions without writing redo log to disk before the transaction commits.
Related configuration items: Innodb_flush_log_at_trx_commit and Innodb_flush_log_at_timeout


5.System tablespace

One or more data files (ibdata files), containing InnoDB related objects (data dictionary), is the storage area of the undo logs change buffer doublewrite buffer. You can also include table and index data.


6.Data Dictionary

Metadata that is used to track InnoDB objects such as tables, indexes, columns, and so on. The metadata information is saved in the system tablespace. For historical reasons, the. frm file overlaps with some other pieces of information.


7.doublewrite Buffer
A piece of storage area located in System tablespace. InnoDB writes data from buffer pool to this doublewrite buffer before the pages are written to the appropriate data file. The engine only writes pages to the final data file after the data is written to doublewrite buffer. In the event of a server failure, InnoDB can obtain a good copy of the page from D-buffer during recovery.
Double buffer is turned on by default. The innodb_doublewrite=0 can be closed.


8.undo logs
An undo log is a collection of undo log records related to a single transaction. An undo log record contains information about how to undo an up-to-date data change caused by a transaction. If another transaction needs to see the raw data, InnoDB will get the data before the modification from the undo log records.


9.file-per-table tablespaces
Data tables use separate data files instead of stored in system tablespace. Each individual tablespace defaults to an. ibd file under one data directory


10.redo Log
Filegroups: Ib_logfile0 and Ib_logfile1, which constitute the redo log. For fault recovery, to ensure the correctness of non-complete transaction processing data.


11.group Commit for redo log flushing
InnoDB, like other acid-enabled database engines, refreshes the redo log before the transaction commits. InnoDB These types of refresh requests to avoid one commit per refresh request. Using a packet-submitted scheme, InnoDB commits a single commit to multiple user transactions to write the redo log file one time, ultimately improving throughput.


Major conceptual interpretations are involved:
Cluster index: Also known as primary key index, the value of the primary key column determines the order in which the table data is stored, and the primary key column accelerates the query and sorting. Because primary key columns determine the order of storage, it can be costly to modify the primary key columns.
Secondary index:a type of InnoDB index, indexes other than the clustered index, a table can be set to 0+ such an index.
Segment: The split segment of the table space. In the File-per-table table space, the table data is in a segment, with each associated index in its own segment. System Tablespace contains a number of different segment and also contains rollback segment for the undo logs.
Rollback segment: Contains the Undo log, which is part of the system table space.
Tablespace: A file that can hold one or more data tables and related indexes.
Ibdata file: A set of such files: Ibdata1,ibdata2. Wait a minute. It makes up the table space of the system. Some or all of the table data may also be included (depending on whether the file-per-table mode is on). When the innodb_file_per_table option is turned on, the newly created data and indexes are saved in a separate. ibd file, not in the systemtablespace.
Controlled by the innodb_autoextend_increment configuration option.
Ibtmp file: Temporary tablespace data files.
Ib_logfile: A filegroup, usually named: Ib_logfile0 and Ib_logfile1, which constitute the redo log.
Redo log: Disk-based data structure. Used for fault recovery to ensure that incomplete transactions are written to the correct data.
. frm file: Contains the metadata for the MySQL table, for example, the definition of a table. For the InnoDB engine, though, it also has a. frm file, but the metadata for the table is in System tablespace.

Main components of the InnoDB engine architecture

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.