Re: [OT] "advanced" database design (long)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [OT] "advanced" database design (long)
Дата
Msg-id 5717.1202148416@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [OT] "advanced" database design (long)  (Jorge Godoy <jgodoy@gmail.com>)
Ответы Re: [OT] "advanced" database design (long)
Список pgsql-general
Jorge Godoy <jgodoy@gmail.com> writes:
> Em Monday 04 February 2008 07:03:47 Dawid Kuroczko escreveu:
>> Well, but PostgreSQL's NULLs occupy almost no space, or rather a bit of
>> space, that is one bit exactly. ;-)  I am pretty much sure that
>> storage-wise looking NULLs
>> are more efficient.

> I'd say 1 byte every 8 NULLs instead of 1 bit.  If you only have 1 NULL, it
> will cost you 1 byte (not 1 bit).  If you have 9, it will cost you 2 bytes
> (not 9 bits).

This is not quite right --- the amount of space used doesn't change if
you have more or fewer nulls in a row.  A null bitmap is present in a
row if there are any nulls at all in the row, and its size will be equal
to the defined number of columns in the table.  As you say, there's
padding overhead too ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PGSQL ERROR: FATAL: terminating connection due to administrator command
Следующее
От: Greg Smith
Дата:
Сообщение: Re: postgresql book - practical or something newer?