pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shane Ambler <pgsql@Sheeky.Biz>
To: Duan Ligong <l-duan@zd.cnes.jp.nec.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: ]To estimate the size of db
Date: Thu, 22 May 2008 16:04:19 +0930
Message-ID: <483513EB.6080500@Sheeky.Biz> (raw)
In-Reply-To: <00ba01c8bba8$5b402750$f623480a@nsl.ad.nec.co.jp>
References: <004301c8b62b$b183e840$f623480a@nsl.ad.nec.co.jp>
	<dcc563d10805211208l27b6cb1as5951112bf504ffaa@mail.gmail.com>
	<00ba01c8bba8$5b402750$f623480a@nsl.ad.nec.co.jp>

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



view thread (7+ messages)  latest in thread

Message-ID: <483513EB.6080500@Sheeky.Biz>
Permalink:  ../483513EB.6080500@Sheeky.Biz/
Also on:    postgresql.org/message-id/483513EB.6080500@Sheeky.Biz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pgsql@Sheeky.Biz, l-duan@zd.cnes.jp.nec.com, scott.marlowe@gmail.com
  Subject: Re: ]To estimate the size of db
  In-Reply-To: <483513EB.6080500@Sheeky.Biz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox