Don't Alter Table. Do Copy and Rename – Research And Development Blog
In some cases a MySQL MyISAM table structure needs to be alter. This includes adding, removing and changing table columns (or indexes) and even re-ordering the MySQL table.
In these cases, for performance and safety reasons, it is wise to avoid altering the current working MySQL table and adopt the Copy and Rename approach.
The Copy and Rename approach consist from the following steps:
- Create similar temporary table but with the requested change
- Disable the temporary table keys,
- Copy the rows from the original table to the temporary table
- Enable the temporary table keys,
- Backup the original table and rename the temporary table to have the original table name
Read full article from Don't Alter Table. Do Copy and Rename – Research And Development Blog
No comments:
Post a Comment