Search Postgresql Archives

Re: size cost for null fields

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

 



"Vance Maverick" <vmaverick@xxxxxxx> writes:

> Do I have this right?  If so, the side table sounds like the right choice....

No, if the null bit is set then the field isn't stored at all. You don't pay
the alignment or storage overhead at all.

The only cost is for the null bitmap itself. If you have *any* null fields
then you pay one bit for *every* field plus alignment to a 4-byte boundary.
Except there's one available free byte so if you have 8 or fewer fields even
that is entirely free.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[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