Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

merge_max_* MergeTree table settings

These settings are available in system.merge_tree_settings and are autogenerated from ClickHouse source.

merge_max_block_size

Type
NonZeroUInt64
Default
8192

The number of rows that are read from the merged parts into memory.

Possible values:

  • Any positive integer.

Merge reads rows from parts in blocks of merge_max_block_size rows, then merges and writes the result into a new part. The read block is placed in RAM, so merge_max_block_size affects the size of the RAM required for the merge. Thus, merges can consume a large amount of RAM for tables with very wide rows (if the average row size is 100kb, then when merging 10 parts, (100kb * 10 * 8192) = ~ 8GB of RAM). By decreasing merge_max_block_size, you can reduce the amount of RAM required for a merge but slow down a merge.

merge_max_block_size_bytes

Type
UInt64
Default
10485760

How many bytes in blocks should be formed for merge operations. By default has the same value as index_granularity_bytes.

merge_max_bytes_to_prewarm_cache

Type
UInt64
Default
1073741824
Version history
VersionDefault valueComment
25.11073741824Cloud sync

Only available in ClickHouse Cloud. Maximal size of part (compact or packed) to prewarm cache during merge.

merge_max_dynamic_subcolumns_in_compact_part

Type
UInt64Auto
Default
auto
Version history
VersionDefault valueComment
26.1autoAdd a new setting to limit number of dynamic subcolumns in Compact part after merge regardless the parameters specified in the data type

The maximum number of dynamic subcolumns that can be created in every column in the Compact data part after merge. It allows to control the number of dynamic subcolumns in Compact part regardless of dynamic parameters specified in the data type.

For example, if the table has a column with the JSON(max_dynamic_paths=1024) type and the setting merge_max_dynamic_subcolumns_in_compact_part is set to 128, after merge into the Compact data part number of dynamic paths will be decreased to 128 in this part and only 128 paths will be written as dynamic subcolumns.

merge_max_dynamic_subcolumns_in_wide_part

Type
UInt64Auto
Default
auto
Version history
VersionDefault valueComment
25.11autoAdd a new setting to limit number of dynamic subcolumns in Wide part after merge regardless the parameters specified in the data type

The maximum number of dynamic subcolumns that can be created in every column in the Wide data part after merge. It allows to reduce number of files created in Wide data part regardless of dynamic parameters specified in the data type.

For example, if the table has a column with the JSON(max_dynamic_paths=1024) type and the setting merge_max_dynamic_subcolumns_in_wide_part is set to 128, after merge into the Wide data part number of dynamic paths will be decreased to 128 in this part and only 128 paths will be written as dynamic subcolumns.

Navigation