Zero Space for False
Whatever your choice, you can set to NULL
instead of 0
and it will take up no extra space (since the database almost always has a NULL
flag for every field of every row, just sitting there; more info here). If you also make sure the default/most likely value is false
, you'll save even more space!
Some Space for True
The value to represent true
requires the space defined by the field type; using BIT
will only save space if a table has multiple such columns, since it uses one byte per 8 fields (versus TINYINT
which uses one byte per field).
TINYINT
has the advantage of allowing you to customize an 8-value bitmask without worrying about managing a bunch of extra columns, and searching is theoretically faster (a single integer field versus several bit fields). But there are some disadvantages such as slower ordering, fancy cross-indexing stuff, and lack of field names. Which to me, is the biggest loss; your database would require external documentation to note which bits did what in which bitmasks.
In any case, avoid the temptation to use TEXT
fields to store booleans or sets of them. Searching through text is a lot more work for the server, and arbitrary naming schemes like "on, off, off" can hurt interoperability.