Re: Efficient use of space in large table? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Efficient use of space in large table?
Date
Msg-id Pine.LNX.4.44.0207080034150.26776-100000@cm-lcon-46-187.cm.vtr.net
Whole thread Raw
In response to Re: Efficient use of space in large table?  (Curt Sampson <cjs@cynic.net>)
List pgsql-general
Curt Sampson dijo:

> On Fri, 5 Jul 2002, Manfred Koizar wrote:
>
> > first of all, text is ok.  You might want to store NULL instead of ''
> > to squeeze out a few bytes here and there.
>
> Correct me if I'm wrong, but doesn't NULL take up *more* room than ''?
> After all, as soon as you have a NULL, you have to have a null bit array
> in the tuple.

I think that if you have 32 attributes or less in the table, the bitmap
will use the same space as '' (because '' has the 4-byte length).  And
if you have at least one other NULL attribute, the rest come for free.
So no, it won't take more space, AFAIU anyway.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
Officer Krupke, what are we to do?
Gee, officer Krupke, Krup you! (West Side Story, "Gee, Officer Krupke")




pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: CRC function?
Next
From: Steve Lane
Date:
Subject: Re: I am being interviewed by OReilly