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

# primary_key_* MergeTree table settings

> ClickHouse MergeTree table settings in the primary_key_* 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.

## primary\_key\_compress\_block\_size

Type

NonZeroUInt64

Default

65536

Size, in uncompressed bytes, of blocks used when writing a compressed primary-key index for new or rewritten data parts. Applies only when `compress_primary_key` is enabled. This controls compression framing and buffering; it does not change the primary key or index granularity.

## primary\_key\_compression\_codec

Type

String

Default

ZSTD(3)

Compression encoding used by primary, primary key is small enough and cached,
so the default compression is ZSTD(3).

## primary\_key\_lazy\_load

Type

Bool

Default

1

Load primary key in memory on
first use instead of on table initialization. This can save memory in the
presence of a large number of tables.

## primary\_key\_ratio\_of\_unique\_prefix\_values\_to\_skip\_suffix\_columns

Type

Float

Default

0.9

If the value of a column of the primary key in data part changes at least in
this ratio of times, skip loading next columns in memory. This allows to save
memory usage by not loading useless columns of the primary key.
