MergeTree tables settings

## 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.

## use\_const\_adaptive\_granularity[​](#use_const_adaptive_granularity "Direct link to use_const_adaptive_granularity")

Always use constant granularity for whole part. It allows to compress in
memory values of index granularity. It can be useful in extremely large
workloads with thin tables.

## use\_metadata\_cache[​](#use_metadata_cache "Direct link to use_metadata_cache")

Obsolete setting, does nothing.

## use\_minimalistic\_checksums\_in\_zookeeper[​](#use_minimalistic_checksums_in_zookeeper "Direct link to use_minimalistic_checksums_in_zookeeper")

Use small format (dozens bytes) for part checksums in ZooKeeper instead of
ordinary ones (dozens KB). Before enabling check that all replicas support
new format.

## use\_minimalistic\_part\_header\_in\_zookeeper[​](#use_minimalistic_part_header_in_zookeeper "Direct link to use_minimalistic_part_header_in_zookeeper")

Storage method of the data parts headers in ZooKeeper. If enabled, ZooKeeper
stores less data. For details, see [here](/docs/operations/server-configuration-parameters/settings#use_minimalistic_part_header_in_zookeeper).

## use\_primary\_key\_cache[​](#use_primary_key_cache "Direct link to use_primary_key_cache")

Use cache for primary index
instead of saving all indexes in memory. Can be useful for very large tables

## vertical\_merge\_algorithm\_min\_bytes\_to\_activate[​](#vertical_merge_algorithm_min_bytes_to_activate "Direct link to vertical_merge_algorithm_min_bytes_to_activate")

Minimal (approximate) uncompressed size in bytes in merging parts to activate
Vertical merge algorithm.

## vertical\_merge\_algorithm\_min\_columns\_to\_activate[​](#vertical_merge_algorithm_min_columns_to_activate "Direct link to vertical_merge_algorithm_min_columns_to_activate")

Minimal amount of non-PK columns to activate Vertical merge algorithm.

## vertical\_merge\_algorithm\_min\_rows\_to\_activate[​](#vertical_merge_algorithm_min_rows_to_activate "Direct link to vertical_merge_algorithm_min_rows_to_activate")

Minimal (approximate) sum of rows in
merging parts to activate Vertical merge algorithm.

## vertical\_merge\_optimize\_lightweight\_delete[​](#vertical_merge_optimize_lightweight_delete "Direct link to vertical_merge_optimize_lightweight_delete")

If true, lightweight delete is optimized on vertical merge.

## vertical\_merge\_optimize\_ttl\_delete[​](#vertical_merge_optimize_ttl_delete "Direct link to vertical_merge_optimize_ttl_delete")

If true, rows TTL delete is optimized on vertical merge. Instead of forcing horizontal merge,
the TTL filter is evaluated and passed to the merging algorithm which sets skip flags in row sources.

## vertical\_merge\_remote\_filesystem\_prefetch[​](#vertical_merge_remote_filesystem_prefetch "Direct link to vertical_merge_remote_filesystem_prefetch")

If true prefetching of data from remote filesystem is used for the next
column during merge

## wait\_for\_unique\_parts\_send\_before\_shutdown\_ms[​](#wait_for_unique_parts_send_before_shutdown_ms "Direct link to wait_for_unique_parts_send_before_shutdown_ms")

Before shutdown table will wait for required amount time for unique parts
(exist only on current replica) to be fetched by other replicas (0 means
disabled).

## write\_ahead\_log\_bytes\_to\_fsync[​](#write_ahead_log_bytes_to_fsync "Direct link to write_ahead_log_bytes_to_fsync")

Obsolete setting, does nothing.

## write\_ahead\_log\_interval\_ms\_to\_fsync[​](#write_ahead_log_interval_ms_to_fsync "Direct link to write_ahead_log_interval_ms_to_fsync")

Obsolete setting, does nothing.

## write\_ahead\_log\_max\_bytes[​](#write_ahead_log_max_bytes "Direct link to write_ahead_log_max_bytes")

Obsolete setting, does nothing.

## write\_final\_mark[​](#write_final_mark "Direct link to write_final_mark")

Obsolete setting, does nothing.

## write\_marks\_for\_substreams\_in\_compact\_parts[​](#write_marks_for_substreams_in_compact_parts "Direct link to write_marks_for_substreams_in_compact_parts")

Enables writing marks per each substream instead of per each column in Compact parts.
It allows to read individual subcolumns from the data part efficiently.

For example, column `t Tuple(a String, b UInt32, c Array(Nullable(UInt32)))` is serialized in the next substreams:

- `t.a` for String data of tuple element `a`
- `t.b` for UInt32 data of tuple element `b`
- `t.c.size0` for array sizes of tuple element `c`
- `t.c.null` for null map of nested array elements of tuple element `c`
- `t.c` for UInt32 data pf nested array elements of tuple element `c`

When this setting is enabled, we will write a mark for each of these 5 substreams, which means that we will be able to read
the data of each individual substream from the granule separately if needed. For example, if we want to read the subcolumn `t.c` we will read only data of
substreams `t.c.size0`, `t.c.null` and `t.c` and won't read data from substreams `t.a` and `t.b`. When this setting is disabled,
we will write a mark only for top-level column `t`, which means that we will always read the whole column data from the granule, even if we need only data of some substreams.

## zero\_copy\_concurrent\_part\_removal\_max\_postpone\_ratio[​](#zero_copy_concurrent_part_removal_max_postpone_ratio "Direct link to zero_copy_concurrent_part_removal_max_postpone_ratio")

Max percentage of top level parts to postpone removal in order to get
smaller independent ranges. Recommended not to change.

## zero\_copy\_concurrent\_part\_removal\_max\_split\_times[​](#zero_copy_concurrent_part_removal_max_split_times "Direct link to zero_copy_concurrent_part_removal_max_split_times")

Max recursion depth for splitting independent Outdated parts ranges into
smaller subranges. Recommended not to change.

## zero\_copy\_merge\_mutation\_min\_parts\_size\_sleep\_before\_lock[​](#zero_copy_merge_mutation_min_parts_size_sleep_before_lock "Direct link to zero_copy_merge_mutation_min_parts_size_sleep_before_lock")

If zero copy replication is enabled sleep random amount of time before trying
to lock depending on parts size for merge or mutation

## zero\_copy\_merge\_mutation\_min\_parts\_size\_sleep\_no\_scale\_before\_lock[​](#zero_copy_merge_mutation_min_parts_size_sleep_no_scale_before_lock "Direct link to zero_copy_merge_mutation_min_parts_size_sleep_no_scale_before_lock")

If zero copy replication is enabled sleep random amount of time up to 500ms
before trying to lock for merge or mutation.

## zookeeper\_session\_expiration\_check\_period[​](#zookeeper_session_expiration_check_period "Direct link to zookeeper_session_expiration_check_period")

ZooKeeper session expiration check period, in seconds.

Possible values:

- Any positive integer.