Wednesday, June 24, 2009

MySQL alter table with multiple indexes

Recently I need to add/delete multiple indexes in the same table. I didn't notice that, I can chain the add/drop index in a single "ALTER TABLE" which only does one table copying once instead of multiple times.

http://brian.moonspot.net/mysql-alter-multiple-things

In the past, I tried to copy over the huge dataset to a temp table with the new indexes created, but I encountered a problem in deleting a FK in the child table that I can't solve. http://bugs.mysql.com/bug.php?id=14347

No comments: