MergeTree tables settings

Possible values:

- `true`
- `false`

## enable\_the\_endpoint\_id\_with\_zookeeper\_name\_prefix[​](#enable_the_endpoint_id_with_zookeeper_name_prefix "Direct link to enable_the_endpoint_id_with_zookeeper_name_prefix")

Enable the endpoint id with zookeeper name prefix for the replicated merge
tree table.

## enable\_vertical\_merge\_algorithm[​](#enable_vertical_merge_algorithm "Direct link to enable_vertical_merge_algorithm")

Enable usage of Vertical merge algorithm.

## enforce\_index\_structure\_match\_on\_partition\_manipulation[​](#enforce_index_structure_match_on_partition_manipulation "Direct link to enforce_index_structure_match_on_partition_manipulation")

If this setting is enabled for destination table of a partition manipulation
query (`ATTACH/MOVE/REPLACE PARTITION`), the indices and projections must be
identical between the source and destination tables. Otherwise, the destination
table can have a superset of the source table's indices and projections.

## escape\_index\_filenames[​](#escape_index_filenames "Direct link to escape_index_filenames")

Prior to 26.1 we didn't escape special symbols in filenames created for secondary indices, which could lead to issues with some
characters in index names producing broken parts. This is added purely for compatibility reasons. It should not be changed unless you
are reading old parts with indices using non-ascii characters in their names.

## escape\_variant\_subcolumn\_filenames[​](#escape_variant_subcolumn_filenames "Direct link to escape_variant_subcolumn_filenames")

Escape special symbols in filenames created for subcolumns of Variant data type in Wide parts of MergeTree table. Needed for compatibility.

## exclude\_deleted\_rows\_for\_part\_size\_in\_merge[​](#exclude_deleted_rows_for_part_size_in_merge "Direct link to exclude_deleted_rows_for_part_size_in_merge")

If enabled, estimated actual size of data parts (i.e., excluding those rows
that have been deleted through `DELETE FROM`) will be used when selecting
parts to merge. Note that this behavior is only triggered for data parts
affected by `DELETE FROM` executed after this setting is enabled.

Possible values:

- `true`
- `false`

**See Also**

- [load\_existing\_rows\_count\_for\_old\_parts](#load_existing_rows_count_for_old_parts)
  setting

## exclude\_materialize\_skip\_indexes\_on\_merge[​](#exclude_materialize_skip_indexes_on_merge "Direct link to exclude_materialize_skip_indexes_on_merge")

Excludes provided comma delimited list of skip indexes from being built and stored during merges. Has no effect if
[materialize\_skip\_indexes\_on\_merge](#materialize_skip_indexes_on_merge) is false.

The excluded skip indexes will still be built and stored by an explicit
[MATERIALIZE INDEX](/docs/sql-reference/statements/alter/skipping-index#materialize-index) query or during INSERTs depending on
the [materialize\_skip\_indexes\_on\_insert](/docs/operations/settings/settings#materialize_skip_indexes_on_insert)
session setting.

Example:

```
CREATE TABLE tab
(
a UInt64,
b UInt64,
INDEX idx_a a TYPE minmax,
INDEX idx_b b TYPE set(3)
)
ENGINE = MergeTree ORDER BY tuple() SETTINGS exclude_materialize_skip_indexes_on_merge = 'idx_a';

INSERT INTO tab SELECT number, number / 50 FROM numbers(100); -- setting has no effect on INSERTs

-- idx_a will be excluded from update during background or explicit merge via OPTIMIZE TABLE FINAL

-- can exclude multiple indexes by providing a list
ALTER TABLE tab MODIFY SETTING exclude_materialize_skip_indexes_on_merge = 'idx_a, idx_b';

-- default setting, no indexes excluded from being updated during merge
ALTER TABLE tab MODIFY SETTING exclude_materialize_skip_indexes_on_merge = '';
```

## execute\_merges\_on\_single\_replica\_time\_threshold[​](#execute_merges_on_single_replica_time_threshold "Direct link to execute_merges_on_single_replica_time_threshold")

When this setting has a value greater than zero, only a single replica starts
the merge immediately, and other replicas wait up to that amount of time to
download the result instead of doing merges locally. If the chosen replica
doesn't finish the merge during that amount of time, fallback to standard
behavior happens.

Possible values:

- Any positive integer.

## fault\_probability\_after\_part\_commit[​](#fault_probability_after_part_commit "Direct link to fault_probability_after_part_commit")

For testing. Do not change it.

## fault\_probability\_before\_part\_commit[​](#fault_probability_before_part_commit "Direct link to fault_probability_before_part_commit")

For testing. Do not change it.

## finished\_mutations\_to\_keep[​](#finished_mutations_to_keep "Direct link to finished_mutations_to_keep")

How many records about mutations that are done to keep. If zero, then keep
all of them.

## force\_read\_through\_cache\_for\_merges[​](#force_read_through_cache_for_merges "Direct link to force_read_through_cache_for_merges")

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

Force read-through filesystem cache for merges

## fsync\_after\_insert[​](#fsync_after_insert "Direct link to fsync_after_insert")

Do fsync for every inserted part. Significantly decreases performance of
inserts, not recommended to use with wide parts.

## fsync\_part\_directory[​](#fsync_part_directory "Direct link to fsync_part_directory")

Do fsync for part directory after all part operations (writes, renames, etc.).

## in\_memory\_parts\_enable\_wal[​](#in_memory_parts_enable_wal "Direct link to in_memory_parts_enable_wal")

Obsolete setting, does nothing.

## in\_memory\_parts\_insert\_sync[​](#in_memory_parts_insert_sync "Direct link to in_memory_parts_insert_sync")

Obsolete setting, does nothing.

## inactive\_parts\_to\_delay\_insert[​](#inactive_parts_to_delay_insert "Direct link to inactive_parts_to_delay_insert")

If the number of inactive parts in a single partition in the table exceeds
the `inactive_parts_to_delay_insert` value, an `INSERT` is artificially
slowed down.

Tip

It is useful when a server fails to clean up parts quickly enough.

Possible values:

- Any positive integer.

## inactive\_parts\_to\_throw\_insert[​](#inactive_parts_to_throw_insert "Direct link to inactive_parts_to_throw_insert")

If the number of inactive parts in a single partition more than the
`inactive_parts_to_throw_insert` value, `INSERT` is interrupted with the
following error:

> "Too many inactive parts (N). Parts cleaning are processing significantly
> slower than inserts" exception."

Possible values:

- Any positive integer.

## index\_granularity[​](#index_granularity "Direct link to index_granularity")

Maximum number of data rows between the marks of an index. I.e how many rows
correspond to one primary key value.

## index\_granularity\_bytes[​](#index_granularity_bytes "Direct link to index_granularity_bytes")

Maximum size of data granules in bytes.

To restrict the granule size only by number of rows, set to `0` (not recommended).

## initialization\_retry\_period[​](#initialization_retry_period "Direct link to initialization_retry_period")

Retry period for table initialization, in seconds.

## kill\_delay\_period[​](#kill_delay_period "Direct link to kill_delay_period")

Obsolete setting, does nothing.

## kill\_delay\_period\_random\_add[​](#kill_delay_period_random_add "Direct link to kill_delay_period_random_add")

Obsolete setting, does nothing.

## kill\_threads[​](#kill_threads "Direct link to kill_threads")

Obsolete setting, does nothing.

## lightweight\_mutation\_projection\_mode[​](#lightweight_mutation_projection_mode "Direct link to lightweight_mutation_projection_mode")