Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Number vs. float vs. char vs. varchar2
Space is an issue in a very large (400 million row) table I am working with.
I need to better understand the actual storage requirements of data stored
as number, float, char, and varchar2, since many of the columns in this
table could be expressed in any of these forms.
Number seems to take 22 bytes. Does it really take all of that when scale and precision are something like 3?
Float seems to take the same 22 bytes, on a machine where a float takes only 8 bytes. Does it take 22, 8, or something else?
Many of these data elements have extensive leading zeros, i.e., there is an implied decimal to the left of the number. They also often have signs, either plus or minus. I could easily store them in a char or varchar2, which would "apparently" take less space than number or float. (None of these values need to be manipulated. They simply need to be returned on a query and placed in a fixed length string. If I trim the leading zeros, the application can easily put them back on.)
So, how do I use the least amount of disk space with this kind of data?
Rog
--
roger@_delete_this_to_reply_.martech.com
Received on Tue May 26 1998 - 23:06:51 CDT