Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Using a Number datatype
In article <3922E60F.14F62C55_at_motorola.com>,
Allen <allen.brost_at_motorola.com> wrote:
> What is the default size of a Number datatype if no value
> is given when the table is created? If you know your going
> to to use a number below 100, does it offer a performance
> benefit both in speed and space to define the column as
> Number(2)?
>
> - Allen
>
Defining a column that will hold a number in the range of 0 - 99 as
number(2) vs number has no storage space or real performance benefit,
but it does allow the rdbms to enforce value checking for the domain.
I would say it is the prefered form as you want as much validity
checking as possible on the data. Defining a number column as only 2
digits will result in less space being necessary to display/handle the
output and there may be some small performance consideration here but
that gets into the real internals that few people can speak about with
authority.
Oracle stores all numberic datatypes internally as type number which is a form of scientific notation stored in variable length fields of no more than 22 bytes. The formula is in the Concepts manual and is something like 1 + (floor(digits/2) + 1) + 1, this last +1 is for the sign and is only required if the value is negative.
-- Mark D. Powell -- The only advice that counts is the advice that you follow so follow your own advice -- Sent via Deja.com http://www.deja.com/ Before you buy.Received on Thu May 18 2000 - 00:00:00 CDT
![]() |
![]() |