Adding a Column -- Performance issues [message #146202] |
Wed, 09 November 2005 04:47 |
deepa_balu
Messages: 74 Registered: March 2005
|
Member |
|
|
I have a Table with millions of data.
Indexes also exist on that table.
Now i want to add a Not null column to that table with default Data .
So what happens internally.
Each Data block will be modified to add that column data.
Will the indexes be internally rebuilt...
Will it take a long time..
Which one will be faster,,
1. adding a column or recreating the table and indexes.
2.Dropping the index, adding the column and creating the index
[Updated on: Wed, 09 November 2005 05:01] Report message to a moderator
|
|
|
Re: Adding a Column -- Performance issues [message #146231 is a reply to message #146202] |
Wed, 09 November 2005 08:50 |
Sanjay Bajracharya
Messages: 279 Registered: October 2001 Location: Florida
|
Senior Member |
|
|
You need to provide a little more information ...
You said "millions of data" .. meaning 1 million ? 10 million ? more than 10 million rows ?
Just adding a column will take time and here are the steps
1. Add the column (NULLable at this time).
2. Insert a value (default value in this case).
3. make that column NOT NULL and also set a default value.
How readily can you load the millions of rows ?
Later.
--
Sanjay
|
|
|