The official ClickHouse 26.10 release presentation is dated October 22, 2026 (official release materials). That release date does not mean expired TTL data disappears from disk at once: TTL cleanup runs through background processing, and a lightweight delete may not immediately remove the underlying data files. First check active parts, the TTL rule, merge activity, and filesystem space. Choose a cleanup action only after you know which stage is holding space; do not treat a forced merge as a universal emergency fix.
This guide is for DBAs maintaining ClickHouse log, metric, or trace data who need to find out why disk use stays high after expiration.
It also helps data engineers distinguish a retention-rule mismatch from delayed cleanup.
If you plan dedicated database storage, use the checks here to decide whether capacity is actually short or cleanup is simply pending.
Why TTL expiration does not immediately free disk
A TTL expression defines when data becomes eligible for removal; it is not a promise that the filesystem will reclaim space at that exact moment. ClickHouse handles expired data through background work. Until that work processes the relevant parts, those files can remain present and contribute to disk usage. The official guidance on deleting old data describes this TTL behavior and the available approaches.
Start by separating three measurements:
- Filesystem free space: what the operating system reports for the volume that holds the table data.
- Active part size: the data ClickHouse currently considers active for a table.
- Table-level totals: a broader view that can obscure which partition or part is responsible.
These values do not have to move in lockstep. For example, an old part can still be active while a merge or TTL task is pending. Conversely, ClickHouse’s active-part totals may change before you see the expected change in filesystem free space. Record the measurements at the same time and on the same host; comparing a table total from one moment with a filesystem reading from another can send you toward the wrong fix.
Treat “TTL expired” as an eligibility condition, not a disk-space guarantee. Identify the part and the cleanup stage before you change the retention rule.
ClickHouse 26.10 is the version context for this investigation, not proof that every cleanup delay is a version defect. Confirm your exact server build and check its matching documentation before relying on version-specific behavior.
Which active tables and partitions still occupy disk?
Use system.parts to locate active data parts and compare their sizes by table and partition. The ClickHouse engineering guide to debugging with system tables explains how system-table evidence helps narrow down operational issues.
For a table-level view:
SELECT
database,
table,
count() AS active_parts,
sum(rows) AS active_rows,
sum(bytes_on_disk) AS active_bytes
FROM system.parts
WHERE active
AND database = 'analytics'
GROUP BY database, table
ORDER BY active_bytes DESC;
Then inspect the largest partitions:
SELECT
database,
table,
partition,
count() AS active_parts,
sum(rows) AS active_rows,
sum(bytes_on_disk) AS active_bytes
FROM system.parts
WHERE active
AND database = 'analytics'
AND table = 'events'
GROUP BY database, table, partition
ORDER BY active_bytes DESC;
Replace the example database and table names with yours. These queries report active parts, not a complete explanation of filesystem usage. Compare their results with the relevant filesystem readings and the storage location reported by your own deployment. If the largest active partitions contain data older than your intended retention cutoff, investigate the TTL rule and the data’s time values before attempting cleanup.
| Observation | Likely area to investigate | Next check |
|---|---|---|
| Old data remains in active parts | TTL expression, time column, or row timestamps do not match expectations | Inspect the table definition and sample rows around the cutoff |
| Active parts are large, but the cutoff has passed | TTL work may be pending or the part may not yet have been processed | Check merge activity and server logs |
| Active-part totals look lower, but filesystem space has not recovered | Other files, inactive data, or different disk paths may account for the gap | Compare host-level disk usage with ClickHouse storage paths |
| Only some partitions retain old data | Partition boundaries or data distribution may not align with the retention rule | Check partition keys and the timestamps in affected parts |
The table narrows the investigation; it does not diagnose the cause on its own. A large partition can be expected if the table receives data with late timestamps, uses a different time zone than your retention assumption, or stores the retention column in an unexpected form.
When does a lightweight delete remove the data files?
A lightweight delete and a TTL rule are not interchangeable signals. A lightweight delete can mark matching rows so that queries no longer return them, while physical cleanup of the affected data can happen later through background processing. As a result, a query returning fewer rows does not, by itself, prove that disk space has been reclaimed. ClickHouse’s guide to updates and deletes explains the different deletion approaches and why partition design matters.
If you used a delete operation, identify which mechanism ran and whether its follow-up work is complete. Check the table definition, the command history available to your team, and the server logs. system.mutations can help you inspect mutation state, but do not assume every TTL cleanup appears there as a mutation. Likewise, system.merges can show merge activity, but a busy merge list is not proof that the particular expired data is being processed.
For TTL behavior, compare the data and rule directly:
- Check the table’s TTL expression and confirm it refers to the intended column.
- Inspect representative values near the retention boundary, including late-arriving or backfilled rows.
- Confirm how the application writes timestamps and whether the rule’s time assumptions match those values.
- Review partition boundaries. A retention rule at row level may not align with the way your operational process removes whole partitions.
Avoid changing a production TTL expression simply because disk use is high. A broader rule can remove records that the application still needs, while a narrower rule can leave the old data untouched. Test any rule change against representative rows and confirm the effect before applying it to the full table.
What to inspect when TTL cleanup stalls
Check the least disruptive evidence first. Look for active merge work in system.merges, review server logs for errors or repeated delays, and verify that the relevant disk has enough free space for normal background work. If the table is replicated, inspect replication health and queued work as well; do not confuse replication delay with a TTL expression that failed to match.
A report in the ClickHouse GitHub issue tracker discusses a specific case involving pending work after TTL materialization. Treat it as an individual issue to compare against your symptoms, not as evidence that all ClickHouse 26.10 installations behave the same way. Check whether the issue’s conditions resemble your table definition, command sequence, and server build.
Use this sequence before taking a disruptive action:
- Confirm whether the old rows are still in active parts.
- Confirm the TTL rule and sample values around its cutoff.
- Check whether merges are running, failing, or not progressing.
- Check filesystem free space and the actual storage path for the table.
- If replicated, check whether queues or replica health explain the delay.
- Review logs for a table-specific error before retrying an operation.
OPTIMIZE TABLE ... FINAL is not a general-purpose command for forcing immediate space recovery. It can trigger resource-intensive work, and its outcome depends on the table’s parts and the operation required. The ClickHouse engineering note on when to use OPTIMIZE ... FINAL explains why it should not be used reflexively.
Do not drop a partition unless every row in that partition is outside the required retention window. A partition-level operation can remove valid data along with expired data.
ALTER TABLE ... MATERIALIZE TTL may be appropriate when you need to apply a TTL expression to existing data, but it is not a risk-free shortcut. Check the command’s effect for your table and version, estimate the work it will generate, and make sure you have a recoverable backup before scheduling it. Consider DROP PARTITION only when the partition boundary matches the data you intend to remove. Choose the least disruptive action that addresses the confirmed cause.
Capacity planning after the cleanup check
If the TTL rule and background work are behaving as expected, but the retained dataset still approaches the available capacity, treat that as a sizing question rather than a cleanup failure. Estimate from your own measurements: observed compressed data written over a representative period, the actual retention window, existing retained data, and temporary space needed for merges. Do not substitute a generic compression ratio or a fixed “space per day” estimate for your workload.
Compare these factors before changing storage:
- Ingest volume: use measurements from your own tables, including backfills and late-arriving records.
- Retention: calculate the volume that remains under the policy you actually need, not the policy you intended to configure.
- Background headroom: account for the additional space and disk activity your observed merges require.
- Other data on the volume: include logs, temporary files, and other tables sharing the same storage.
- Recovery design: keep backups off the database host so a local disk failure or mistaken deletion does not take out both primary data and the only recovery copy.
That final point matters regardless of server type. A dedicated server does not make a database safe from accidental deletion, disk failure, or a bad retention change. Plan software RAID or replication where appropriate, and keep a separate, tested backup. Do not assume a mirror replaces an off-host backup.
For a longer-running ClickHouse workload, compare your measured storage need with the configurations on the AMDSSH price list. Confirm the current product details and billing terms there rather than assuming a particular capacity will fit your retention target.
Post-change verification and storage choice
After changing a TTL rule or cleanup approach, verify the result from both ClickHouse and the operating system. Repeat the active-part queries, check that the intended partitions and rows remain, and compare filesystem free space on the same storage path you recorded earlier. If data is still being processed, keep monitoring the relevant merges and logs instead of issuing repeated cleanup commands.
Use this change review before closing the incident:
- [ ] Save the current table definition and the TTL rule you plan to change.
- [ ] Confirm that an off-host backup exists and that your recovery process is usable.
- [ ] Record active rows and bytes by table and partition, plus filesystem free space.
- [ ] Identify whether the issue is a rule mismatch, pending background work, or genuine capacity pressure.
- [ ] Choose a cleanup action that matches the table’s partition boundaries and data requirements.
- [ ] Recheck query results, active parts, logs, and filesystem space after the change.
- [ ] Document the retention policy and the evidence that confirms the intended data was removed.
If the measurements point to a real capacity limit, the decision is different from a temporary cleanup delay. Shared VPS and public-cloud instances can suit short-lived tests or light workloads, but shared CPU contention, storage limits tied to service tiers, and restricted control over disk layout can make a stable analytics database harder to plan. If you need sustained database resources and control over directly attached storage, AMDSSH’s dedicated AMD physical servers are worth comparing with your measured retention and merge workload. The listed configurations include an EPYC 7543P, ECC memory options, and directly attached NVMe drives; confirm the current options in the product list before choosing. Review the ordering page only after your off-host backup and recovery plan is in place.
Further reading
EPYC 7543P dedicated serverFrom $450.2/month
