Re: diskspace

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: diskspace
Date: 2013-02-06 08:23:48
Message-ID: CAEzk6fdxpe6hipOwSvVeFbkPhQdQ0WRrUJm+NJ21dNa5nK6_wA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 5 February 2013 20:33, Geoff Winkless <pgsqladmin(at)geoff(dot)dj> wrote:

> http://www.postgresql.org/docs/9.2/static/storage-page-layout.html gives
> detail...
>
> Let's say around 249MB (23 bytes per row, according to that page) for the
> columns you mention, so that leaves 234MB unexplained.
>
> I can see 44 bytes per page header (given 5 columns, so 20 bytes
> ItemIdData, with 24 bytes PageHeaderData). Given page size of 8kb that
> would imply page headers of about 3.3MB over a 611MB table.
>

Of course I got that slightly wrong: ItemIdData is for each row, not for
each column; an extra 4 bytes for each row makes the per-row space 290MB,
leaving 167MB unexplained.

In answer to other questions: the data was inserted in bulk, so there have
been no updates; even so I have run a VACUUM FULL just in case and it makes
no difference.

I'm assuming the remaining 167MB is related to the alignment requirements,
although that does seem quite a lot at 15 bytes per row (perhaps I'm just
unfortunate with the data sizes resulting in poor alignment).

I guess the answer to my question is that there is no answer to my
question; pg just does use a massive (especially in relation to thin but
tall tables) proportion of diskspace for its own purposes.

Thanks again for all the responses.

Geoff

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Albe Laurenz 2013-02-06 11:04:10 Re: diskspace
Previous Message Rosser Schwarz 2013-02-05 20:40:55 Re: diskspace