> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# shared_merge_* MergeTree table settings

> ClickHouse MergeTree table settings in the shared_merge_* generated group.

These settings are available in [system.merge\_tree\_settings](https://clickhouse.com/docs/reference/system-tables/merge_tree_settings.md) and are autogenerated from ClickHouse source.

## shared\_merge\_tree\_activate\_coordinated\_merges\_tasks

Type

Bool

Default

0

Activates rescheduling of coordinated merges tasks. It can be useful even when
shared\_merge\_tree\_enable\_coordinated\_merges=0 because this will populate merge coordinator
statistics and help with cold start.

## shared\_merge\_tree\_blobs\_list\_inline\_file\_max\_bytes

Type

UInt64

Default

0

Store files of a blob-list part that are at most this many bytes long (e.g.
count.txt, metadata\_version.txt, minmax indexes) directly inside the
consolidated blobs.list file instead of a separate object-storage blob,
saving one blob write and read per small file. 0 disables inlining. Takes
effect only for parts using the blob-list storage (see
shared\_merge\_tree\_use\_blobs\_list\_for\_parts). Only available in ClickHouse Cloud.

## shared\_merge\_tree\_create\_per\_replica\_metadata\_nodes

Type

Bool

Default

0

Enables creation of per-replica /metadata and /columns nodes in ZooKeeper.
Only available in ClickHouse Cloud

## shared\_merge\_tree\_disable\_merges\_and\_mutations\_assignment

Type

Bool

Default

0

Stop merges assignment for shared merge tree. Only available in ClickHouse
Cloud

## shared\_merge\_tree\_empty\_partition\_lifetime

Type

Seconds

Default

86400

How many seconds partition will be stored in keeper if it has no parts.

## shared\_merge\_tree\_enable\_automatic\_empty\_partitions\_cleanup

Type

Bool

Default

1

Enabled cleanup of Keeper entries of empty partition.

## shared\_merge\_tree\_enable\_coordinated\_merges

Type

Bool

Default

1

Enables coordinator-driven merge assignment for `SharedMergeTree`. The merge coordinator prepares merge entries and distributes them among active merge workers instead of relying only on independent merge selection.

## shared\_merge\_tree\_enable\_keeper\_parts\_extra\_data

Type

Bool

Default

1

Enables writing attributes into virtual parts and committing blocks in keeper

## shared\_merge\_tree\_enable\_outdated\_parts\_check

Type

Bool

Default

1

Enables the `SharedMergeTree` background check that detects data parts which are no longer current and passes them to the parts-update process. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_idle\_parts\_update\_seconds

Type

UInt64

Default

3600

Interval in seconds for parts update without being triggered by ZooKeeper
watch in the shared merge tree. Only available in ClickHouse Cloud

## shared\_merge\_tree\_inactive\_replica\_cutoff\_seconds

Type

Seconds

Default

0

For how long an inactive replica is still taken into account by the background cleanup
(`OutdatedPartsQuorumThread`): while a replica has been inactive for less than this many seconds,
it still holds back removal of outdated parts and truncation of finished mutations. A value of 0
means use the default of two ZooKeeper session timeouts.
Only in ClickHouse Cloud

## shared\_merge\_tree\_initial\_parts\_update\_backoff\_ms

Type

UInt64

Default

50

Initial delay, in milliseconds, before retrying a `SharedMergeTree` parts-update operation. Repeated retries increase the delay up to `shared_merge_tree_max_parts_update_backoff_ms`. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_interserver\_http\_connection\_timeout\_ms

Type

UInt64

Default

100

Timeouts for interserver HTTP connection. Only available in ClickHouse Cloud

## shared\_merge\_tree\_interserver\_http\_timeout\_ms

Type

UInt64

Default

10000

Timeouts for interserver HTTP communication. Only available in ClickHouse
Cloud

## shared\_merge\_tree\_leader\_update\_period\_random\_add\_seconds

Type

UInt64

Default

10

Add uniformly distributed value from 0 to x seconds to
shared\_merge\_tree\_leader\_update\_period to avoid thundering
herd effect. Only available in ClickHouse Cloud

## shared\_merge\_tree\_leader\_update\_period\_seconds

Type

UInt64

Default

30

Maximum period to recheck leadership for parts update. Only available in
ClickHouse Cloud

## shared\_merge\_tree\_max\_outdated\_parts\_to\_process\_at\_once

Type

UInt64

Default

1000

Maximum amount of outdated parts leader will try to confirm for removal at
one HTTP request. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_max\_parts\_update\_backoff\_ms

Type

UInt64

Default

5000

Maximum delay, in milliseconds, between retries of a `SharedMergeTree` parts-update operation. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_max\_parts\_update\_leaders\_in\_total

Type

UInt64

Default

6

Maximum number of replicas across the service that may concurrently hold the parts-update leader role. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_max\_parts\_update\_leaders\_per\_az

Type

UInt64

Default

2

Maximum number of replicas within one availability zone that may concurrently hold the parts-update leader role. Both this limit and `shared_merge_tree_max_parts_update_leaders_in_total` apply. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_max\_replicas\_for\_parts\_deletion

Type

UInt64

Default

10

Max replicas which will participate in parts deletion (killer thread). Only
available in ClickHouse Cloud

## shared\_merge\_tree\_max\_replicas\_to\_merge\_parts\_for\_each\_parts\_range

Type

UInt64

Default

5

Max replicas which will try to assign potentially conflicting merges (allow
to avoid redundant conflicts in merges assignment). 0 means disabled. Only
available in ClickHouse Cloud

## shared\_merge\_tree\_max\_suspicious\_broken\_parts

Type

UInt64

Default

0

Max broken parts for SMT, if more - deny automatic detach.

## shared\_merge\_tree\_max\_suspicious\_broken\_parts\_bytes

Type

UInt64

Default

0

Max size of all broken parts for SMT, if more - deny automatic detach.

## shared\_merge\_tree\_memo\_ids\_remove\_timeout\_seconds

Type

Int64

Default

1800

How long we store insert memoization ids to avoid wrong actions during
insert retries. Only available in ClickHouse Cloud

## shared\_merge\_tree\_merge\_coordinator\_distribution\_algorithm

Type

MergeCoordinatorDistributionAlgorithm

Default

sainte\_lague

The algorithm used by the merge coordinator thread to distribute merges between replicas.

Possible values:

* `water_filling`
* `sainte_lague`

## shared\_merge\_tree\_merge\_coordinator\_election\_check\_period\_ms

Type

Milliseconds

Default

30000

Time between runs of merge coordinator election thread

## shared\_merge\_tree\_merge\_coordinator\_factor

Type

Float

Default

1.1

Time changing factor for delay of coordinator thread

## shared\_merge\_tree\_merge\_coordinator\_fetch\_fresh\_metadata\_period\_ms

Type

Milliseconds

Default

10000

How often merge coordinator should sync with zookeeper to take fresh metadata

## shared\_merge\_tree\_merge\_coordinator\_max\_merge\_request\_size

Type

UInt64

Default

20

Number of merges that coordinator can request from MergerMutator at once

## shared\_merge\_tree\_merge\_coordinator\_max\_period\_ms

Type

Milliseconds

Default

10000

Maximum time between runs of merge coordinator thread

## shared\_merge\_tree\_merge\_coordinator\_merges\_prepare\_count

Type

UInt64Auto

Default

auto

Number of merge entries that coordinator should prepare and distribute across workers.
When set to 'auto', equals the max number of merge tasks allowed on a single replica multiplied by the number of active replicas.

## shared\_merge\_tree\_merge\_coordinator\_min\_period\_ms

Type

Milliseconds

Default

1

Minimum time between runs of merge coordinator thread

## shared\_merge\_tree\_merge\_worker\_fast\_timeout\_ms

Type

Milliseconds

Default

100

Timeout that merge worker thread will use if it is needed to update it's state after immediate action

## shared\_merge\_tree\_merge\_worker\_regular\_timeout\_ms

Type

Milliseconds

Default

10000

Time between runs of merge worker thread

## shared\_merge\_tree\_outdated\_parts\_group\_size

Type

UInt64

Default

2

How many replicas will be in the same rendezvous hash group for outdated parts cleanup.
Only available in ClickHouse Cloud.

## shared\_merge\_tree\_partitions\_hint\_ratio\_to\_reload\_merge\_pred\_for\_mutations

Type

Float

Default

0.5

Will reload merge predicate in merge/mutate selecting task when `<candidate
partitions for mutations only (partitions that cannot be merged)>/<candidate
partitions for mutations>` ratio is higher than the setting. Only available
in ClickHouse Cloud

## shared\_merge\_tree\_parts\_load\_batch\_size

Type

UInt64

Default

32

Amount of fetch parts metadata jobs to schedule at once. Only available in
ClickHouse Cloud

## shared\_merge\_tree\_postpone\_next\_merge\_for\_locally\_merged\_parts\_ms

Type

UInt64

Default

0

Time to keep a locally merged part without starting a new merge containing
this part. Gives other replicas a chance fetch the part and start this merge.
Only available in ClickHouse Cloud.

## shared\_merge\_tree\_postpone\_next\_merge\_for\_locally\_merged\_parts\_rows\_threshold

Type

UInt64

Default

1000000

Minimum size of part (in rows) to postpone assigning a next merge just after
merging it locally. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_range\_for\_merge\_window\_size

Type

UInt64

Default

10

Window size (in block numbers) used to distribute merge assignment across
replicas. Parts within the same window are assigned to the same replicas.
Only available in ClickHouse Cloud

## shared\_merge\_tree\_read\_virtual\_parts\_from\_leader

Type

Bool

Default

1

Read virtual parts from leader when possible. Only available in ClickHouse
Cloud

## shared\_merge\_tree\_replica\_set\_max\_lifetime\_seconds

Type

Seconds

Default

1800

How often replicas will try to update replica set in background. Next run is jittered
uniformly in \[0, value] seconds. Exception: value = 0 does not follow that contract;
the implementation applies a minimum of 200 ms, so the next run is jittered in \[0, 200] ms.

## shared\_merge\_tree\_try\_fetch\_part\_in\_memory\_data\_from\_replicas

Type

Bool

Default

0

If enabled all the replicas try to fetch part in memory data (like primary
key, partition info and so on) from other replicas where it already exists.

## shared\_merge\_tree\_try\_fetch\_part\_in\_memory\_data\_from\_replicas\_on\_startup

Type

Bool

Default

0

If enabled all the replicas try to fetch part in memory data (like primary
key, partition info and so on) on startup from other replicas where it already exists.

## shared\_merge\_tree\_update\_replica\_flags\_delay\_ms

Type

Milliseconds

Default

30000

How often replica will try to reload it's flags according to background schedule.

## shared\_merge\_tree\_use\_blobs\_list\_for\_parts

Type

Bool

Default

0

Store parts of a SharedMergeTree table (both Wide and Compact) as a single
consolidated blob-list metadata node instead of one Keeper node per file.
Collapses per-part Keeper metadata from O(files) to a small constant while
keeping one object-storage blob per file. Only available in ClickHouse Cloud.

## shared\_merge\_tree\_use\_metadata\_hints\_cache

Type

Bool

Default

1

Enables requesting FS cache hints from in-memory
cache on other replicas. Only available in ClickHouse Cloud

## shared\_merge\_tree\_use\_outdated\_parts\_compact\_format

Type

Bool

Default

1

Use compact format for outdated parts: reduces load to Keeper, improves
outdated parts processing. Only available in ClickHouse Cloud

## shared\_merge\_tree\_use\_too\_many\_parts\_count\_from\_virtual\_parts

Type

Bool

Default

0

If enabled too many parts counter will rely on shared data in Keeper, not on
local replica state. Only available in ClickHouse Cloud

## shared\_merge\_tree\_use\_zookeeper\_connection\_pool

Type

Bool

Default

0

If enabled, SharedMergeTree uses one of server-level pooled ZooKeeper sessions.

## shared\_merge\_tree\_virtual\_parts\_discovery\_batch

Type

UInt64

Default

16

How many partition discoveries should be packed into batch

## shared\_merge\_tree\_virtual\_parts\_partition\_atomic\_discovery

Type

Bool

Default

1

Obsolete setting, does nothing.
