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

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>Type</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Default</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Changeable without restart
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

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

<h2 id="primary_key_compress_block_size">
  primary\_key\_compress\_block\_size
</h2>

<SettingsInfoBlock type="NonZeroUInt64" default_value="65536" />

Primary compress block size, the actual size of the block to compress.

<h2 id="primary_key_compression_codec">
  primary\_key\_compression\_codec
</h2>

<SettingsInfoBlock type="String" default_value="ZSTD(3)" />

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

<h2 id="primary_key_lazy_load">
  primary\_key\_lazy\_load
</h2>

<SettingsInfoBlock type="Bool" default_value="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.

<h2 id="primary_key_ratio_of_unique_prefix_values_to_skip_suffix_columns">
  primary\_key\_ratio\_of\_unique\_prefix\_values\_to\_skip\_suffix\_columns
</h2>

<SettingsInfoBlock type="Float" default_value="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.
