MergeTree tables settings

## shared\_merge\_tree\_postpone\_next\_merge\_for\_locally\_merged\_parts\_rows\_threshold[​](#shared_merge_tree_postpone_next_merge_for_locally_merged_parts_rows_threshold "Direct link to shared_merge_tree_postpone_next_merge_for_locally_merged_parts_rows_threshold")

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[​](#shared_merge_tree_range_for_merge_window_size "Direct link to shared_merge_tree_range_for_merge_window_size")

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\_read\_virtual\_parts\_from\_leader[​](#shared_merge_tree_read_virtual_parts_from_leader "Direct link to shared_merge_tree_read_virtual_parts_from_leader")

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

## shared\_merge\_tree\_replica\_set\_max\_lifetime\_seconds[​](#shared_merge_tree_replica_set_max_lifetime_seconds "Direct link to shared_merge_tree_replica_set_max_lifetime_seconds")

How often replicas will try to update replica set in background.

## shared\_merge\_tree\_try\_fetch\_part\_in\_memory\_data\_from\_replicas[​](#shared_merge_tree_try_fetch_part_in_memory_data_from_replicas "Direct link to shared_merge_tree_try_fetch_part_in_memory_data_from_replicas")

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\_update\_replica\_flags\_delay\_ms[​](#shared_merge_tree_update_replica_flags_delay_ms "Direct link to shared_merge_tree_update_replica_flags_delay_ms")

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

## shared\_merge\_tree\_use\_metadata\_hints\_cache[​](#shared_merge_tree_use_metadata_hints_cache "Direct link to shared_merge_tree_use_metadata_hints_cache")

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[​](#shared_merge_tree_use_outdated_parts_compact_format "Direct link to shared_merge_tree_use_outdated_parts_compact_format")

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[​](#shared_merge_tree_use_too_many_parts_count_from_virtual_parts "Direct link to shared_merge_tree_use_too_many_parts_count_from_virtual_parts")

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[​](#shared_merge_tree_use_zookeeper_connection_pool "Direct link to shared_merge_tree_use_zookeeper_connection_pool")

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

## shared\_merge\_tree\_virtual\_parts\_discovery\_batch[​](#shared_merge_tree_virtual_parts_discovery_batch "Direct link to shared_merge_tree_virtual_parts_discovery_batch")

Experimental feature. [Learn more.](/docs/beta-and-experimental-features#experimental-features)

How many partition discoveries should be packed into batch

## simultaneous\_parts\_removal\_limit[​](#simultaneous_parts_removal_limit "Direct link to simultaneous_parts_removal_limit")

If there are a lot of outdated parts cleanup thread will try to delete up to
`simultaneous_parts_removal_limit` parts during one iteration.
`simultaneous_parts_removal_limit` set to `0` means unlimited.

## sleep\_before\_commit\_local\_part\_in\_replicated\_table\_ms[​](#sleep_before_commit_local_part_in_replicated_table_ms "Direct link to sleep_before_commit_local_part_in_replicated_table_ms")

For testing. Do not change it.

## sleep\_before\_loading\_outdated\_parts\_ms[​](#sleep_before_loading_outdated_parts_ms "Direct link to sleep_before_loading_outdated_parts_ms")

For testing. Do not change it.

## storage\_policy[​](#storage_policy "Direct link to storage_policy")

Name of storage disk policy

## string\_serialization\_version[​](#string_serialization_version "Direct link to string_serialization_version")

Controls the serialization format for top-level `String` columns.

This setting is only effective when `serialization_info_version` is set to "with\_types".
When set to `with_size_stream`, top-level `String` columns are serialized with a separate
`.size` subcolumn storing string lengths, rather than inline. This allows real `.size`
subcolumns and can improve compression efficiency.

Nested `String` types (e.g., inside `Nullable`, `LowCardinality`, `Array`, or `Map`)
are not affected, except when they appear in a `Tuple`.

Possible values:

- `single_stream` — Use the standard serialization format with inline sizes.
- `with_size_stream` — Use a separate size stream for top-level `String` columns.

## table\_disk[​](#table_disk "Direct link to table_disk")

This is table disk, the path/endpoint should point to the table data, not to
the database data. Can be set only for s3\_plain/s3\_plain\_rewritable/web.

## table\_readonly[​](#table_readonly "Direct link to table_readonly")

If set to true, the table is in read-only mode. Any attempts to insert data or modify the table will fail.

## temporary\_directories\_lifetime[​](#temporary_directories_lifetime "Direct link to temporary_directories_lifetime")

How many seconds to keep tmp\_-directories. You should not lower this value
because merges and mutations may not be able to work with low value of this
setting.

## try\_fetch\_recompressed\_part\_timeout[​](#try_fetch_recompressed_part_timeout "Direct link to try_fetch_recompressed_part_timeout")

Timeout (in seconds) before starting merge with recompression. During this
time ClickHouse tries to fetch recompressed part from replica which assigned
this merge with recompression.

Recompression works slow in most cases, so we don't start merge with
recompression until this timeout and trying to fetch recompressed part from
replica which assigned this merge with recompression.

Possible values:

- Any positive integer.

## ttl\_only\_drop\_parts[​](#ttl_only_drop_parts "Direct link to ttl_only_drop_parts")

Controls whether data parts are fully dropped in MergeTree tables when all
rows in that part have expired according to their `TTL` settings.

When `ttl_only_drop_parts` is disabled (by default), only the rows that have
expired based on their TTL settings are removed.

When `ttl_only_drop_parts` is enabled, the entire part is dropped if all
rows in that part have expired according to their `TTL` settings.

## use\_adaptive\_write\_buffer\_for\_dynamic\_subcolumns[​](#use_adaptive_write_buffer_for_dynamic_subcolumns "Direct link to use_adaptive_write_buffer_for_dynamic_subcolumns")

Allow to use adaptive writer buffers during writing dynamic subcolumns to
reduce memory usage

## use\_async\_block\_ids\_cache[​](#use_async_block_ids_cache "Direct link to use_async_block_ids_cache")

If true, we cache the hash sums of the async inserts.

Possible values:

- `true`
- `false`

A block bearing multiple async inserts will generate multiple hash sums.
When some of the inserts are duplicated, keeper will only return one
duplicated hash sum in one RPC, which will cause unnecessary RPC retries.
This cache will watch the hash sums path in Keeper. If updates are watched
in the Keeper, the cache will update as soon as possible, so that we are
able to filter the duplicated inserts in the memory.

## use\_compact\_variant\_discriminators\_serialization[​](#use_compact_variant_discriminators_serialization "Direct link to use_compact_variant_discriminators_serialization")

Enables compact mode for binary serialization of discriminators in Variant
data type.
This mode allows to use significantly less memory for storing discriminators
in parts when there is mostly one variant or a lot of NULL values.