Removing NOT NULL constraint takes a long time. Why?
Posted by:
Ben Dowling ()
Date: October 28, 2009 08:54AM
Hi,
I have an InnoDB table with around 130 million rows. I recently had to change one of the columns from:
confirmed TINYINT UNSIGNED DEFAULT 0 NOT NULL
to:
confirmed TINYINT UNSIGNED DEFAULT 1
Essentially I was just removing the NOT NULL constraint. To do so I ran the query:
ALTER TABLE table CHANGE COLUMN confirmed confirmed TINYINT DEFAULT 0
The alter query is still running, and has been doing so for almost 30 hours now. I'm amazed that the query is taking so long. Could someone with knowledge of MySQL/InnoDB internals enlighten me as to what is happening to make what seems like a simple relaxing on constraints to take so long?
Thanks in advance,
Ben
Sorry, only registered users may post in this forum.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.