---
title: "How we built fast UPDATEs for the ClickHouse column store – Part 2: SQL-style UPDATEs"
description: "ClickHouse implemented standard SQL UPDATE in its MergeTree column store by evolving from classic mutations (which rewrite whole affected columns and hard-link unchanged ones) through lightweight DELETEs via a _row_exists mask column and on-the-fly in-memory updates, to patch parts."
url: "https://swe.quest/articles/how-we-built-fast-updates-for-the-clickhouse-column-store-part-2-sql-style-412c85fd8f57d493"
canonical: "https://clickhouse.com/blog/updates-in-clickhouse-2-sql-style-updates"
source: "ClickHouse"
published: "2025-07-24"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 20
tags: ["storage-engines","analytics","databases","sql"]
---

# How we built fast UPDATEs for the ClickHouse column store – Part 2: SQL-style UPDATEs

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-07-24, 20 min read, Deep dive. Original: [https://clickhouse.com/blog/updates-in-clickhouse-2-sql-style-updates](https://clickhouse.com/blog/updates-in-clickhouse-2-sql-style-updates)

## Summary

ClickHouse implemented standard SQL UPDATE in its MergeTree column store by evolving from classic mutations (which rewrite whole affected columns and hard-link unchanged ones) through lightweight DELETEs via a \_row\_exists mask column and on-the-fly in-memory updates, to patch parts. A patch part is a compact delta containing only changed column values plus \_part and \_part\_offset metadata. It is visible to queries immediately and applied during normal background merges in a single linear pass, with no resorting or extra indexing. This avoids full column rewrites and blocking on prior merges, making frequent row-level updates practical (experimental in 25.7, beta expected in 25.8).

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

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

## Prerequisites

- columnar storage basics
- ClickHouse MergeTree parts and merges ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- SQL UPDATE semantics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

ClickHouse, MergeTree, patch parts, lightweight updates, mutations, ReplacingMergeTree

## 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.
- [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.
- [How we made ClickHouse UPDATEs 1,000× faster (Part 3: Benchmarks)](https://swe.quest/articles/how-we-made-clickhouse-updates-1-000-faster-part-3-benchmarks-0d540536665217da.md): ClickHouse · 2025-08-07 · Hard · 17 min read · Analytics & OLAP, Storage engines, Performance engineering, Databases
  ClickHouse's new standard SQL UPDATEs, implemented as lightweight patch parts, make changes visible up to ~1,000–1,700× faster than classic mutations on a 600M-row TPC-H lineitem table: one bulk update dropped from about 100 s to 60 ms. The benchmark compares classic mutations, on-the-fly mutations, lightweight updates and ReplacingMergeTree inserts for both bulk and single-row updates, measuring time to visibility and worst-case query slowdown before merges.
- [ClickHouse Release 25.7](https://swe.quest/articles/clickhouse-release-25-7-3deecef07d4b1ccf.md): ClickHouse · 2025-08-08 · Medium · 13 min read · Analytics & OLAP, Query engines, Storage engines, Performance engineering
  ClickHouse 25.7 adds standard SQL UPDATE and DELETE built on lightweight "patch parts".
- [ClickHouse and dbt - A Gift from the Community](https://swe.quest/articles/clickhouse-and-dbt-a-gift-from-the-community-edc7ddee62ee1cfc.md): ClickHouse · 2023-02-01 · Medium · 7 min read · Analytics & OLAP, Data pipelines, Open source
  The dbt-clickhouse adapter, started by community contributor Dmitriy Sokolov and later taken over as a vendor-supported plugin, maps dbt's view, table, incremental and ephemeral materializations onto ClickHouse features.

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)
