Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: adding a column with default value on a very large table

Re: adding a column with default value on a very large table

From: Julio Oliveira <jco99_at_yahoo.com>
Date: 15 Mar 2002 09:52:21 -0800
Message-ID: <9a13c309.0203150952.720c6c53@posting.google.com>


"Fr??ic Bachelier" <fbacheli_at_capgemini.fr> wrote in message news:<a6qnvs$hlo$1_at_s1.read.news.oleane.net>...
> Hi !
>
> I want to add a new column with a default value on a very large table (100
> million of records).
> I would like to know if using the following SQL command is suited, seen
> under the angle of the very large size :
>
> alter table XXXX add column YYYY varchar(4) default '0000';
>
> The good point is that this doesn't use the rollback segments, so the
> problem is not here.
>
> 1) The question is about the speed performances. Is this the speedest method
> ?
>
> 2) Besides I want to know how to estimate the time necessary for this
> operation.
>
> Thank you,
> Frédéric Bachelier

Why don't you add this new column as default null first - all old recordswill have it as null, but new records will default to your definition; then alter the table/column to the real default value. After, you can update your old records in smaller sets if necessary. Received on Fri Mar 15 2002 - 11:52:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US