On 11/19/07, Josh Harrison <[EMAIL PROTECTED]> 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?

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to