Search Postgresql Archives

Re: NULL saves disk space?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 27, 2011 at 5:24 PM, Phoenix Kiula <phoenix.kiula@xxxxxxxxx> 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.

-- 
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux