Unlock this content

Enter your email to unlock this content for free

By continuing, you agree to our Terms of Service and Privacy Notice, and to receive occasional marketing emails.

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"

Tinybird is not affiliated with, associated with, or sponsored by ClickHouse, Inc. ClickHouse® is a registered trademark of ClickHouse, Inc.

Nullable Columns | ClickHouse for Developers