Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 16 min read Release mediumAdept

ClickHouse Release 23.12

ClickHouse 23.12 adds experimental Refreshable Materialized Views, which periodically re-run an arbitrary query and atomically replace the results in a target table. That makes complex multi-join aggregations practical where incremental insert-trigger views fall short, and they can also serve as cron-style import/export jobs chained with DEPENDS. In the IMDB example, a refreshable view cuts an actor-summary query from 1.2 s to 3 ms. The release also speeds up SELECT ... FINAL by splitting data into non-intersecting sorting-key ranges, which are processed in parallel without merge logic, so only intersecting ranges pay the merge cost and merges are skipped across partitions when the partition key is a prefix of the sorting key.

Related posts

  • Using Materialized Views in ClickHouse

    ClickHouse mediumAdept

    ClickHouse materialized views act as insert-time triggers that write the result of a SELECT into a target table, letting expensive aggregations be precomputed. On a 1B-row Wikistat dataset, a SummingMergeTree-backed view cuts a top-projects query from 15 seconds to 3 ms, and AggregatingMergeTree with *State()/*Merge() combinators handles min/max/avg the same way. The same mechanism supports compacting history (with source-table TTL), validating and filtering rows via a Null-engine source table, routing invalid data to separate tables, and transforming columns. Practical guidance: keep views per table to around ten or fewer, still GROUP BY at query time since merges are asynchronous, avoid FINAL on large tables, and only aggregate for storage when it reduces rows by roughly 10x.

  • Chaining Materialized Views in ClickHouse

    ClickHouse mediumAdept

    ClickHouse materialized views can be chained so that one view reads from a table populated by another, rather than having several views all read from the same Kafka engine table. Using the Wikimedia recent-changes stream, the walkthrough ingests raw events from Kafka into a MergeTree table and builds per-minute aggregation states (uniqState, sumState) in an AggregatingMergeTree. It then adds a 10-minute rollup view that reads those states with -MergeState combinators. The new view only picks up rows ingested after it is created, so older data has to be backfilled with an INSERT ... SELECT, and queries finish with -Merge combinators.

  • ClickHouse Release 25.4

    ClickHouse mediumAdept

    ClickHouse 25.4 adds lazy materialization, which defers reading column data until it is needed. On a Top-N query over Amazon reviews it cut runtime from 219s to 0.139s, with 40× less I/O and 300× less memory. Other additions are MergeTree tables on read-only object storage that refresh parts, allowing one writer and unlimited readers for data sharing, and a CPU workload scheduler. The scheduler uses CPU resources and hierarchical workloads with max_concurrent_threads and weights. The release also brings experimental correlated subqueries in EXISTS, Apache Iceberg time travel via snapshot timestamps, a table-level default compression codec, persistent databases in clickhouse-local, and SSH access to the public playground.

  • ClickHouse Release 26.6

    ClickHouse mediumAdept

    ClickHouse 26.6 ships 56 features, 79 performance optimizations and 366 bug fixes, marking ten years of ClickHouse as open source. Headline additions include session-scoped hypothetical skip indexes evaluated with EXPLAIN WHATIF, which estimate skip ratios before an index is built (92% vs 77% of granules skipped at granularity 1 vs 128 in a London query on ~487M rows). Refreshable materialized views can now cascade via REFRESH DEPENDS ON without separate timers, avoiding drift between stages. Other changes include ALTER ... ADD ENUM VALUES, in-CLI help backed by system.documentation, clickhouse-local listening as a server, about 3x faster analysis of deeply nested queries, and experimental continuous STREAM queries with cursors.

  • Building a Medallion architecture with ClickHouse

    ClickHouse mediumAdept

    The Medallion architecture's bronze, silver and gold tiers can be built entirely from native ClickHouse features instead of Spark and Delta Lake. Bronze uses insert-optimized MergeTree tables with the JSON type, materialized columns and TTL, fed by S3Queue, ClickPipes or Kafka. Silver is populated by incremental materialized views with dead-letter routing and ReplacingMergeTree for deduplication and CDC, which requires FINAL at query time. Gold uses refreshable materialized views for joins and denormalization, plus AggregatingMergeTree for precomputed aggregates, at the cost of data replication and extra pipeline management.

The quest for software engineering knowledge.

Look:
Layout: