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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Is ALTER TABLE ADD COLUMN a time-consuming operation ?

RE: Is ALTER TABLE ADD COLUMN a time-consuming operation ?

From: Vadim Gorbounov <vgorbounov_at_simplyengineering.com>
Date: Thu, 05 Apr 2001 07:20:16 -0700
Message-ID: <F001.002E272E.20010405070525@fatcity.com>

        Hi Eduard,
        
        This will be almost instantaneous, unless you specify DEFAULT value.
Oracle doesn't need to keep any information of trailing NULL columns in the data blocks. Oracle will not change row headers until non-null value will be set.

        If you need this column to be NOT NULL, better to add NULL colomn, set desired value via several smaller updates (range limited by appropriate WHERE ) and than modify NOT NULL.

        If you'll try to ADD NOT NULL with DEFAULT, estimated time will be full table update :)

        Hope this helps
        Vadim Gorbounov,
        Oracle DBA

        BTW, dont you know Dmitry Shirkalin? He also works for flagship.ru.


-----Original Message-----
Sent: Thursday, April 05, 2001 7:16 AM
To: Multiple recipients of list ORACLE-L

Hello List

We are going to change structure of a big table (more than 250.000.000 rows).
We need to add a column with NUMBER type. I'm unclear how Oracle do this operation.  Does it mean that Oracle have to read and reformat all table blocks in order to update each row header? If yes, I can suggest that estimation of the operation's time is about time of Full Table Scan on the table.
Is it correct? Please explain.

Ed
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Shevtsov, Eduard
  INET: EShevtsov_at_flagship.ru

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Vadim Gorbounov
  INET: vgorbounov_at_simplyengineering.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Apr 05 2001 - 09:20:16 CDT

Original text of this message

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