Mysql rollback insert causes IBD file to increase ' one times '

Source: Internet
Author: User

a simple test:

Start Transaction;insert into TB1 values (3, repeat (' a ', 65000), ' X ', 1);--commit;rollback;

tb1.ibd, respectively, in before you insert, roll back the size of the file before the rollback:

Someone in QQ group asked why.

---------------------------------------

In fact, the reason is simple:

131072-98304=163840-131072=32768
So: Roll back insert = delete + re-insert, and delete refers to set Flag,so ... Content increases by one-fold.

The rollback of the insert operation is to delete the previously inserted value, then insert it again, and delete is the tombstone, which is to set a flag, without a real delete. That's the reason.

Mysql rollback insert causes IBD file to increase ' one times '

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.