Re: NULL saves disk space?

Поиск
Список
Период
Сортировка
Искать
От
Massa, Harald Armin
Тема
Re: NULL saves disk space?
Дата
Msg-id
BANLkTimP6GZ2HcMB51Uv3YtsBgMHjWRUyg@mail.gmail.com
Ответ на
NULL saves disk space? (Phoenix Kiula)
Список
Дерево обсуждения
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>
>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.

The short answer:
do not even think about it.

NULL has  a well defined meaning within SQL: "we do not know the
value", with "well defined" being something totally different from
"intuitive".

With "using NULL as false" you woud get:

select whatever from yourtable where not (booleancolumn = true )

would result in ....wait for it .... zero rows.

Because "NULL" is not "not =" to true.

There is no potential diskspace saving in the world that could be
worth those troubles.

Harald

-- 
Harald Armin Massa     www.2ndQuadrant.de
PostgreSQL  Training, Services  and Support

2ndQuadrant Deutschland GmbH
GF: Harald Armin Massa
Amtsgericht Stuttgart, HRB 736399
В списке pgsql-general по дате отправления
От: Simon Riggs
Дата:
Сообщение: Re: NULL saves disk space?
От: Alban Hertroys
Дата:
Сообщение: Re: GIN index not used
FAQ