InnoDB disk io (read-ahead and doublewrite Technology) (from MySQL Documentation)

Source: Internet
Author: User

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.

Related Article

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.