Forum Moderators: open

Message Too Old, No Replies

MySQL - Changing default on a large table

         

csdude55

9:42 am on Mar 24, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a pretty large table: 8 million rows, data is 1.7G, index is 380M.

One of the columns is a boolean... sort of. I should have originally made it a TINYINT with a 0 or 1, but instead I made it an ENUM. So instead of 0 there's NULL, and instead of 1 there's "Yes". And changing that now would require several program changes, and it's just not worth the effort.

The default for this column is NULL, though, and I would like to change the default to "Yes".

My question is, would changing this default be quick and immediate, or is it going to take the table offline for awhile? A few years ago I changed the TYPE for a similarly sized table from VARCHAR(14) to BIGINT(14), and it took well over an hour to complete! Am I going to have the same type of delay in changing the default?

tangor

2:13 am on Apr 2, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Won't know until you try ... then again, if it must be done then just do it. Pick your time of day to accomplish. Other option: do the work off line and upload the revised version.