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.

Schema Definition

TL;DR

Five ways to define schemas: manual design, inference from data, smart analysis, AI-assisted design, and predefined templates.

Manual Design

Schema definition is crucial for performance in ClickHouse. You can manually define your schemas, but there are other options to get assistance and make the best possible decisions.

CREATE TABLE analytics_events ( event_time DateTime CODEC(Delta, ZSTD), user_id UInt32, session_id String, event_type LowCardinality(String), properties String -- JSON string ) ENGINE = MergeTree()

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

Schema Definition | ClickHouse for Developers