Column Addition in Teradata

Database

Column Addition in Teradata

Hi,

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?

Regards

Sunitha

2 REPLIES
Enthusiast

Re: Column Addition in Teradata

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 :).

Cheers,

KVB
Enthusiast

Re: Column Addition in Teradata

Go for a backup option.