Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA18321; Fri, 21 Aug 92 11:04:14 -0700
Message-Id: <9208211804.AA18321@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: excessive storage
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Mon, 17 Aug 92 12:42:04 PDT."
             <9208171942.AA29383@postgres.Berkeley.EDU> 
Date: Fri, 21 Aug 92 11:04:01 PDT

you write:
> 
> I create the following classes:
> 
> create	ctd (loc = int4, dis = int4, tim = int4, clk_f = int2, 
> 	clk_s = int2, clk_m = int2, clk_h = int2, clk_d = int2, 
> 	clk_n = int2, clk_y = int2 , seq_num = int2, tran_id = int2)
> 
> create MAGsm1 (gammas = float8) inherits (ctd)
> 
> Which total up to 38 bytes per instance without the object_id
> or the overhead.

40 bytes after alignment.

> My original input file contains 1800 instances, which i would
> expect to create a MAGsm1 file on the order of 70Kb. In practice, my
> MAGsm1 data file is 188Kb.
> 
> Could you tell me how much of this is data and how much is
> overhead? What can I do to reduce the size of the files I 
> create?

there is roughly 60 bytes of tuple header (could be 56 if you have no
null attributes) and a small amount of overhead at the beginning of
each page (pointers to tuples that live on it).  This will vary according
to how many tuples you have on the block.

100 bytes per tuple * 1800 tuples = 180,000 bytes for the tuples.

Add the page overhead and a fragmentation factor (we can't always use
every byte on a page) and you get (roughly) the 188Kb that you are seeing
in the file.


Jeff Meredith
mer@postgres.berkeley.edu
