MySQL very slow for alter table query

MySQL’s ALTER TABLE performance can become a problem with very large tables. MySQL performs
most alterations by making an empty table with the desired new structure, inserting all the data from the old table into the new one, and deleting the old table. This can take a very long time, especially if you’re short on memory and the table is large and has lots of indexes. Many people have experience with ALTER TABLE operations that have taken hours or days to complete.

Anyway if you need to proceed with alter table, maybe the following resources could help you:

  • https://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html
  • https://github.com/soundcloud/lhm
  • https://githubengineering.com/gh-ost-github-s-online-migration-tool-for-mysql/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)