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.