Re: Number(10)

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 05 Jan 2000 11:45:56 -0500
Message-ID: <gus67ssu7ldmbd0as9ssd193hmqs89n6s3_at_4ax.com>


A copy of this was sent to "William Teo" <sucheeha_at_singnet.com.sg> (if that email address didn't require changing) On Wed, 5 Jan 2000 12:43:49 +0800, you wrote:

>Hi,
>
>Could anyone provide the answer?
>Number(10), Number(20), Number(20,5)
>
>So how much spae was used on the Server for each case?
>

Its all in the concepts manual. but in short,

  • each will consume ZERO bytes if they are NULL and are either the last column in the table or every column after them is NULL as well.
  • each will consume 1 bytes if they are NULL and there exists some column in the row AFTER them that is not null.
  • each will consume a varying amount of space depending on the number placed into them. the formula's are in the concepts guide. The max space allocated is:

3+floor(p/2) where p is the precision (scale doesn't have any effect)

so, for number(10) it will consume between 0 and 8 bytes.

    for number(20) and number(20,5) it will consume between 0 and 13 bytes.

you can use VSIZE to play around with this and see for yourself:

tkyte_at_8i> select vsize(1), vsize(11), vsize(111), vsize(1111) from dual;

  VSIZE(1) VSIZE(11) VSIZE(111) VSIZE(1111) ---------- ---------- ---------- -----------

         2 2 3 3

tkyte_at_8i> select vsize(-1) from dual;

 VSIZE(-1)


         3

-- 
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 Wed Jan 05 2000 - 17:45:56 CET

Original text of this message