
Unlock this content
Enter your email to unlock this content for free
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()