Subject Does added column cause all records to be touched or what happens?
Author Kjell Rilbe
Hi,

I'm a bit curious. I just added a nullable bigint column without a
default value and an index on it to a table with about 150 million records.

It's taking very long to commit, so I'm wondering what the server is
actually doing. There's no criticism here, it's just something I find
interesting.

Does it have to update all records to add a null value to the new column
or if not, how is it handled instead?

I assume the new index is built completely. If not, how is the index
handled instead?

Anything else going on in there? :-)

Regards,
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64