RE: How many bytes does the datatype NUMBER use?

From: Allan Plesniarski <aplesnia_at_my-deja.com>
Date: 2000/03/20
Message-ID: <8b614u$sil$1_at_nnrp1.deja.com>#1/1


If you have an existing dataset to work with,

select avg( vsize( column_name)) from table_name;

will give the average number of bytes for that column, up to a maximum of 22 bytes.

For database sizings, as a rule of thumb, use 5 bytes for each number column in an index to calculate space requirements for indexes.

In article <lUtB4.33348$ys3.220470_at_telenews.teleline.es>, "APBCSI" <sis.inf_at_cadiz.portel.es> wrote:
> Here you are: It´s from Oracle8 Server Concepts:
>
> Internal Numeric Format
> Oracle stores numeric data in variable-length format. Each value is
 stored
> in scientific notation, with one byte used to store the exponent and
 up to
> 20 bytes to store the mantissa. (The resulting value is limited to 38
 digits
> of precision.) Oracle does not store leading and trailing zeros. For
> example, the number 412 is stored in a format similar to 4.12 x 10^2,
 with
> one byte used to store the exponent (2) and two bytes used to store
 the
> three significant digits of the mantissa (4, 1, 2).
>
> Taking this into account, the column data size for a particular
 numeric data
> value NUMBER (p), where p is the precision of a given value (scale
 has no
> effect), can be calculated using the following formula:
>
> 1 byte (exponent)
> + FLOOR(p/2)+1 bytes (mantissa)
> + 1 byte (only for a negative number where the number of
> significant digits is less than 38)
> _______________________
> number of bytes of data
>
> Zero and positive and negative infinity (only generated on import from
> Version 5 Oracle databases) are stored using unique representations:
 zero
> and negative infinity each require one byte; positive infinity
 requires two
> bytes.
>
> Louis Frolio <frolio_at_videoshare.com> escribió en el mensaje de
 noticias
> 87ps2c$enr$1_at_bob.news.rcn.net...
> > Greetings All, I was hoping that someone might be able to tell
> > me how many bytes the datatype "number" uses. If it is dynamic
> > what is the method of determinig how many bytes will be used?
> >
> >
> > Thank You, Louis
> > frolio_at_videoshare.com
> >
> >
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Mar 20 2000 - 00:00:00 CET

Original text of this message