Re: How much space do my data occupy?

From: Jim Kennedy <odysscci_at_teleport.com>
Date: Mon, 20 Feb 1995 21:58:07
Message-ID: <odysscci.175.0015F89C_at_teleport.com>


In article <5gD5ou-1xEB_at_becker.ping.de> udo_at_becker.ping.de (Udo Becker) writes:
>Path: news.teleport.com!usenet.reed.edu!news.reed.edu!usenet.ee.pdx.edu!cs.uoregon.edu!news.uoregon.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!Germany.EU.net!ping.de!becker.ping.de!udo
>Date: 20 Feb 1995 22:13:00 +0200
>From: udo_at_becker.ping.de (Udo Becker)
>Newsgroups: comp.databases.oracle
>Message-ID: <5gD5ou-1xEB_at_becker.ping.de>
>References: <3grp5p$c4k_at_lucy.infi.net> <3h7amc$s7q_at_newsbf02.news.aol.com>
> <outputD482pu.A7B_at_netcom.com>
>Subject: How much space do my data occupy?
>X-Newsreader: XP v3.0
>X-Charset: ISO-8859-1
>Lines: 44

>Hi,
 

>how can I determine how much space my data occupy?
 

>From COLS I can compute how many bytes at maximum I need to represent one
>row of a given table T:
 

> select sum(data_length) from cols where table_name = "T"; (LEN)

>(Our Oracle says it needs 22 bytes to represent an integer value. I can't
>imagine this is true.)
 

>I could multiply this by the total amount of rows in my table (AM), giving
>LEN*AM.
 
>Furthermore I can determine how many extents are realy needed for my table
>and how many bytes they occupy:
 

> select sum(bytes) from dba_extents where segment_name = "T";
 

>In most cases the result is less than LEN*AM. This is even true if my
>table only consists of fixed length columns, e.g. integers.
 

>By selecting from DBA_FREE_SPACE I can compute how many bytes are free in
>my tablespaces.
 

>But I haven't found a way to tell how many bytes are free, resp. occupied,
>in my extents.
 

>Thanks for any help.

>Udo Becker
>--
> __
>| | |__) Dipl.-Inf. Udo Becker phone: ++49-2335-62562 (priv.)
>|__| |__) Haus Hove 17 ++49-2335-92-7974 (off.)
> D-58300 Wetter fax: ++49-2335-92-7811 (off.)

>## CrossPoint v3.0 ##
I believe that Integers do not always take 22 bytes. Certainly, if the integer was large enough it could. Since numbers are stored in base 100 with an offset I think that the following would give you the maximum size for your numbers:

y = ((log10( your largest number) + number of didgets of precision)/2)+1

for integers the precision would be 0.

I think that this will give you a better estimate. Jim Kennedy Received on Mon Feb 20 1995 - 21:58:07 CET

Original text of this message