Skip to content
Theory · ClickHouse: Aggregates, Materialized Views, MergeTree Engines · lesson 8 of 12

Materialized views

Someone has to fill the daily totals table from the previous lesson. You could run a query "add up yesterday's sales" on a schedule, but then the totals lag a day behind, and a missed run leaves a hole. In ClickHouse the server writes the totals itself, at the moment the sales arrive.

In this lesson

  • A view as a trigger
  • New inserts only
  • Each insert on its own
  • Common mistake
  • Key points