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

SummingMergeTree: sums on merge

The report "cups and revenue by shop for each day" is read every morning. There is no point computing it from all the sales again: for past days the answer is already known. It is handier to keep a separate table with one row of totals per shop and day.

In this lesson

  • The SummingMergeTree engine
  • How to read such a table
  • What cannot be added
  • Common mistake
  • Key points