Start with the table and partition that are creating active parts, then check the insert pattern and background merge state before changing limits or forcing merges. If small writes are producing parts faster than ClickHouse can merge them, fix the write path first; a larger limit or OPTIMIZE TABLE ... FINAL does not change that pattern.
Suitable for: DBAs working through TOO_MANY_PARTS or rejected INSERT statements on self-managed ClickHouse.
Also useful for: Backend and data engineers reviewing log, event, or CDC writes, and platform leads deciding whether the evidence points to workload design or storage resources.
Key takeaway: A part count is a lead to investigate, not proof that the disk is faulty.
Last updated November 21, 2026. We checked the troubleshooting approach against ClickHouse’s guide to common setup issues and its system-table debugging guide. Confirm setting names and behavior against the documentation for the ClickHouse version you run.
Start 2026 ClickHouse Too Many Parts troubleshooting by defining the symptom
“Too many parts” can describe different operational symptoms. An INSERT may be rejected with TOO_MANY_PARTS; inserts may slow down before an error appears; a query may degrade because it has more parts to consider; or background merges may appear delayed. These symptoms can overlap, but none of them alone proves a particular disk or CPU failure.
Before changing anything, capture the affected database and table, the time window, the exact error text, the client or ingestion job involved, and whether the deployment is standalone or part of a cluster. Preserve relevant server logs and write-job records. This gives you a way to compare the state before and after a change instead of relying on memory.
Also record the table engine and its partition expression. A high count across many tables may point to a broader pattern; a high count concentrated in one table or partition calls for a narrower investigation. ClickHouse’s common-issues guidance discusses frequent small inserts and parts as a known troubleshooting area, but the error still needs to be traced to your own tables and write path.
Find the table and partition where active parts are accumulating
Start with system.parts. Group active parts by database, table, and partition, then sort the largest groups to the top:
SELECT
database,
table,
partition,
count() AS active_parts,
sum(rows) AS rows_in_parts
FROM system.parts
WHERE active
GROUP BY
database,
table,
partition
ORDER BY active_parts DESC;
This query is a locator, not a universal health test. The active_parts count shows where to investigate; rows_in_parts provides context for the amount of data represented by those parts. Compare tables using their engines, partition layout, and ingestion pattern rather than applying one count as a pass/fail threshold. For a deeper explanation of ClickHouse system tables and how to use them during diagnosis, consult the official system-table debugging guide.
Repeat the query and retain the time of each sample. A stable count and a count that keeps rising suggest different conditions. If only one partition grows, inspect the producers writing to that partition. If several tables show a similar pattern, check whether they share an ingestion service or write schedule.
The result answers “where should we look?” It does not establish why the parts exist. A table’s partition key, the distribution of incoming rows, and concurrent writers all affect how many parts are created and which parts can be merged.
Check whether small or frequent writes are producing parts
Review how each client sends data. Look for row-at-a-time inserts, tiny batches, frequent flushes, retries that resubmit data, and multiple independent producers writing to the same table. Include CDC connectors and event consumers in this review: a steady flow of small requests can create a sustained stream of work even when no single request looks unusual.
Where the application can aggregate records before sending them, test client-side batching first. The goal is to reduce unnecessary small write requests while keeping the data freshness and failure-recovery requirements of the application. Decide how the client handles retries and duplicate delivery as part of the change; batching must not make recovery ambiguous.
If client aggregation is not practical, evaluate ClickHouse asynchronous inserts in an isolated environment. The relevant settings include async_insert and wait_for_async_insert. Check the official asynchronous insert guide for how buffering and acknowledgement behavior work, then verify the behavior for your deployed version and client. In particular, make sure the application’s acknowledgement and error-handling expectations match the chosen configuration.
Do not enable asynchronous inserts as a blind workaround. Confirm that the insert path is actually fragmented, test how errors reach the caller, and monitor the active-part trend after rollout. ClickHouse’s best-practice guidance also treats batching as an important part of insert design.
Inspect partition design and merge activity before changing settings
Check whether the partition expression creates more groups than the workload needs. A very fine-grained key or a high-cardinality partition scheme can spread writes across many partitions. When one incoming batch spans multiple partitions, it can create parts in more than one place. Parts in different partitions do not merge with each other, so changing merge pressure alone will not make those partitions combine.
That does not mean you should replace the partition key as an emergency adjustment. Changing partition design is a data-layout and migration decision. First confirm which partitions accumulate parts, inspect how the incoming data maps to them, and plan how existing data and dependent queries will be handled.
Next, inspect merge and mutation activity. Start with the current merge state:
SELECT
database,
table,
elapsed,
progress,
num_parts,
result_part_name,
is_mutation
FROM system.merges;
Check mutations separately:
SELECT
database,
table,
mutation_id,
command,
is_done,
parts_to_do,
latest_fail_reason
FROM system.mutations;
Field availability can vary by ClickHouse version, so check the system-table schema for your deployment if a query does not match. Use the results alongside system logs and available disk-space observations to distinguish active work from errors, blocked work, or competition with other tasks. ClickHouse’s guidance on updates and deletes is relevant when mutations are part of the workload; do not assume that a mutation backlog and an insert-generated part increase have the same cause.
Treat “parts are being created faster than merges can process them” as a hypothesis to verify. Compare repeated part samples with merge activity and the write schedule. If merges are running but the part count continues to rise, revisit the insert rate and partition spread. If merges are absent, failing, or stalled, investigate the corresponding logs, mutations, and resource conditions before concluding that the machine is undersized.
Caution: Raising a parts-related limit may postpone a rejection while allowing the underlying accumulation to continue. Confirm the version-specific setting and its consequences before considering any limit change.
Match the fix to the evidence, then verify the result
Use the narrowest change that addresses the cause you observed. The table below is a decision aid, not a promise that one setting or server change will resolve every incident.
| Evidence | First action | What to verify |
|---|---|---|
| Many small requests target the same table | Aggregate writes in the client where feasible | Fewer fragmented requests and a stable or falling active-part trend |
| Client batching is impractical and inserts arrive in small units | Test asynchronous inserts with the required acknowledgement behavior | Insert results, error visibility, and part trends after the change |
| Active parts cluster in particular partitions | Review partition expression and incoming row distribution | Whether writes are being spread across unnecessary partitions |
| Merge activity or mutations show failures or persistent work | Check the relevant logs, disk space, and competing operations | Whether the underlying failure or contention clears |
| Part accumulation continues despite a corrected write pattern | Reassess resource use against the observed workload | Whether evidence now supports a storage or capacity change |
Avoid treating OPTIMIZE TABLE ... FINAL as a general repair. It does not stop the application from creating new small parts, and forcing a large merge can add work while the underlying pattern continues. Use it only when you have a specific operational reason, understand the impact for the target table, and have checked the version-appropriate guidance.
Before calling the incident resolved, compare part samples from the same tables and partitions, confirm that inserts are succeeding as expected, and check that merge activity has not simply shifted the problem elsewhere. If the change affects data movement or recovery, test the recovery procedure too. Replication and disk redundancy are not substitutes for backups: keep database backups outside the machine and rehearse restoring them.
Use this verification checklist before closing the incident
- [ ] Record the affected table, partition, error text, write clients, and observation window.
- [ ] Query
system.partsby database, table, and partition; repeat the sample to establish direction. - [ ] Inspect the actual batch sizes, flush frequency, retries, and concurrent producers.
- [ ] Review partition-key behavior and whether each write spans multiple partitions.
- [ ] Check
system.merges,system.mutations, logs, and available disk space for failures or competing work. - [ ] Apply one cause-matched change, then verify insert outcomes, part trends, and merge state.
- [ ] Confirm that a backup is stored off-machine and that a restore has been exercised.
Choose server resources only after confirming the workload cause
If batching, partitioning, and merge checks do not explain the continuing problem, use the measurements you collected to reassess resource needs. Compare storage use and growth, write behavior, background work, and the needs of other services on the host. A storage change may be justified by that evidence, but a different server does not automatically correct a workload that keeps producing small parts.
| Current approach | Relevant trade-off | When to reassess |
|---|---|---|
| Shared cloud instance or managed database | Less hardware administration, but compute and storage choices are shaped by the service plan and billing model | When the observed workload repeatedly reaches plan constraints or the cost model no longer fits |
| Self-managed ClickHouse on a shared virtual machine | More control over ClickHouse, but underlying resources may be shared and storage options depend on the virtualized environment | When measured contention or storage requirements cannot be addressed within the current allocation |
| Dedicated AMD physical server | Exclusive machine-level resources and greater control over the database deployment, with hardware, redundancy, and backup responsibilities remaining with your team | When steady workload requirements justify dedicated capacity and your team can operate the data layer |
For a resource review, compare your measured storage layout and operational requirements with the current tbpscloud server configurations. Check the delivery and access details as part of deployment planning. Available configurations and connection details should be verified on those pages; do not infer that a hardware change will remove TOO_MANY_PARTS without fixing the write or partition cause.
Frequently asked questions
How should I fix TOO_MANY_PARTS in ClickHouse?
Identify the affected table and partition in system.parts, then compare repeated samples with the insert pattern and merge state. If small writes are creating parts faster than they can be merged, improve batching or test asynchronous inserts with the required acknowledgement behavior. Raising a limit or running OPTIMIZE TABLE ... FINAL may change the immediate symptom, but neither corrects a continuing small-batch write pattern.
Why can small ClickHouse INSERT batches create so many parts?
MergeTree writes produce data parts that ClickHouse later merges within the same partition. Frequent small inserts can therefore generate many small parts, particularly when independent producers send requests to the same table. Inspect actual client behavior and partition distribution before attributing the issue to disk failure. The official best-practice article discusses insert design as part of operating ClickHouse effectively.
How do I find the ClickHouse partition with the most active parts?
Query system.parts, filter to active parts, group by database, table, and partition, then order by the count. Repeat the query with timestamps to see whether the count is stable or rising. Use the result to narrow the investigation, not as a standalone threshold: interpret it with the engine, partition expression, write distribution, and current merge activity.
Should I change INSERT batching or ClickHouse settings when merges fall behind?
First verify whether the insert stream is creating many small parts and whether merges are running or failing. Client-side aggregation is usually the most direct first test when it fits the application. If it does not, review asynchronous insert behavior and acknowledgement requirements for your ClickHouse version before testing. Change settings only when the evidence identifies a setting-related cause; a blind limit increase does not repair the incoming write pattern.
If your part trend remains high after the write path and merge state have been checked, compare the measured workload with the resources available on your current platform. Shared virtual machines can involve resource contention, constrained storage choices, or plan-based limits; dedicated hardware will not fix an uncorrected insert pattern, but it may be a better fit when the workload needs sustained, exclusive resources. For teams that have confirmed that need, tbpscloud rents dedicated AMD physical servers; use the current configuration listing to judge whether its available options fit your measured ClickHouse requirements before choosing a migration.
Frequently asked questions
How should I fix TOO_MANY_PARTS in ClickHouse?
First identify the affected table and partition in system.parts, then check whether small or frequent INSERTs are creating parts faster than background merges can process them. Review system.merges and system.mutations before changing settings. Prefer batching at the client or carefully tested asynchronous inserts. Raising a parts limit or running OPTIMIZE TABLE ... FINAL does not correct a continuing small-batch write pattern.
Why can small ClickHouse INSERT batches create so many parts?
A write to a MergeTree table creates data parts that ClickHouse later merges within the same partition. Many small writes can therefore create many small parts, especially when several producers write independently. Check the actual client request pattern and table layout rather than assuming that a high part count alone proves a disk fault or a server-wide resource problem.
How do I find the ClickHouse partition with the most active parts?
Query system.parts for active parts, group by database, table, and partition, and sort by the part count. Repeat the query while recording timestamps so you can distinguish a persistently high count from a count that is rising. Interpret the result alongside the table engine, partition key, insert pattern, and merge activity; a single snapshot is a clue, not a diagnosis.
Should I change INSERT batching or ClickHouse settings when merges fall behind?
Check write frequency and merge activity first. If many small requests are creating parts, client-side batching is usually the clearer first change because it reduces the number of write requests reaching the table. If the client cannot batch, test asynchronous inserts in an isolated environment and confirm the acknowledgement behavior you need. Change settings only after verifying their behavior for your ClickHouse version.
Give ClickHouse More Room to Merge with tbpscloud
Choose a dedicated AMD EPYC 7543P server with 32 cores and 64 threads for your ClickHouse workload.
