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

Re: ]To estimate the size of db

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: Duan Ligong <l-duan(at)zd(dot)cnes(dot)jp(dot)nec(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: ]To estimate the size of db
Date: 2008-05-22 06:34:19
Message-ID: 483513EB.6080500@Sheeky.Biz (view raw or flat)
Thread:
Lists: pgsql-admin
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

In response to

pgsql-admin by date

Next:From: Gerd KoenigDate: 2008-05-22 08:34:26
Subject: Re: ]To estimate the size of db
Previous:From: Duan LigongDate: 2008-05-22 01:08:33
Subject: Re: ]To estimate the size of db

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