Skip to main content
These settings are available in system.merge_tree_settings and are autogenerated from ClickHouse source.

merge_selector_algorithm

The algorithm to select parts for merges assignment

merge_selector_base

Affects write amplification of assigned merges (expert level setting, don’t change if you don’t understand what it is doing). Works for Simple and StochasticSimple merge selectors

merge_selector_blurry_base_scale_factor

Controls when the logic kicks in relatively to the number of parts in partition. The bigger the factor the more belated reaction will be.

merge_selector_enable_heuristic_to_lower_max_parts_to_merge_at_once

Enable heuristic for simple merge selector which will lower maximum limit for merge choice. By doing so number of concurrent merges will increase which can help with TOO_MANY_PARTS errors but at the same time this will increase the write amplification.

merge_selector_enable_heuristic_to_remove_small_parts_at_right

Enable heuristic for selecting parts for merge which removes parts from right side of range, if their size is less than specified ratio (0.01) of sum_size. Works for Simple and StochasticSimple merge selectors

merge_selector_heuristic_to_lower_max_parts_to_merge_at_once_exponent

Controls the exponent value used in formulae building lowering curve. Lowering exponent will lower merge widths which will trigger increase in write amplification. The reverse is also true.

merge_selector_min_age_to_disable_right_tail_heuristic

If greater than zero and merge_selector_enable_heuristic_to_remove_small_parts_at_right is enabled, disables that heuristic for ranges where every part is at least this many seconds old. 0 disables this check. Works for Simple and StochasticSimple merge selectors.

merge_selector_small_parts_max_age

Age limit in seconds for the small-parts restriction: as soon as any part in a range exceeds this age, the restriction from merge_selector_small_parts_min_count is lifted, so backlogs of stale small parts can still merge even if the range is shorter than merge_selector_small_parts_min_count. Works for Simple and StochasticSimple merge selectors, and only for background merge selection: aggressive selection (OPTIMIZE without FINAL) ignores the small_parts_* settings.

merge_selector_small_parts_min_count

When all parts in a merge range are small (below merge_selector_small_parts_threshold) and fresh (below merge_selector_small_parts_max_age), require at least this many parts to allow the merge. Reduces the number of merge operations under rapid small-part insertion. 0 means disabled. Works for Simple and StochasticSimple merge selectors. The gate applies to background merge selection only. Aggressive selection - OPTIMIZE without FINAL - is an explicit user request that ignores part novelty, so it ignores this setting and merges small fresh parts regardless of their count. The selector never considers merge candidates wider than max_parts_to_merge_at_once, nor candidates reaching further back than merge_selector_window_size parts, so configuring either of them below this minimum is a contradictory configuration: small fresh parts then merge only after merge_selector_small_parts_max_age (or earlier, once force merge applies by min_age_to_force_merge_seconds or min_partition_age_to_force_merge_seconds). Keep both at or above this minimum. (If the built-in fullness heuristic temporarily lowers its effective cap below this minimum, the selector still considers the first all-small, all-fresh candidate of this width. Stale or large candidates, and candidates that already qualify for force merge by min_age_to_force_merge_seconds or min_partition_age_to_force_merge_seconds, retain the lowered cap.)

merge_selector_small_parts_threshold

Size threshold in bytes: a merge range is considered “all small parts” when every part is below this size. Used together with merge_selector_small_parts_min_count. Works for Simple and StochasticSimple merge selectors, and only for background merge selection: aggressive selection (OPTIMIZE without FINAL) ignores the small_parts_* settings.

merge_selector_window_size

How many parts to look at once.
Last modified on October 12, 2026