Not the answer you need?
Register and ask your own question!

alter BIG table

ErshErsh EntrantInactive User Role Beginner
During altering table process MySql copy all data to tmp, to backup it. And only after it - altering, that part takes about few seconds. In case of big amount of data - table size ~300GB - this process could take us long period of time.
Is there any way to turn this "copy to tmp" option off?


  • justin.swanhartjustin.swanhart MySQL Sage Inactive User Role Beginner
    MySQL isn't 'copying to tmp' to backup the contents. The temporary table contents are the contents of the NEW table which is filled up with rows from the old table. At the end of the ALTER process, the temporary table is made permanent and swapped with the old table then the old table is dropped.

    You can use pt-online-schema-change, part of Percona Toolkit to do online ALTER operations to large tables. ema-change.html
  • ErshErsh Entrant Inactive User Role Beginner
    Thanks! It solved the problem.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.