On 6/16/05, Gabriel B. <[EMAIL PROTECTED]> wrote:
> If i have a table with about 800M records. and one of the fields is a
> enum("a", "b", "c") and i want to change it to enum("a","b","x") 

My understanding (such as it is) is that the best way to do this is to add a 
second column with enum('a','b','x') and set the value using the integer 
value of the first column as follows. (adding 0 casts enum as integer)

ALTER TABLE table ADD new_column enum('a','b','x');
UPDATE table SET new_column = old_column + 0;
ALTER TABLE table DROP old_column;

Execution time is dependent on the speed of the update, but it would need to 
read every row.

Reply via email to