I need to add a column on a huge InnoDB table (200GB) which resides on MySQL 4.1.21 (SunOS).
CPU has 16GB RAM and 200GB of more disk space.
Is there any quick way of adding this rather than ALTER TABLE? Because, ALTER TABLE as far as I know would take some months to complete.
Any thoughts experts?
2 Answers 2
You can use statement-based replication and add the column to a slave first. Any pending modifications will queue up on the slave, and apply once the alter has complete. When the slave is fully up to date with the new schema, you can effectively 'promote' it.
I am sure you are aware, but MySQL 4.1 is quite old. Triggers were not introduced until MySQL 5.0 (2005), so this limits your options to use tools like pt-online-schema-change.
Percona toolkit has an online schema changer that may be of use.
http://www.percona.com/software/percona-toolkit
http://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html
-
Thanks, Mark. But the solution needed to be really quick and without substantial downtime. Moreover, it's 4.1 version of MySQL which they are planning to move to Oracle. So no migrations in near future :(Abhijit Buchake– Abhijit Buchake2013年11月19日 10:05:24 +00:00Commented Nov 19, 2013 at 10:05
ALTER TABLE
, I really do not see how you could do this...