All Forums Database
Sunikutty 3 posts Joined 06/13
15 Jan 2014
Column Addition in Teradata

I need to add three columns to a huge table(close to 99 million records). Value in these columns for 99 million existing records will remain as null itself.So no need of any update for 99 million records.There is no column compression of this table.Its ok to add new columns at the end of the table also.
Which is better way to add three columns
a)  Alter this table or
b) create back up of table-->create new table with three new columns--> insert data from back up to new table--> drop back up table.
I heard alter will cause performance issue and cause CPU spike?Is that true? If yes why is that so?

Raja_KT 1246 posts Joined 07/09
15 Jan 2014

Also , today it so happened that I increased the length of a column of a populated table thus:

alter table db1.raja_test1 add id format 'x(255)'  VARCHAR(255) ;--previously it was only 10


I am thinking of STATS now, if your table is critical.


I am not sure about 99 million records. But with few records, it happens in the blink of an eye:

alter table db1.raja_test1 add id_type   VARCHAR(255) default NULL;


This blog of Dieter is a good write-up.


Please share your experience once you made it :).




Raja K Thaw
My wiki:
Street Children suffer not by their fault. We can help them if we want.

KVB 124 posts Joined 09/12
16 Jan 2014

Go for a backup option.

You must sign in to leave a comment.