Re: postgresql storage and performance questions

From: "Trevor Talbot" <quension(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql storage and performance questions
Date: 2007-11-20 05:37:46
Message-ID: 90bce5730711192137v65f8d320ped70d5a0bdfc4d34@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/19/07, Josh Harrison <joshques(at)gmail(dot)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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shane Ambler 2007-11-20 07:34:28 Re: Need help with complicated SQL statement
Previous Message Sean Davis 2007-11-20 03:10:16 Re: plpython array support