Re: NULL saves disk space?

Поиск
Список
Период
Сортировка
Искать
От
Phoenix Kiula
Тема
Re: NULL saves disk space?
Дата
Msg-id
BANLkTikW04bgJBd7Td4=CvB85rPY-se2zA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
NULL saves disk space? Phoenix Kiula <phoenix.kiula@gmail.com>
Re: NULL saves disk space? Simon Riggs <simon@2ndQuadrant.com>
Re: NULL saves disk space? Phoenix Kiula <phoenix.kiula@gmail.com>
Re: NULL saves disk space? David Johnston <polobo@yahoo.com>
Re: NULL saves disk space? "Massa, Harald Armin" <harald@2ndquadrant.de>
Re: NULL saves disk space? David Johnston <polobo@yahoo.com>
On Thu, Apr 28, 2011 at 10:59 PM, Simon Riggs  wrote:
> On Wed, Apr 27, 2011 at 5:24 PM, Phoenix Kiula  wrote:
>> Possibly a dumb question but there isn't much about this.
>> http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=postgresql+null+value+disk+space
>> I have some BOOLEAN columns. 90% of the cases of the columns is FALSE. Do I
>> save disk space by having them as NULL instead of FALSE? So my application
>> would have conditional code for NULL and TRUE, instead of FALSE and TRUE.
>> Thanks...
>
> Yes, NULL values take no additional space, but the row needs a null
> bitmap so it is possible that if this was the only NULL then it could
> occupy more space.
>
> If you have multiple columns, then you should use NULLs.


Thanks Simon. (And others for good advice, but that was not my
question. I already know using boolean as TRUE/FALSE is sensible. But
I have a peculiar reason for asking what I am.)

Simon, if I understand you correctly -- more than one column in a row
should have NULL for NULL to be useful in saving space? What if in a
row there are many columns but only one will be NULL?

Thanks
В списке pgsql-general по дате отправления
От: Adrian Klaver
Дата:
От: David Johnston
Дата:
Сообщение: Re: NULL saves disk space?
FAQ