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

# use_* MergeTree table settings

> ClickHouse MergeTree table settings in the use_* generated group.

These settings are available in [system.merge\_tree\_settings](https://clickhouse.com/docs/reference/system-tables/merge_tree_settings.md) and are autogenerated from ClickHouse source.

## use\_adaptive\_write\_buffer\_for\_dynamic\_subcolumns

Type

Bool

Default

1

Allow to use adaptive writer buffers during writing dynamic subcolumns to
reduce memory usage

## use\_async\_block\_ids\_cache

Type

Bool

Default

1

Obsolete setting, does nothing.

## use\_compact\_variant\_discriminators\_serialization

Type

Bool

Default

1

Enables compact mode for binary serialization of discriminators in Variant
data type.
This mode allows to use significantly less memory for storing discriminators
in parts when there is mostly one variant or a lot of NULL values.

## use\_const\_adaptive\_granularity

Type

Bool

Default

0

Non-const adaptive granularity (the default, `index_granularity_bytes` is not `0`) keeps
granules at a constant size in bytes, so their row count varies: for every
written block, rows per granule is `index_granularity_bytes` divided by the
average size of a row in that block, capped at `index_granularity`. Because it differs
from granule to granule, the row count of every granule in the part has to be kept in
memory, 8 bytes each, which on large tables adds up to tens of gigabytes.

Enabling constant adaptive granularity (this setting) keeps granules at a constant number of rows instead,
so their size in bytes varies. The number is computed once from the average size of a
row in the part being written, and a part stores that single value
instead of one value per granule. Because all granules contain the same number of rows,
no additional row count per granule needs to be stored.

The amount of memory currently spent on these values is reported by the
`TotalIndexGranularityBytesInMemory` metric in `system.asynchronous_metrics`,
and per part in `system.parts.index_granularity_bytes_in_memory`.

The setting is applied only to parts written after it was changed. Use
[ALTER TABLE ... REWRITE PARTS](https://clickhouse.com/docs/reference/statements/alter/partition.md#rewrite-parts)
to apply it to existing parts. `Compact` parts always use adaptive granularity.

## use\_metadata\_cache

Type

Bool

Default

0

Obsolete setting, does nothing.

## use\_primary\_key\_cache

Type

Bool

Default

0

Use cache for primary index
instead of saving all indexes in memory. Can be useful for very large tables
