Skip site navigation (1) Skip section navigation (2)

Re: estimating table size

From: Ian Barwick <barwick(at)gmail(dot)com>
To: David Parker <dparker(at)tazznetworks(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: estimating table size
Date: 2004-07-26 22:39:06
Message-ID: 1d581afe04072615397222824f@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
On Mon, 26 Jul 2004 18:14:06 -0400, David Parker
<dparker(at)tazznetworks(dot)com> wrote:
> Given a table, foo, created in a database but not populated, is there a
> procedure that will return an estimate of the size of a given tuple in
> that table? It looks like pgstattuple reports on actual table pages; I'm
> looking for something that reads the lengths of each row, and knows what
> the storage overhead would be (extra 4 bytes for varchar, for instance).
> 
> Alternatively, is there documentation somewhere that can give me a good
> rule of thumb for this? I can add up the lengths of the columns and make
> my own judgements about averages for varchar columns. The "hidden"
> storage overhead is what I'm wondering about, I guess.

There is a little info in the FAQ:
http://www.postgresql.org/docs/faqs/FAQ.html

particularly sections 4.6 and 4.14

Ian Barwick
barwick(at)gmail(dot)com

In response to

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2004-07-27 01:00:26
Subject: Re: vacuumdb hanging database cluster
Previous:From: Igor ShevchenkoDate: 2004-07-26 22:29:11
Subject: parsing binary varchar[]-s

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group