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

# max_* MergeTree table settings

> ClickHouse MergeTree table settings in the max_* 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="max_avg_part_size_for_too_many_parts">
  max\_avg\_part\_size\_for\_too\_many\_parts
</h2>

<SettingsInfoBlock type="UInt64" default_value="1073741824" />

The 'too many parts' check according to 'parts\_to\_delay\_insert' and
'parts\_to\_throw\_insert' will be active only if the average part size (in the
relevant partition) is not larger than the specified threshold. If it is
larger than the specified threshold, the INSERTs will be neither delayed or
rejected. This allows to have hundreds of terabytes in a single table on a
single server if the parts are successfully merged to larger parts. This
does not affect the thresholds on inactive parts or total parts.

<h2 id="max_buckets_in_map">
  max\_buckets\_in\_map
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.3"},{"label": "32"},{"label": "Add a setting to control the maximum number of buckets for 'with_buckets' Map serialization"}]}]} />

The maximum number of buckets for `Map` serialization. Works with `with_buckets` `Map` serialization.
The actual number of buckets is determined by [map\_buckets\_strategy](/docs/reference/settings/merge-tree-settings/map-buckets#map_buckets_strategy).
The maximum allowed value is 256.

<h2 id="max_cleanup_delay_period">
  max\_cleanup\_delay\_period
</h2>

<SettingsInfoBlock type="UInt64" default_value="300" />

Maximum period to clean old queue logs, blocks hashes and parts.

<h2 id="max_compress_block_size">
  max\_compress\_block\_size
</h2>

<SettingsInfoBlock type="UInt64" default_value="0" />

The maximum size of blocks of uncompressed data before compressing for writing
to a table. You can also specify this setting in the global settings
(see [max\_compress\_block\_size](/docs/reference/settings/merge-tree-settings/max#max_compress_block_size)
setting). The value specified when the table is created overrides the global
value for this setting.

<h2 id="max_concurrent_queries">
  max\_concurrent\_queries
</h2>

<SettingsInfoBlock type="UInt64" default_value="0" />

Max number of concurrently executed queries related to the MergeTree table.
Queries will still be limited by other `max_concurrent_queries` settings.

Possible values:

* Positive integer.
* `0` — No limit.

Default value: `0` (no limit).

**Example**

```xml theme={null}
<max_concurrent_queries>50</max_concurrent_queries>
```

<h2 id="max_digestion_size_per_segment">
  max\_digestion\_size\_per\_segment
</h2>

<SettingsInfoBlock type="UInt64" default_value="268435456" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "268435456"},{"label": "Obsolete setting"}]}]} />

Obsolete setting, does nothing.

<h2 id="max_file_name_length">
  max\_file\_name\_length
</h2>

<SettingsInfoBlock type="UInt64" default_value="127" />

The maximal length of the file name to keep it as is without hashing.
Takes effect only if setting `replace_long_file_name_to_hash` is enabled.
The value of this setting does not include the length of file extension. So,
it is recommended to set it below the maximum filename length (usually 255
bytes) with some gap to avoid filesystem errors.

<h2 id="max_partitions_to_read">
  max\_partitions\_to\_read
</h2>

<SettingsInfoBlock type="Int64" default_value="-1" />

Limits the maximum number of partitions that can be accessed in one query.

The setting value specified when the table is created can be overridden via
query-level setting.

Possible values:

* Any positive integer.

You can also specify a query complexity setting [max\_partitions\_to\_read](/docs/reference/settings/session-settings#max_partitions_to_read)
at a query / session / profile level.

<h2 id="max_projections">
  max\_projections
</h2>

<SettingsInfoBlock type="UInt64" default_value="25" />

The maximum number of merge tree projections.

<h2 id="max_uncompressed_bytes_in_patches">
  max\_uncompressed\_bytes\_in\_patches
</h2>

<SettingsInfoBlock type="UInt64" default_value="32212254720" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "32212254720"},{"label": "New setting"}]}]} />

The maximum uncompressed size of data in all patch parts in bytes.
If amount of data in all patch parts exceeds this value, lightweight updates will be rejected.
0 - unlimited.
