Announcement

Announcement Module
Collapse
No announcement yet.

alter BIG table

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • alter BIG table

    Hi.
    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?

  • #2
    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.
    http://www.percona.com/doc/percona-toolkit/2.1/pt-online-sch ema-change.html

    Comment


    • #3
      Thanks! It solved the problem.

      Comment

      Working...
      X