Re:

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Francisco Reyes <lists(at)natserv(dot)com>
Cc: pgsql General List <pgsql-general(at)postgresql(dot)org>
Subject: Re:
Date: 2002-07-04 18:38:31
Message-ID: 200207041838.g64IcVI26416@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Francisco Reyes wrote:
> On the FAQ we have:
>
> CHAR() is best when storing strings that are usually the
> same length. VARCHAR() is best when storing variable-length strings,
> but you want to limit how long a string can be. TEXT is for strings
> of unlimited length, maximum 1 gigabyte. BYTEA is for storing
> binary data, particularly values that include NULL bytes.
>
>
> How much space does "NULL" takes on a varchar.

Zero space. We have a bitmask of NULL columns for every row.

> I have a table where possibly less than 40% of the records will have a
> value. I am wondering if I should go with a second table for those that
> have the values or if NULL is small enough that it won't be much an
> overhead for the possibly 60% instances when the column would be empty.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

  • at 2002-07-04 18:06:31 from Francisco Reyes

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2002-07-04 18:43:58 Re: repeatable crash generating two column index
Previous Message Bruce Momjian 2002-07-04 18:36:37 Re: I am being interviewed by OReilly