> ## 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_partitions_* 세션 설정

> max_partitions_*로 생성된 그룹에 속한 ClickHouse 세션 설정입니다.

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.settings](/docs/ko/reference/system-tables/settings)에서 제공되며, [소스](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp)에서 자동 생성됩니다.

<div id="max_partitions_per_insert_block">
  ## max\_partitions\_per\_insert\_block
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "19.5"},{"label": "100"},{"label": "하나의 블록에 포함될 수 있는 파티션 수 제한 추가"}]}]} />

단일 삽입 블록에서 허용되는 최대 파티션 수를 제한합니다.
블록에 파티션이 너무 많이 포함되어 있으면 예외가 발생합니다.

* 양의 정수입니다.
* `0` — 파티션 수에 제한이 없습니다.

**세부 정보**

데이터를 삽입할 때 ClickHouse는 삽입된 블록에 포함된 파티션 수를 계산합니다.
파티션 수가 `max_partitions_per_insert_block`보다 크면 ClickHouse는
`throw_on_max_partitions_per_insert_block` 설정에 따라 경고를 로그에 기록하거나
예외를 발생시킵니다. 예외 메시지는 다음과 같습니다.

> "단일 INSERT 블록에 대한 파티션 수가 너무 많습니다 (`partitions_count` partitions, limit is " + toString(max\_partitions) + ").
> 이 제한은 'max\_partitions\_per\_insert\_block' 설정으로 제어됩니다.
> 많은 수의 파티션을 사용하는 것은 흔히 하는 오해입니다. 이로 인해 서버 시작이 느려지고, INSERT 쿼리와
> SELECT 쿼리 성능이 저하되는 등 심각한 성능 문제가 발생합니다.
> 테이블의 전체 파티션 수는 일반적으로 1000..10000 미만으로 유지하는 것이 좋습니다. 또한 파티셔닝은
> SELECT 쿼리를 빠르게 하기 위한 기능이 아니라는 점에 유의하십시오
> (범위 쿼리를 빠르게 만드는 데는 ORDER BY key로 충분합니다).
> 파티션은 데이터 조작(DROP PARTITION 등)을 위한 것입니다."

<Note>
  많은 수의 파티션을 사용하는 것은 흔히 하는 오해이므로, 이 설정은 안전 임계값입니다.
</Note>

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

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

단일 쿼리에서 액세스할 수 있는 파티션의 최대 수를 제한합니다.

테이블 생성 시 지정한 설정 값은 쿼리 수준 설정으로 재정의할 수 있습니다.

가능한 값:

* 양의 정수
* `-1` - 무제한(기본값)

<Note>
  MergeTree 설정 [`max_partitions_to_read`](/docs/ko/reference/settings/session-settings/max-partitions#max_partitions_to_read)은 테이블 설정에서도 지정할 수 있습니다.
</Note>
