Re: size cost for null fields

Поиск
Список
Период
Сортировка
Искать
От
Gregory Stark
Тема
Re: size cost for null fields
Дата
Msg-id
87prx92lj9.fsf@oxford.xeocode.com
Ответ на
size cost for null fields (Vance Maverick)
Список
Дерево обсуждения
size cost for null fields "Vance Maverick" <vmaverick@pgp.com>
Re: size cost for null fields Gregory Stark <stark@enterprisedb.com>
"Vance Maverick"  writes:

> Do I have this right?  If so, the side table sounds like the right choice....

No, if the null bit is set then the field isn't stored at all. You don't pay
the alignment or storage overhead at all.

The only cost is for the null bitmap itself. If you have *any* null fields
then you pay one bit for *every* field plus alignment to a 4-byte boundary.
Except there's one available free byte so if you have 8 or fewer fields even
that is entirely free.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!
В списке pgsql-general по дате отправления
От: Gregory Stark
Дата:
От: Andrej Ricnik-Bay
Дата:
Сообщение: Re: Hijack!
FAQ