ALTER TABLE UPDATE and DELETE Mutation Costs
Mutation cost comes from rewritten data parts, not changed rows.

ALTER TABLE UPDATE and DELETE mutation costs depend less on how many rows change than on how much stored data must be rewritten. That gap can turn a small correction into cluster-wide work. The safest strategy is to understand the physical cost, choose where it can be absorbed, and, above all, design application writes so fewer mutations need to run.
Why ALTER TABLE mutations cost so much more than they appear to
Changing a single row still rewrites every row in the data part that contains it. The part is immutable after it is written. A change therefore requires reading the part, writing a new version with the change applied, and discarding the old version. The SQL describes a small logical change, but the storage engine must perform a much larger physical operation.
The part format determines how much must be rewritten. Wide-format parts store each column in its own file, so unaffected columns can be hardlinked while only mutated columns are rewritten. Compact-format parts store all columns in one file per part, so the whole file must be rewritten even when only one column changes. That distinction changes the cost of an otherwise identical request.
What happens when matching rows are spread throughout a large table? The mutation may write as much data as the entire table contains, regardless of how few rows matched. This is write amplification, and it follows directly from the immutable-part design. The affected parts and their format explain the work more accurately than the apparent size of the correction.
Where the cost goes after the rewrite starts — I/O, merge contention, and replica fan-out
The rewrite creates disk I/O, but that is only the first cost channel. Mutations also share the background thread pool with merges, while every replica in a ReplicatedMergeTree cluster reruns the mutation independently. A mutation consumes storage bandwidth while occupying threads that would otherwise consolidate parts. Reads must contend with that physical work.
As merge throughput falls, part counts can rise until the system reaches insert-throttling thresholds. The bottleneck then reaches the ingestion path. This link is easy to miss because higher CPU and rising part counts can look like the data is simply growing. A team may add capacity without seeing that mutations are keeping merges from catching up. The visible symptom and its cause sit in different parts of the workload.
A three-replica cluster generates roughly three times the I/O of the same mutation on a single node because each replica performs its own rewrite. Adding replicas does not divide that work. To estimate the physical burden, a team needs to consider the rewrite on one replica and then account for the replication factor. The background contention accompanies those independent executions.
What cluster destabilization actually looks like in practice
One documented case involved three ALTER UPDATE mutations that ran for three days. Each held large volumes of temporary data, and together they blocked all background merges. CPU rose well above its normal baseline, while query latency went up sharply. As mutation work blocked merges, the pressure built up and made the cluster harder to use.
Temporary data, higher CPU, stalled merges, and rising part counts show different sides of the same feedback loop. Taken together, they can distinguish mutation pressure from a simple increase in query demand. The early signals are easy to misread. By the time insert throttling becomes visible, the background backlog may already be severe.
The batching consequence follows from the same mechanism. A thousand small mutations can be a thousand times heavier than one equivalent large mutation when they repeatedly rewrite the same parts. Each request looks modest in isolation. But a loop that fires a mutation for every row or event pays the same physical cost over and over when a batch could pay it once.
The alternatives that exist and what they actually trade away
Lightweight DELETE does less work at first because it marks rows as deleted and leaves them in storage. Physical removal waits for the next merge. That delay is acceptable for many uses, but it does not satisfy a requirement for physical erasure at a specified time. The distinction is between hiding data and removing it. A deletion strategy must answer which of those outcomes the workload requires.
A soft-delete tombstone column makes a different exchange. Setting a flag is cheaper than a multi-column mutation, but in Wide format it still rewrites at least the flag column’s file. Every later read also needs a filter. Compact format further limits the benefit because changing the flag still requires rewriting the shared file.
TTL with partition alignment can avoid row-level rewriting altogether. When the TTL expression and partition key both use monthly granularity, for example, expiry can drop whole partitions through a lightweight metadata operation. This is orders of magnitude cheaper than row-level DELETE. The constraint is in the data layout. It works only when the partition dimension also describes the retention boundary.
For bulk corrections on a live table, insert-select-rename offers a heavier but often more predictable route. It runs as a regular query rather than a background mutation, so it does not compete with merges for background threads. The work still has to be done. Its advantage is where that work runs, while its price is operational complexity. The rename requires brief coordination, and the old table must be dropped separately.
Why application write patterns matter more than tuning at mutation time
Consider a call analytics pipeline that produces intermediate states before a final record. If those intermediate states are never queried, writing and then correcting them creates work with no corresponding read benefit. The application can avoid that mutation pressure by not writing those states. This is a write-path decision. It comes before any attempt to make the later corrections cheaper.
The broader principle is to replace repeated updates to mutable state with appends of immutable facts. Appends are a natural fit for the part-based storage model. Mutations compensate for data arriving in a shape that model was not designed for. Where the upstream system naturally emits full replacement records rather than diffs, ReplacingMergeTree with a version column offers a better match.
Schema design extends the same principle to unavoidable changes. Partitioning by event_date makes sense for retention-driven deletes because it aligns the layout with the likely removal boundary. Co-locating frequently co-updated columns also helps preserve the benefit of Wide-format hardlinking for unaffected columns. The aim is a smaller mutation surface. How the table is defined sets how much unrelated data a later correction must touch.
Resource controls can manage the remaining contention. PR #93905, a 2025 development, allowed Mutate and Merge background operations to be configured independently through a dedicated background profile, separate from the default query profile. This provided a lever for isolating mutation resource usage from merges. It does not remove the rewrite itself. Tuning can contain competition for resources, but it cannot recover work that the application needlessly created.
Where mutation costs land hardest — AI agent workloads and compliance pipelines
AI agent workloads make small read penalties expensive through repetition. A single conversation can trigger many queries in sequence, while a fleet of concurrent agents can generate thousands of queries per second. Read overhead from unmerged patch parts or FINAL scans is then paid repeatedly across concurrent requests. When serving must take less than a second, there is little room for that overhead. A trade-off acceptable in batch analytics can become costly under sustained agent concurrency.
Compliance pipelines impose a different constraint on the same tables. GDPR erasure requests and similar rules that call for physical removal on a schedule cannot rely on lightweight DELETE that defers removal or on soft-delete tombstones. They force classical mutations or insert-select-rename even when the data also serves real-time agent reads. OpenTelemetry logs, metrics, and traces can intensify this overlap. Their pipelines combine high-rate ingestion with periodic compliance deletion, stressing both paths at once.
For teams facing this overlap, the architectural response is to place mutation-sensitive compliance work on dedicated compute that does not share background threads with query-serving replicas. That requires compute-storage separation or independent replica pools. Interface design provides a separate safeguard. A read-only MCP surface lets agents read, summarize, and explain without triggering mutations through that interface. Requiring mutations to use the HTTP or Cloud API path makes enforcement and audit more tractable.
How compute-storage separation changes the mutation cost equation at the infrastructure level
In a shared-nothing ReplicatedMergeTree cluster, each replica does the full physical rewrite on its own. Compute-storage separation changes that multiplication. Storage is written once, and stateless compute nodes read it through an aggressive local cache. The mutation’s physical work therefore does not grow with the number of compute replicas. Dedicated compute can also run work with many mutations while leaving the background threads of query-serving replicas free.
Open-source ReplicatedMergeTree does not support elastically scaling readers independently from writers without data duplication or full part downloads. A managed architecture with separated storage and compute provides that separation. Self-managed clusters otherwise absorb the replica fan-out by default. The engine’s immutable parts still determine the rewrite, but infrastructure determines how many times it happens and where it competes with queries.
Keeping recent data on NVMe and aging cold parts onto S3/GCS typically removes a significant fraction of the storage bill without measurably changing dashboard latency. Compliance mutations on old cold partitions then no longer run on NVMe. The cost moves with the data. This limits mutation work’s impact on fast local storage serving recent data.
The billing model also changes the cost of periodic spikes. The storage bill is based on compressed TB per month, and the compute bill is based on memory and CPU per hour, but only while replicas run. A mutation-heavy batch can use temporary compute and scale down afterward. That flexibility can be a better fit for occasional deletion or correction jobs than holding expensive compute at steady state.
A decision framework for teams choosing between mutation strategies

Before selecting an operator, a team should ask whether the upstream write pattern can eliminate the change. For changes that remain necessary, three constraints should guide the choice in order: the physical erasure requirement, update rate, and query concurrency during the mutation window. Erasure comes first because it rules out otherwise useful shortcuts. Scheduled physical removal calls for classical mutations or insert-select-rename, with isolated compute where serving pressure requires it.
If physical erasure is not required, the shape of the updates guides the next choice. For high-rate point updates, patch parts, introduced in mid-2025, are the default choice. Streams that replace full records are a good fit for ReplacingMergeTree with a version column. Both defer physical cost to merges and add modest read overhead until merges catch up. Query concurrency decides whether that interim overhead is acceptable.
When the update rate is low and retention aligns with partitions, TTL is the cheapest path. The retention boundary and partition key must describe the same dimension. Whatever strategy is chosen, mutations should be batched rather than fired per row or event against the same parts. A free workload assessment offers a next step for teams that want to audit those patterns against the framework.
If intermediate application states are never queried, they should never be written. The cheapest mutation is the one that never runs.


