Re: Postgres table size

From: SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Erik Jones <erik(at)myemma(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres table size
Date: 2007-11-21 18:29:41
Message-ID: 777464.49269.qm@web31112.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Tom and Erik and all the others who helped.
You guys really rock!!!
Sharmila

----- Original Message ----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com>
Cc: Erik Jones <erik(at)myemma(dot)com>; pgsql-general(at)postgresql(dot)org
Sent: Wednesday, November 21, 2007 1:14:02 PM
Subject: Re: [GENERAL] Postgres table size

SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com> writes:
> 1. How do you find the MAXALIGN of the machine? And what is that
used for?

pg_controldata will show "maximum data alignment". A rule of thumb is
that it's 4 on 32-bit machines and 8 on 64-bit machines, but there are
exceptions.

> 2. How does null columns account for this space.

If there are any nulls in a row then you pay for a null bitmap with 1
bit/column, but the null columns themselves aren't stored and hence
take zero space. In your example the bitmap needs 10 bits, but after
allowing for alignment the effect is that the heap tuple header gets
4 bytes bigger if there's any nulls.

regards, tom lane

____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-11-21 18:43:03 Re: loading a funtion script from a file
Previous Message Tom Lane 2007-11-21 18:23:39 Re: Restart a sequence regularly