Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

shrink_over_* session settings

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

shrink_over_allocated_columns_min_waste_bytes

Type
UInt64
Default
16777216
Version history
VersionDefault valueComment
26.816777216New setting: minimum absolute wasted memory in a column for it to be shrunk to fit on INSERT.

Minimum absolute amount of wasted (reserved but unused) memory in a column, in bytes, for it to be shrunk to fit on INSERT. See shrink_over_allocated_columns_min_waste_ratio.

Prevents reallocating columns whose over-allocation is small, where the memory saving would not justify the cost.

shrink_over_allocated_columns_min_waste_ratio

Type
Float
Default
1
Version history
VersionDefault valueComment
26.81New setting to shrink over-allocated columns to fit on INSERT to reduce peak memory usage. Disabled by default (1.0).

On INSERT, over-allocated columns (whose reserved memory exceeds the used memory, e.g. due to power-of-two growth of variable-length columns) are shrunk to fit before the expensive materialization and part-writing stages, to reduce peak memory usage.

A column is shrunk only when allocatedBytes() > byteSize() * shrink_over_allocated_columns_min_waste_ratio and the absolute waste is at least shrink_over_allocated_columns_min_waste_bytes.

Possible values:

  • Float greater than 1.
  • Value less than or equal to 1 disables the shrinking (the default 1.0 keeps it disabled).
Navigation