
Unlock this content
Enter your email to unlock this content for free
Nullable Columns
TL;DR
Nullable types allow columns to store NULL values, but they add 10-20% storage overhead and can slow queries. Avoid Nullables when possible. Use defaults instead unless NULL has meaning.
The Cost of Nullable
Nullable columns add overhead:
- Storage - Extra bitmap to track NULL values (10-20% overhead)
- Performance - Additional processing to check NULL bitmap; slightly slower queries; more complex execution plans
- Semantics - Decision depends on whether NULL has special meaning in your domain
When to Use Each
Use Nullable when:
- NULL has distinct semantic meaning (e.g., "not applicable" vs "unknown")
- You need to distinguish between "no value" and "zero/empty"