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: table create vs alter

Re: table create vs alter

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 17 Aug 2001 11:51:26 -0700
Message-ID: <F001.0036FB03.20010817120009@fatcity.com>

No need to worry - there is no 'data block' info about how many columns are defined to the table. Every row stored has a byte indicating the number of columns actually used in that row.

Consequently a row with the first column filled out of three will look identical to a row belonging to a table with only one column.

There are some possibly cases where things can be different though, as the 'internal' column number and the 'external' column number need not match. The original example of this was a table with a long column. No matter where you declared it, the long column was physically placed at the end of the row. However, if you added a column, it HAD to be added past the long column.

So:

    create table t1(txt long);
    alter table t1 add id number;

would actually be stored differently from

    create table t1 (id number, txt long);

Jonathan Lewis

Seminars on getting the best out of Oracle Last few places available for Sept 10th/11th See http://www.jlcomp.demon.co.uk/seminar.html

-----Original Message-----
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Date: 17 August 2001 19:00

For all intensive purposes the table will be created the same. But, and someone with the ability to read the block data please check it out.

There are my own thoughts.... In method 1 the block data is set up to have 3 columns per table. In method 2 the table is set up to have 1 column and the data block info is set, Then another column is added and the data block info has to be changed. Simular to chaining inside the data block. I do not think that Oracle will remove the data block info and then recreate it when you add a column. If you had a large number of columns that would fill a block and the added a column, would the row be chained or migrated?
ROR mm

--

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

Author: Jonathan Lewis
  INET: jonathan_at_jlcomp.demon.co.uk

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 Fri Aug 17 2001 - 13:51:26 CDT

Original text of this message

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