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" <vmaverick@pgp.com>)
Список pgsql-general
"Vance Maverick" <vmaverick@pgp.com> 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
Дата:
Сообщение: Re: mssql migration and boolean to integer problems
Следующее
От: "Andrej Ricnik-Bay"
Дата:
Сообщение: Re: Hijack!