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

# index_granularity_* MergeTree 表设置

> ClickHouse MergeTree 表在 index_granularity_* 生成组中的设置。

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
  }}>类型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>默认值</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          无需重启即可更改
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

这些设置见于 [system.merge\_tree\_settings](/docs/zh/reference/system-tables/merge_tree_settings)，并由 ClickHouse 源代码自动生成。

<div id="index_granularity">
  ## index\_granularity
</div>

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

索引标记之间的最大数据行数。也就是说，一个主键值
对应多少行数据。

<div id="index_granularity_bytes">
  ## index\_granularity\_bytes
</div>

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

数据粒度的最大字节大小。

如果只想按行数限制粒度大小，请将其设置为 `0` (不推荐) 。
