---
title: "ClickHouse 25.6 summer bonus: CoalescingMergeTree table engine"
description: "CoalescingMergeTree, new in ClickHouse 25.6, consolidates sparse partial-row inserts during background merges by keeping, per sorting key and per column, the latest non-null value as determined by insertion order rather than a timestamp."
url: "https://swe.quest/articles/clickhouse-25-6-summer-bonus-coalescingmergetree-table-engine-dcf20257caf305cb"
canonical: "https://clickhouse.com/blog/clickhouse-25-6-coalescingmergetree"
source: "ClickHouse"
published: "2025-07-14"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 8
tags: ["analytics","storage-engines","databases","sql"]
---

# ClickHouse 25.6 summer bonus: CoalescingMergeTree table engine

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-07-14, 8 min read, Deep dive. Original: [https://clickhouse.com/blog/clickhouse-25-6-coalescingmergetree](https://clickhouse.com/blog/clickhouse-25-6-coalescingmergetree)

## Summary

CoalescingMergeTree, new in ClickHouse 25.6, consolidates sparse partial-row inserts during background merges by keeping, per sorting key and per column, the latest non-null value as determined by insertion order rather than a timestamp. Using an IoT vehicle-telemetry example, it contrasts the approach with UPDATEs, ReplacingMergeTree full-row overwrites, and plain MergeTree with argMax() aggregation that must scan every row. Because merges usually lag behind ingest, queries should still use GROUP BY with argMax() over a timestamp column, or the FINAL modifier, which applies the coalescing logic in memory at query time and makes the timestamp optional.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)

## Prerequisites

- ClickHouse MergeTree basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- SQL aggregation ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

ClickHouse, CoalescingMergeTree, MergeTree, ReplacingMergeTree, argMax, FINAL

## Related posts

- [How we built fast UPDATEs for the ClickHouse column store – Part 1: Purpose-built engines](https://swe.quest/articles/how-we-built-fast-updates-for-the-clickhouse-column-store-part-1-purpose-built-477e921f016259fa.md): ClickHouse · 2025-07-22 · Medium · 12 min read · Analytics & OLAP, Storage engines, Databases
  ClickHouse avoids slow in-place row updates in its column store by expressing updates and deletes as inserts that get resolved during the background merges MergeTree already performs.
- [ClickHouse Release 23.12](https://swe.quest/articles/clickhouse-release-23-12-36e0c0d21cc33770.md): ClickHouse · 2024-01-11 · Medium · 16 min read · Analytics & OLAP, Query engines, SQL, Performance engineering
  ClickHouse 23.12 adds experimental Refreshable Materialized Views, which periodically re-run an arbitrary query and atomically replace the results in a target table.
- [ClickHouse Release 24.6](https://swe.quest/articles/clickhouse-release-24-6-003c18b45227c882.md): ClickHouse · 2024-07-11 · Medium · 15 min read · Analytics & OLAP, Storage engines, Python, Performance engineering
  ClickHouse 24.6 adds an optimize\_row\_order setting for plain MergeTree tables.
- [ClickHouse Release 24.12](https://swe.quest/articles/clickhouse-release-24-12-a4df30e6ccdd0296.md): ClickHouse · 2025-01-09 · Medium · 15 min read · Analytics & OLAP, Query engines, Performance engineering, SQL
  ClickHouse 24.12 adds LIKE and unknown-value equality/IN support for Enums, an experimental descending MergeTree sorting key, JSON subcolumns as primary key columns, Iceberg REST catalog (Unity, Polaris) and schema evolution support, and automatic JOIN side swapping via query\_plan\_join\_swap\_table.
- [Handling Updates and Deletes in ClickHouse](https://swe.quest/articles/handling-updates-and-deletes-in-clickhouse-197a09a41f4d2486.md): ClickHouse · 2023-03-10 · Medium · 13 min read · Analytics & OLAP, Databases, Storage engines, SQL
  ClickHouse offers several ways to modify mostly-immutable analytical data, each with different costs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
