Skip navigation links

MySQL Forums :: Performance :: Removing NOT NULL constraint takes a long time. Why?


Advanced Search

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

Options: ReplyQuote


Subject Views Written By Posted
Removing NOT NULL constraint takes a long time. Why? 293 Ben Dowling 10/28/2009 08:54AM
Re: Removing NOT NULL constraint takes a long time. Why? 179 Rick James 10/29/2009 09:47PM
Re: Removing NOT NULL constraint takes a long time. Why? 150 Ben Dowling 11/03/2009 09:58AM
Re: Removing NOT NULL constraint takes a long time. Why? 147 Rick James 11/03/2009 08:48PM


Sorry, only registered users may post in this forum.