
Unlock this content
Enter your email to unlock this content for free
Your First Materialized View
Materialized views let you filter, extract JSON fields, aggregate, and transform data at insert time. In OSS ClickHouse, you create a landing table, target table, and materialized view, but historical data must be manually backfilled. Tinybird simplifies this with automatic backfilling and an easier workflow. Tinybird Code is an AI expert for ClickHouse database that receives natural language prompts and generates the required resources automatically.
Use Cases for Materialized Views
Materialized views are perfect for several common patterns:
- Filtering: Route different event types to different tables (e.g., filter page hits from all events)
- Extract JSON: Parse JSON payloads and extract fields as columns at insert time
- Aggregate: Pre-compute sums, counts, averages, and other aggregations for faster queries
- Transform: Apply transformations, enrichments, or data cleaning as data arrives
You can combine these patterns to build complex data pipelines that preprocess data at insert time.