As I understand, MySQL doesn’t have any special SPARSE COLUMN directive, and any question like this is purely situational, so I’m wondering if there is a good rule of thumb for when to use a sparse column vs. when to create another table.
As a specific example, I have a table called Lessons. We want to add a lesProgramNumber, but this will only apply to about 10% of all lessons at any given time (it will be NULL for the other 90%). We could avoid a lot of NULL data by having a LessonsProgramNumber table very easily, but then this requires an additional JOIN at times. Is there an easy way to make a choice about what I need? What if Lessons only has 500 rows? What if it has 500 million?
InnoDB’s COMPACT row format (which is the default) does not store anything when a column is NULL; it only stores non-null columns. It just skips that column in the on-disk row storage. So the cost of sparse columns is not so bad.
See http://dev.mysql.com/doc/refman/5.1/en/innodb-physical-record.html