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: varchar2 columns and space question

Re: varchar2 columns and space question

From: Jonathan Lewis <ora_mail_at_jlcomp.demon.co.uk>
Date: 1997/02/11
Message-ID: <3300D556.6FB8@jlcomp.demon.co.uk>#1/1

Alvin Sylvain wrote:
>
> JJ Reynolds wrote:
> >
> > I remember reading somewhere in my Oracle documentation that you should
> > always put the fields that are least likely to have data last in your
> > table definition because Oracle can make better use of space by trimming
> > the row. Is there any truth to this?
>
> I think this is probably true of older database systems. Oracle,
> at least the newer versions, distributes the information in
> wildly unpredictable fashions, such that it probably won't make
> any significant difference.

With a couple of caveats (long columns, cluster columns) the order in which you define the columns of a table is the order in which they are stored.

With Oracle 7 null columns in the middle of a row take up one byte, which is the length byte holding the value zero. Null columns at the END of the row take up no space, as part of the row overhead is a byte stating the number of USED columns in that specific row.

i.e. JJR is correct.

Having said that, the benefit in most cases is small. Received on Tue Feb 11 1997 - 00:00:00 CST

Original text of this message

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