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.

Data Types Rules

TL;DR

Five rules for data type selection: use strict types, prefer minimal precision, avoid Nullables if possible, use LowCardinality for categorical data, and evaluate advanced types carefully.

Five Rules for Data Type Selection

1. Use Strict Types

Unstructured types mean slowness. ClickHouse performs best with well-defined, structured data types.

Prefer explicit types (UInt32, DateTime, LowCardinality(String)), structured schemas, type-specific optimizations.

Avoid generic String for numbers/dates, JSON for frequently queried fields, unstructured types when structured alternatives exist.

2. Prefer Minimal Precision

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

Data Types Rules | ClickHouse for Developers