Skip to content

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

ClickHouse 5 min read Release mediumAdept

ClickHouse Newsletter March 2022: There’s a window function for that!

ClickHouse 22.2 makes projections production-ready and on by default. Projections store re-sorted or pre-aggregated copies of table data that queries are automatically routed to when less data must be read. The release also adds insert_deduplication_token for custom block-level deduplication toward exactly-once inserts, a default_table_engine setting, ephemeral columns, experimental NLP text-classification functions, and implicit casting in dictGet. The window-function section shows three queries on the UK Price Paid dataset: comparing a row against its partition average, finding a property's previous sale with lagInFrame, and sorting by window-function results.

Related posts

  • ClickHouse 22.2 Released

    ClickHouse mediumAdept

    ClickHouse 22.2 makes projections production-ready: alternate sort orders and aggregations stored in the same data parts, updated atomically with the main table and chosen automatically by the query optimizer, unlike materialized views. Other additions include settings for append, truncate or new-file behavior when exporting to file/S3/HDFS (Parquet and S3 can't append), custom insert deduplication tokens for exactly-once inserts, EPHEMERAL columns that feed DEFAULT/MATERIALIZED expressions, and automatic repair of broken disks from replicas without a restart. An experimental soft/hard memory limit scheme lets queries exceed a guaranteed limit when memory is free, and kills the most overcommitted query under pressure.

  • ClickHouse Release 26.1

    ClickHouse mediumAdept

    ClickHouse 26.1 ships 25 new features, 43 performance optimizations and 176 bug fixes. The headline change makes deduplication of asynchronous inserts work end to end with dependent materialized views. Per-insert dedup hashes are carried through each flushed batch and checked independently against Keeper state for the base table and each view target, so retries no longer double-count transformed data. The release also adds shorthand syntax for indexing projections (PROJECTION ... INDEX col TYPE basic), DISTINCT on LowCardinality columns that operates on the dictionary, and new introspection tools: system.zookeeper_info, a Keeper web UI and HTTP API, a files column in system.parts, and the mergeTreeAnalyzeIndexes table function showing the row ranges that survive index pruning.

  • ClickHouse Newsletter March 2023: Contributing to ClickHouse

    ClickHouse mediumAdept

    ClickHouse v23.2 ships 18 new features, 30 performance optimisations and 43 bug fixes, headlined by multi-stage PREWHERE, read support for Apache Iceberg v1 tables, and correlation matrix computation. The featured query counts cumulative unique contributors to ClickHouse repositories from GitHub events. A first version uses groupArrayDistinct with a window function over monthly arrays. A more concise version passes uniqState sketches from a subquery and merges them cumulatively with uniqMerge in a window, cutting runtime from 32ms to 24ms. The issue closes with a reading list and upcoming webinars and meetups.

  • ClickHouse projections now behave like true secondary indexes

    ClickHouse mediumAdept

    ClickHouse lightweight projections, which store only a sorting key plus a _part_offset pointer into the base table, now act as true secondary indexes with granule-level pruning instead of only pruning whole parts. Several such projections can combine with each other and with the base table's primary index to narrow the granules a query reads. On the UK price paid dataset, a query filtering on date and town dropped from a 30.7M-row full scan in 0.077 s to about 16k rows in 0.010 s, and EXPLAIN shows both projection indexes pruning granules in turn. Two new settings gate when projection indexes are used, and 26.1 adds a compact `PROJECTION ... INDEX col TYPE basic` syntax.

  • ClickHouse Release 25.6

    ClickHouse mediumAdept

    ClickHouse 25.6 (25 features, 32 performance optimizations, 105 bug fixes) can take a single consistent storage snapshot across all subqueries and CTEs in a SELECT, controlled by enable_shared_storage_snapshot_in_query. Snapshots rely on immutable data parts that a query references until it finishes. Multiple projections can now be combined to prune parts for one query, building on index-like projections that store only the sort key plus _part_offset to cut storage duplication, though pruning is part-level only for now. Other additions include reading Parquet's logical JSON type back as ClickHouse JSON, experimental Time/Time64 types, and new system.codecs and iceberg_history system tables.

The quest for software engineering knowledge.

Look:
Layout: