Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Different storage for 'almost' the same numbers....

sgalaxyApr 26 2008 — edited Apr 27 2008

Hi ,
I bumped to the following :

SQL> create table t ( x number, y number );
 
Table created
 
SQL> 
SQL> insert into t ( x )
  2   select to_number(rpad('9',rownum*2,'9'))
  3   from all_objects
  4   where rownum <= 14;
 
14 rows inserted

SQL> update t set y=x+1;
 
14 rows updated

SQL> select x ,y ,  vsize(x) , vsize(y) from t;
 
         X          Y   VSIZE(X)   VSIZE(Y)
---------- ---------- ---------- ----------
        99        100          2          2
      9999      10000          3          2
    999999    1000000          4          2
  99999999  100000000          5          2
9999999999 1000000000          6          2
9999999999 1000000000          7          2
9999999999 1000000000          8          2
      1E16       1E16          9          2
      1E18       1E18         10          2
      1E20       1E20         11          2
      1E22       1E22         12          2
      1E24       1E24         13          2
      1E26       1E26         14          2
      1E28       1E28         15          2
 
14 rows selected

Can somebody explain the above phenomenon where the vsize of x column gets incremented as the x number gets bigger.... but at the same time the vsize of y column gets the 'static' value of 2 whereas it is just bigger than x (x=9999 , y=10000)...????

The db version is 10.2.0.1.
Thanks...
Sim

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2008
Added on Apr 26 2008
6 comments
1,245 views