Search Postgresql Archives

Boolean storage takes up 1 byte?

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

 



Hi,

I've read the PostgreSQL documentation page on the boolean datatype (http://www.postgresql.org/docs/8.4/static/datatype-boolean.html) to find out what PostgreSQL's definition of a boolean is, as I believe it is distinctive from a bit(1) datatype (as you can't max() a boolean.. not sure what an efficient alternative to that is).  However, I see that a boolean takes up 1 byte of storage, which is 8 bits.  Is this due to the fact that the value can be null?  I'm not clear as to how a null field is stored, or is that the point... nothing references is so it is defined as null?  If that is the case, can't this be stored as 1 bit?  And does its storage as a byte affect indexing or query planning?

Thom

[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