I have a pretty big table in InnoDB, and I want to minimize its size, within reason. For a few of the columns, the values are almost always the same in every row, so I want to try to take advantage of this.
For example, if I have an int
column (or datetime
or varchar
or whatever), would a null
value in that column not actually be stored on disk? That is, would it be smaller than storing the number 1
in every row?
Or in an int not null default 0
column, would 0
take up less space than 1
, or even no space at all?
(I know I can just try it on some big tables, but for my real data it'd be slow to try, and measuring sizes of things in databases can be finicky, so I'd like to hear somebody speak somewhat knowledgeably!)