Re: Adding Not Null with Default column to large Table
From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 09/03/04
- Next message: Amanda: "Re: Drop Target Server When MSX Server Gone"
- Previous message: RG: "Shrinking DB Files"
- In reply to: Neil K: "Adding Not Null with Default column to large Table"
- Next in thread: Gene Black: "Re: Adding Not Null with Default column to large Table"
- Reply: Gene Black: "Re: Adding Not Null with Default column to large Table"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 3 Sep 2004 09:28:20 -0400
I don't think there's any way to get a performance boost, if that's what
you're after... Perhaps you could re-index the clustered index for the table
first with a large fillfactor. The ALTER may be going slowly because your
index pages are very full and adding the new column is forcing a lot of page
splits. But re-indexing the table may take just as long.
"Neil K" <Neil K@discussions.microsoft.com> wrote in message
news:6037A939-4461-427E-8869-69B3171FA96F@microsoft.com...
> I am running an upgrade to an existing system which I have found is using
the
> Alter Table statement to add a Not Null with Default column to huge table
> (100 million records). Not surprisingly it is taking rather a long time!
>
> Can anyone give me any other options to perform this operation ?
>
> I'm currently thinking about
> 1) Adding the column Nullable
> 2) Running multiple updates to the table
> 3) Altering the column to make it Not-Nullable.
>
- Next message: Amanda: "Re: Drop Target Server When MSX Server Gone"
- Previous message: RG: "Shrinking DB Files"
- In reply to: Neil K: "Adding Not Null with Default column to large Table"
- Next in thread: Gene Black: "Re: Adding Not Null with Default column to large Table"
- Reply: Gene Black: "Re: Adding Not Null with Default column to large Table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|