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: Data storage question

Re: Data storage question

From: Pete Sharman <psharman_at_us.oracle.com>
Date: Fri, 20 Aug 1999 16:04:28 -0700
Message-ID: <37BDDEFC.96B58A22@us.oracle.com>


Nandakumar

The answer is not much if you use varchar2. Varchar2's are variable length, and only store 1 byte's worth of data to indicate the length of the column, plus the number of bytes of actual data. Also, trailing nulls don't store the length indicator, so the best case scenario is no storage wasted, the worst is 8 bytes per row.

HTH. Pete

Nandakumar wrote:

> Hi,
>
> I need to store the attributes of an item in a table. The attributes are
> not pre-defined, but there is a maximum limit to the number of
> attributes, say 10. Initially there will only be "2" attributes that
> would be stored in database. Unknown attributes are stored as NULLs.
>
> So i decide to go for a table with 10 varchar2 fields for the
> attributes.
>
> Say, data are stored in this fashion in the database and the number of
> records has reached 5(or more) million.
>
> Now, if i find out that there won't be any need to store more than "2"
> attributes in the table how bad is my design of the table. How much
> storage space would i have saved had i designed the table with just "2"
> varchar2 fields?
>
> mmm! i hear you all say this is an one line question!!
> Thanks
> --
> Nandakumar
> Systems Analyst
> New York
> (N.Kumar_at_rocketmail.com)
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

--
Regards

Pete


Received on Fri Aug 20 1999 - 18:04:28 CDT

Original text of this message

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