Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D50A29FB28E for ; Wed, 29 Nov 2006 16:46:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 61561-09 for ; Wed, 29 Nov 2006 16:46:15 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 5D55D9FA285 for ; Wed, 29 Nov 2006 16:46:35 -0400 (AST) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Wed, 29 Nov 2006 20:46:32 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 29 Nov 2006 14:46:32 -0600 Subject: Re: Disk space usage From: Scott Marlowe To: Joe Bloggs Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1164833192.14565.221.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 29 Nov 2006 14:46:32 -0600 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/241 X-Sequence-Number: 23768 On Wed, 2006-11-29 at 13:57, Joe Bloggs wrote: > I created a table in 8.1.5 on Linux with three columns; > > date, bigint and integer. > > Then I populated the table with more than 2 million rows. > > I looked at the size of the file that contained the table and divided > this by the number of rows which gave an average of just over 60 bytes > per row. > > This seems to be quite a large overhead as I would guess that the date > field takes around 4 bytes, the bigint 8 bytes and the integer 4 > bytes. I would have hoped to have had an average size of between 20 > and 30 bytes per row. Is this normal and is there any way of improving > this as I'm hoping to use have around 80 million rows in a table > without it taking up too much disk space and too much memory to cache > it? Had you done any updates to the tables? If so, had you run a vacuum full?