|
-
I would stick to VSIZE while trying to find out the number of bytes internally occupied by oracle to store a certain value. I don't know how the formula works ( length(p) = what? ) - tried to figure out though. Take a look at the following:
value----------bytes needed using vsize
------- -----------------------------
1 -------------> 2
10 ------------> 2
100 -----------> 2
1000 ----------> 2
10000 ---------> 2
100000 --------> 2
100001 --------> 4
876943 ---------> 4
-1 ---------------> 3
The reason is :
Oracle stores a number in base 100 format
Each byte can store 2 digits
One byte is always reserved for exponent
For -ve numbers an additional byte is reqd (for sign)
Thus, for Julian's number:
7700 needs 2 bytes because:
the digits 77 need one byte
the exponent 00 needs one byte
thus 7700 needs 2 bytes
This holds true for all numbers - as long as there are trailing zeroes, the space requirement does not increase.
I would be interested in an explanation of the formula if anyone has any please If oracle has it in the doc's there would be a logic behind it I think!
-amar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|