Re:

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re:
Дата
Msg-id 200207041838.g64IcVI26416@candle.pha.pa.us
обсуждение исходный текст
Ответ на ...  (Francisco Reyes <lists@natserv.com>)
Список 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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



В списке pgsql-general по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: I am being interviewed by OReilly
Следующее
От: nconway@klamath.dyndns.org (Neil Conway)
Дата:
Сообщение: Re: repeatable crash generating two column index