Re: postgresql storage and performance questions - Mailing list pgsql-general

From Trevor Talbot
Subject Re: postgresql storage and performance questions
Date
Msg-id 90bce5730711192137v65f8d320ped70d5a0bdfc4d34@mail.gmail.com
Whole thread Raw
In response to Re: postgresql storage and performance questions  ("Josh Harrison" <joshques@gmail.com>)
Responses Re: postgresql storage and performance questions  ("Josh Harrison" <joshques@gmail.com>)
List pgsql-general
On 11/19/07, Josh Harrison <joshques@gmail.com> wrote:

> I have 2 tables with 2 cols each( 1 numeric(8,0) and 1 varchar(3) ).
> In table1 both the cols are filled and in table2  the varchar colm is null
>
> So when I checked the tablesize for these two tables (using pg_relation_size)
> table1 - 57344 bytes (no null columns)
> table2 - 49152 bytes (varchar colm is null)
>
> There is not much difference between the two sizes.So even if a column
> is null postgresql still has lots of overhead.
>  Does postgres occupy space even when the column is NULL?

PostgreSQL's disk storage works in "pages", where each page is 8KB.
It will use as much space within each page as it can.  Filip's last
link details this.

Is there a specific reason you're looking at this, as in you have some
requirement to meet?  Or just curious how it works?

pgsql-general by date:

Previous
From: "Sean Davis"
Date:
Subject: Re: plpython array support
Next
From: Philip Semanchuk
Date:
Subject: plpythonu under OS X 10.4 -- a brief HOWTO