New answers tagged alter-table
To make online changes to a table you can use pt-online-schema-change pt-online-schema-change --alter "ADD COLUMN c1 INT" D=sakila,t=actor The table will be blocked for a few seconds when it switches new and old tables. The table though must have a primary keys and not have triggers.
You may have fragmentation in the table meaning that you could reclaim space by running the optimize command on the table. Check the free_data column from show table status like 'table_name'. Further reading; http://dev.mysql.com/doc/refman/5.5/en/optimize-table.html If you are using the innodb storage engine (and you generally should with narrow ...
MySQL's documentation for utf8 shows that it will use 1 byte for Latin characters, and only use more if the situation requires them. Therefore, if you're only using normal latin characters, both utf8_general_ci and latin1_general_ci will use between 1 and 4 bytes: one byte to store the length (0-3 characters), and then up to three bytes for the actual text. ...
I think that Percona's pt-online-schema-change might be a better solution for you as it can do an ALTER with very little downtime. It does, however, require adding a TRIGGER to the table. Runnig DDL on your table will lead you into rebuilding your table, mysql is a row based engine so you will suffer the index rebuild this can be quite expensive depending ...
Top 50 recent answers are included