InnoDB Insert (Insert) operation (II)-mysql technology insider, innodb-mysql

Source: Internet
Author: User

InnoDB Insert (Insert) operation (II)-mysql technology insider, innodb-mysql

I want to prove the relationship between the mysql innodb Storage engine, commit operations, and flush data to the disk. After talking with colleagues, he said, you should take the innodb_buffer_size into account. In fact, I have considered it. In the beginning, I have made assumptions. If the buffer size is 1 GB and the data size is 2 GB, therefore, during transaction insertion, it is necessary to write the cached data to the disk before the commit operation.

In addition, in the previous experiment, I conducted two groups, one for rollback and the other for commit, the rollback operation time is much longer than that of the commit operation. Whether it can be imagined that the data has been stored in the disk, but there is a transaction identifier on the data page to implement the transaction isolation mechanism, which is invisible to other sessions. At this time, the rollback operation will clear the data from the disk one by one, which will certainly be slow. Of course, I still don't know about this deletion mechanism. It is to move one side of the buffer again, and the data file size does not change after the rollback operation. Is it possible that the allocated physical space is not recovered in time, so that you can reuse it next time. In addition, the commit operation is completed in a very short time. The possible reason is that this operation only removes the transaction ID information on the data page on the disk and it is OK. Well, with a rigorous attitude, let's start an experiment again. (Go back from work and do it again)

Innodb_buffer_size =, ensure that the buffer of New inserted data is sufficient.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.