Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 2FBD22E0046 for ; Thu, 22 May 2008 03:35:22 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 39949-02 for ; Thu, 22 May 2008 03:34:59 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by developer.postgresql.org (Postfix) with ESMTP id A4F9E2E003A for ; Thu, 22 May 2008 03:35:00 -0300 (ADT) Received: from ppp247-71.static.internode.on.net (HELO DevBox.local) ([203.122.247.71]) by ipmail01.adl6.internode.on.net with ESMTP; 22 May 2008 16:04:28 +0930 Message-ID: <483513EB.6080500@Sheeky.Biz> Date: Thu, 22 May 2008 16:04:19 +0930 From: Shane Ambler User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Duan Ligong CC: Scott Marlowe , pgsql-admin@postgresql.org Subject: Re: ]To estimate the size of db References: <004301c8b62b$b183e840$f623480a@nsl.ad.nec.co.jp> <00ba01c8bba8$5b402750$f623480a@nsl.ad.nec.co.jp> In-Reply-To: <00ba01c8bba8$5b402750$f623480a@nsl.ad.nec.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/182 X-Sequence-Number: 29266 Duan Ligong wrote: > I mean I want to estimate the size of the space which the db will occupy. > Now there is no db. With a bit of math and the info here - http://www.postgresql.org/docs/8.3/interactive/storage-page-layout.html you can start to get an idea. Simple calculation would be 23 bytes overhead per row + length of data in columns with one or two extra overhead on some types (like length of string or array) also don't forget that text may be more than one byte per char. A similar estimate for indexes can come into play as well. The final size will likely be a bit larger as you also get issues like data alignment and unused space on a page that doesn't fit a row... -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz