These settings are available in system.merge_tree_settings and are autogenerated from ClickHouse source.
map_buckets_coefficient
Version history
| Version | Default value | Comment |
|---|---|---|
| 26.3 | 1 | Add a setting to control the coefficient used in `sqrt` and `linear` strategy for calculating the number of buckets for 'with_buckets' Map serialization |
The coefficient used in sqrt and linear map_buckets_strategy to calculate the number of buckets from the average map size.
For sqrt strategy: round(map_buckets_coefficient * sqrt(avg_map_size)).
For linear strategy: round(map_buckets_coefficient * avg_map_size).
Ignored when map_buckets_strategy is constant.
map_buckets_min_avg_size
Version history
| Version | Default value | Comment |
|---|---|---|
| 26.3 | 32 | Add a setting to control the minimum average map size (number of keys per row) required to apply `with_buckets` serialization |
The minimum average map size (number of keys per row) required to apply with_buckets serialization.
If the average map size is less than this value, a single bucket is used regardless of other bucket settings.
A value of 0 disables the threshold and always applies the bucketing strategy.
This setting is useful to avoid the overhead of bucketed serialization for small maps where the benefit is negligible.
map_buckets_strategy
Version history
| Version | Default value | Comment |
|---|---|---|
| 26.3 | sqrt | Add a setting to control the strategy for choosing the number of buckets for 'with_buckets' Map serialization |
Controls the strategy for choosing the number of buckets in with_buckets Map serialization based on the average map size.
Possible values:
- constant — Always use max_buckets_in_map as the number of buckets, regardless of the average map size.
- sqrt — Use
round(map_buckets_coefficient * sqrt(avg_map_size))as the number of buckets, clamped to[1, max_buckets_in_map]. - linear — Use
round(map_buckets_coefficient * avg_map_size)as the number of buckets, clamped to[1, max_buckets_in_map].