Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[INTERFACES] Initial database size on disk

1 view
Skip to first unread message

Murray Cumming

unread,
Jun 19, 2010, 7:54:14 PM6/19/10
to
When using the initdb command-line utility to create a new PostgreSQL
database cluster, is there any way to specify the starting size used on
disk? By default it seems to take around 38MB.


--
mur...@murrayc.com
www.murrayc.com
www.openismus.com


--
Sent via pgsql-interfaces mailing list (pgsql-in...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-interfaces

Simon Riggs

unread,
Jun 19, 2010, 8:22:04 PM6/19/10
to
On Sun, 2010-06-20 at 01:54 +0200, Murray Cumming wrote:

> When using the initdb command-line utility to create a new PostgreSQL
> database cluster, is there any way to specify the starting size used on
> disk? By default it seems to take around 38MB.

Why do you want to do that? Make it bigger, or smaller?

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Training and Services

Murray Cumming

unread,
Jun 20, 2010, 4:23:34 AM6/20/10
to
On Sun, 2010-06-20 at 01:22 +0100, Simon Riggs wrote:
> On Sun, 2010-06-20 at 01:54 +0200, Murray Cumming wrote:
>
> > When using the initdb command-line utility to create a new PostgreSQL
> > database cluster, is there any way to specify the starting size used on
> > disk? By default it seems to take around 38MB.
>
> Why do you want to do that? Make it bigger, or smaller?

I would like to make it smaller. I use PostgreSQL in my Glom application
to host (initially) small amounts of data, starting a PostgreSQL
instance automatically whenever the data must be opened.

--
mur...@murrayc.com
www.murrayc.com
www.openismus.com

Simon Riggs

unread,
Jun 20, 2010, 6:58:43 AM6/20/10
to
On Sun, 2010-06-20 at 10:23 +0200, Murray Cumming wrote:
> On Sun, 2010-06-20 at 01:22 +0100, Simon Riggs wrote:
> > On Sun, 2010-06-20 at 01:54 +0200, Murray Cumming wrote:
> >
> > > When using the initdb command-line utility to create a new PostgreSQL
> > > database cluster, is there any way to specify the starting size used on
> > > disk? By default it seems to take around 38MB.
> >
> > Why do you want to do that? Make it bigger, or smaller?
>
> I would like to make it smaller. I use PostgreSQL in my Glom application
> to host (initially) small amounts of data, starting a PostgreSQL
> instance automatically whenever the data must be opened.

You can compile it smaller if you want, though you might hit some
problems nobody has seen before.

There appears to be a fair amount of "wasted" space, which tells me
nobody has ever really looked at this.

WAL files are 16MB, so you're main problem is there.

Use a compressed filesystem.

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Training and Services

Tom Lane

unread,
Jun 20, 2010, 11:11:29 AM6/20/10
to
Devrim GUNDUZ <dev...@gunduz.org> writes:
> 20.Haz.2010 tarihinde 02:54 saatinde, Murray Cumming <mur...@murrayc.com
>>> şunları yazdı:

>> When using the initdb command-line utility to create a new PostgreSQL
>> database cluster, is there any way to specify the starting size used
>> on disk? By default it seems to take around 38MB.

> You can recompile PostgreSQL with a smaller wal size, which will
> reduce initial size a bit. I am not sure about the side effects though.

There might be some value in that if you expect your database instances
will always be small and low in write volume. Otherwise you're just
shooting yourself in the foot for a transitory gain.

regards, tom lane

Devrim GUNDUZ

unread,
Jun 20, 2010, 8:59:08 AM6/20/10
to

20.Haz.2010 tarihinde 02:54 saatinde, Murray Cumming <mur...@murrayc.com
> şunları yazdı:

> When using the initdb command-line utility to create a new PostgreSQL


> database cluster, is there any way to specify the starting size used
> on
> disk? By default it seems to take around 38MB.

You can recompile PostgreSQL with a smaller wal size, which will

reduce initial size a bit. I am not sure about the side effects though.

Regards.
--
Devrim GÜNDÜZ
PostgreSQL DBA @ Akinon/Markafoni, Red Hat Certified Engineer
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz

0 new messages