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: Storage space needed for a numeric(15)

Re: Storage space needed for a numeric(15)

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 04 Feb 2000 10:28:22 -0500
Message-ID: <cvrl9s0t2sm4shlsa7sbh3r6q77vqupsm3@4ax.com>


A copy of this was sent to François de Rochebrune <fderochebrune_at_free.fr> (if that email address didn't require changing) On Fri, 04 Feb 2000 13:29:13 GMT, you wrote:

>Hi,
>
>I am planning to create a table using several numeric values from 0 to
>10 power 15.
>The table will contain millions of records and I am trying to evaluate
>the disk space needed to store the whole database.
>My question is :
>How much space will a numeric(15) field occupy ?
>Will each value occupy 15 bytes ?
>Or is there a binary conversion applied so the space could be 7 bytes ?
>(10 power 15 is approx. 2 power 52, which could fit in 52 bits - less
>than 7 bytes)
>
>Thanks for the answer here or at FdeRoche_at_aol.com
>
>

They'll take between 0 and 10 bytes (0 bytes if they are NULL and are the last column in the table or all columns following them are NULL)

scott_at_dev8i> select vsize(-999999999999999), vsize(0) from dual;

VSIZE(-999999999999999) VSIZE(0)

----------------------- ----------
                     10          1


See the server concepts manual for the exact formula.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Feb 04 2000 - 09:28:22 CST

Original text of this message

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