> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# shrink_over_* session settings

> ClickHouse session settings in the shrink_over_* generated group.

These settings are available in [system.settings](https://clickhouse.com/docs/reference/system-tables/settings.md) and are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

## shrink\_over\_allocated\_columns\_min\_waste\_bytes

Type

UInt64

Default

16777216

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](https://clickhouse.com/docs/reference/settings/session-settings/shrink-over.md#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

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).
