Comment by magicalhippo
Comment by magicalhippo 9 hours ago
> Also, understand how your DB handles nulls.
Also in regards to indexing. The DBs I've used have not indexed nulls, so a "WHERE col IS NULL" is inefficient even though "col" is indexed.
If that is the case and you really need it, have a computed column with a char(1) or bit indicating if "col" is NULL or not, and index that.
NULL should generally never be used to "mean" anything.
If your business rules say that "not applicable" or "no entry" is a value, store a value that indicates that, don't use NULL.