I want to add a flag to a frequently accessed table in my database. It is logically a boolean that is set for a very small portion of the records <0.1%. I want to ensure that I am not causing a significant performance cost unnecessarily.
Reading the docs and other answers it seems to me that a
BOOLEAN NOT NULL column will take 1 byte in every row (amortized) whereas if I instead use a
BOOLEAN that is
NULL for most rows it will only take 1 bit (amortized, in the boolean bitmap) and one byte where it is set to
What are the advantages and disadvantages to using
NULL instead of
FALSE assuming that I do not and will never need a tristate.