InnoDB uses analog asynchronous disk I/O: InnoDB creates many threads to process I/O operations, such as read-ahead (pre-read ).
There are two read-ahead testing methods in InnoDB:
(Note: InnoDB records are stored in the order of primary keys in the file)
(1) In the continuous read-ahead, if InnoDB notices that the access to a segment in the tablespace is continuous, it will pre-arrange a batch of database pages to read to the I/O system.
(2) In random read-ahead, if InnoDB notices that some areas in the tablespace appear to be completely read into the processing of the buffer pool, it arranges the remaining read to I/O systems.
InnoDB uses a novel file refresh technology called doublewrite (dual-write. It adds security to recovery after the operating system crashes or powers down, and improves performance in most UNIX variants by reducing the need for fsync () operations.
Doublewrite indicates that before writing pages to a data file, InnoDB first writes them to an adjacent tablespace area, which is called a doublewrite buffer. After writing and refreshing to doublewrite, InnoDB writes the page to the appropriate location in the tablespace. If the operating system crashes in the middle of the write page, InnoDB can find a good copy of the page in the doublewrite buffer later.