> ## 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_parts_* MergeTree テーブル設定

> ClickHouse の max_parts_* 生成グループに属する MergeTree テーブル設定。

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/ja/reference/system-tables/merge_tree_settings) で確認でき、ClickHouse のソースコードから自動生成されています。

<div id="max_parts_in_total">
  ## max\_parts\_in\_total
</div>

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

テーブルの全パーティションにあるアクティブなパーツの総数が
`max_parts_in_total` の値を超えると、`INSERT` は `Too many parts
(N)` 例外で中断されます。

設定可能な値:

* 任意の正の整数。

テーブル内のパーツ数が多いと、ClickHouse クエリのパフォーマンスが低下し、
ClickHouse の起動時間も長くなります。多くの場合、これは設計が適切でないこと
(パーティション化戦略の選択ミス、つまりパーティションが小さすぎること)
が原因です。

<div id="max_parts_to_merge_at_once">
  ## max\_parts\_to\_merge\_at\_once
</div>

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

一度にマージできるパーツの最大数です (0 は無効) 。
OPTIMIZE FINAL クエリには影響しません。
