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

# parallel_replicas_* 세션 설정

> parallel_replicas_*로 생성된 그룹의 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>;
};

export const BetaBadge = ({link, galaxyTrack, galaxyEvent}) => {
  if (link) {
    return <a href={link} target="_blank" rel="noopener noreferrer" className="betaBadge" onClick={galaxyTrack && galaxyEvent ? galaxyOnClick(galaxyEvent) : undefined}>
                <Icon />
                <span>베타</span>
            </a>;
  }
  return <div className="betaBadge">
            <Icon />
            <span>
                베타 기능. 
                <u>
                    <a href="/docs/docs/beta-and-experimental-features#beta-features">
                        자세히 보기.
                    </a>
                </u>
            </span>
        </div>;
};

export const ExperimentalBadge = () => {
  return <div className="experimentalBadge">
            <div className="experimentalIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.25" d="M5.5 2H10.5" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M9.50015 2V6.19625L13.4283 12.7425C13.4738 12.8183 13.4985 12.9049 13.4996 12.9934C13.5008 13.0818 13.4785 13.169 13.435 13.246C13.3914 13.323 13.3283 13.3871 13.2519 13.4317C13.1755 13.4764 13.0886 13.4999 13.0002 13.5H3.00015C2.91164 13.5 2.8247 13.4766 2.74822 13.432C2.67174 13.3874 2.60847 13.3233 2.56487 13.2463C2.52126 13.1693 2.49889 13.082 2.50004 12.9935C2.50119 12.905 2.52582 12.8184 2.5714 12.7425L6.50015 6.19625V2" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.25" d="M4.47656 9.56754C5.30344 9.41254 6.47656 9.47942 7.99969 10.25C10.0153 11.2707 11.4216 11.0569 12.2184 10.7282" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
        </div>
            실험 기능입니다. <u><a href="/docs/docs/beta-and-experimental-features#experimental-features">자세히 알아보세요.</a></u>
        </div>;
};

이러한 설정은 [system.settings](/docs/ko/reference/system-tables/settings)에서 확인할 수 있으며, [소스](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp)로부터 자동으로 생성됩니다.

<div id="parallel_replicas_allow_in_with_subquery">
  ## parallel\_replicas\_allow\_in\_with\_subquery
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.3"},{"label": "1"},{"label": "값이 true이면 IN용 서브쿼리가 모든 팔로워 레플리카에서 실행됩니다"}]}]} />

값이 true이면 IN용 서브쿼리가 모든 팔로워 레플리카에서 실행됩니다.

<div id="parallel_replicas_allow_materialized_views">
  ## parallel\_replicas\_allow\_materialized\_views
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.12"},{"label": "1"},{"label": "병렬 레플리카에서 materialized view 사용 허용"}]}]} />

병렬 레플리카에서 materialized view를 사용할 수 있도록 허용합니다

<div id="parallel_replicas_allow_view_over_mergetree">
  ## parallel\_replicas\_allow\_view\_over\_mergetree
</div>

<BetaBadge />

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.4"},{"label": "0"},{"label": "새로운 설정"}]}]} />

병렬 레플리카가 `MergeTree` 테이블 기반의 단순 뷰에서 뷰의 내부 쿼리 대신 바깥쪽 쿼리를 실행하도록 허용하여, 노드 간 병렬화를 향상합니다. 이 설정은 모든 분기가 서로 다른 `MergeTree` 테이블을 읽는 `UNION ALL` 뷰에도 적용됩니다.

<div id="parallel_replicas_connect_timeout_ms">
  ## parallel\_replicas\_connect\_timeout\_ms
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.6"},{"label": "300"},{"label": "병렬 레플리카 쿼리를 위한 별도의 연결 타임아웃"}]}]} />

병렬 레플리카를 사용해 쿼리를 실행할 때 원격 레플리카에 연결하는 데 적용되는 밀리초 단위 타임아웃입니다. 타임아웃이 초과되면 해당 레플리카는 쿼리 실행에 사용되지 않습니다.

<div id="parallel_replicas_count">
  ## parallel\_replicas\_count
</div>

<BetaBadge />

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

이 설정은 내부용이므로 직접 사용해서는 안 되며, '병렬 레플리카' 모드의 구현 세부 사항입니다. 분산 쿼리에서는 쿼리 처리에 참여하는 병렬 레플리카 수에 맞춰 initiator server가 이 설정을 자동으로 지정합니다.

<div id="parallel_replicas_custom_key">
  ## parallel\_replicas\_custom\_key
</div>

<BetaBadge />

특정 테이블에 대해 레플리카 간 작업을 분할하는 데 사용할 수 있는 임의의 정수 표현식입니다.
값은 어떤 정수 표현식이든 될 수 있습니다.

프라이머리 키(primary key)를 사용하는 단순한 표현식을 권장합니다.

이 설정을 여러 레플리카를 가진 단일 세그먼트로 구성된 클러스터에서 사용하면, 해당 레플리카는 가상 세그먼트로 변환됩니다.
그렇지 않으면 `SAMPLE` 키와 동일하게 동작하며, 각 세그먼트의 여러 레플리카를 사용합니다.

<div id="parallel_replicas_custom_key_range_lower">
  ## parallel\_replicas\_custom\_key\_range\_lower
</div>

<BetaBadge />

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.6"},{"label": "0"},{"label": "동적 세그먼트에서 병렬 레플리카를 사용할 때 `range` 필터를 제어하는 설정 추가"}]}]} />

사용자 지정 범위 `[parallel_replicas_custom_key_range_lower, INT_MAX]`를 기준으로 `range` 필터 유형이 레플리카 간 작업을 균등하게 분할할 수 있도록 합니다.

[parallel\_replicas\_custom\_key\_range\_upper](/docs/ko/reference/settings/session-settings/parallel-replicas#parallel_replicas_custom_key_range_upper)와 함께 사용하면 `[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]` 범위에서 필터가 레플리카 전체에 작업을 균등하게 분할할 수 있습니다.

참고: 이 설정은 쿼리 처리 중 추가 데이터를 필터링하지 않습니다. 대신 병렬 처리를 위해 range 필터가 `[0, INT_MAX]` 범위를 분할하는 지점을 변경합니다.

<div id="parallel_replicas_custom_key_range_upper">
  ## parallel\_replicas\_custom\_key\_range\_upper
</div>

<BetaBadge />

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.6"},{"label": "0"},{"label": "병렬 레플리카와 동적 세그먼트를 사용할 때 range 필터를 제어하는 설정이 추가되었습니다. 값이 0이면 상한이 비활성화됩니다"}]}]} />

`range` 필터 유형이 사용자 지정 범위 `[0, parallel_replicas_custom_key_range_upper]`를 기준으로 레플리카 간 작업을 균등하게 분할할 수 있도록 합니다. 값이 0이면 상한이 비활성화되며, 이 경우 사용자 지정 키 표현식의 최댓값이 사용됩니다.

[parallel\_replicas\_custom\_key\_range\_lower](/docs/ko/reference/settings/session-settings/parallel-replicas#parallel_replicas_custom_key_range_lower)와 함께 사용하면, 범위 `[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]`에서 필터가 레플리카 전체에 작업을 균등하게 분할할 수 있습니다.

참고: 이 설정은 쿼리 처리 중 추가 데이터를 필터링하지 않습니다. 대신 병렬 처리를 위해 range 필터가 범위 `[0, INT_MAX]`를 분할하는 지점을 변경합니다.

<div id="parallel_replicas_filter_pushdown">
  ## parallel\_replicas\_filter\_pushdown
</div>

<BetaBadge />

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.2"},{"label": "0"},{"label": "새로운 설정"}]}]} />

병렬 레플리카가 실행하도록 선택한 쿼리 부분에 필터를 푸시다운할 수 있도록 허용합니다

<div id="parallel_replicas_for_cluster_engines">
  ## parallel\_replicas\_for\_cluster\_engines
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.3"},{"label": "1"},{"label": "새 설정입니다."}]}]} />

테이블 함수 엔진을 해당 -Cluster 버전으로 대체합니다

<div id="parallel_replicas_for_non_replicated_merge_tree">
  ## parallel\_replicas\_for\_non\_replicated\_merge\_tree
</div>

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

true이면 ClickHouse는 복제되지 않은 MergeTree 테이블에도 병렬 레플리카 알고리즘을 사용합니다

<div id="parallel_replicas_index_analysis_only_on_coordinator">
  ## parallel\_replicas\_index\_analysis\_only\_on\_coordinator
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.12"},{"label": "1"},{"label": "인덱스 분석은 레플리카 코디네이터에서만 수행되며 다른 레플리카에서는 생략됩니다. `parallel_replicas_local_plan`이 활성화된 경우에만 적용됩니다."}]}, {"id": "row-2","items": [{"label": "24.10"},{"label": "1"},{"label": "인덱스 분석은 레플리카 코디네이터에서만 수행되며 다른 레플리카에서는 생략됩니다. `parallel_replicas_local_plan`이 활성화된 경우에만 적용됩니다."}]}]} />

인덱스 분석은 레플리카 코디네이터에서만 수행되며 다른 레플리카에서는 생략됩니다. `parallel_replicas_local_pla`가 활성화된 경우에만 적용됩니다.

<div id="parallel_replicas_insert_select_local_pipeline">
  ## parallel\_replicas\_insert\_select\_local\_pipeline
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.5"},{"label": "1"},{"label": "병렬 레플리카를 사용하는 분산 INSERT SELECT에서 로컬 파이프라인을 사용합니다. 현재는 성능 문제로 인해 비활성화되어 있습니다"}]}, {"id": "row-2","items": [{"label": "25.4"},{"label": "0"},{"label": "병렬 레플리카를 사용하는 분산 INSERT SELECT에서 로컬 파이프라인을 사용합니다. 현재는 성능 문제로 인해 비활성화되어 있습니다"}]}]} />

병렬 레플리카를 사용하는 분산 INSERT SELECT에서 로컬 파이프라인을 사용합니다

<div id="parallel_replicas_local_plan">
  ## parallel\_replicas\_local\_plan
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.9"},{"label": "0"},{"label": "병렬 레플리카 쿼리에서 로컬 레플리카에 로컬 계획을 사용합니다"}]}, {"id": "row-2","items": [{"label": "24.11"},{"label": "1"},{"label": "병렬 레플리카 쿼리에서 로컬 레플리카에 로컬 계획을 사용합니다"}]}, {"id": "row-3","items": [{"label": "24.10"},{"label": "1"},{"label": "병렬 레플리카 쿼리에서 로컬 레플리카에 로컬 계획을 사용합니다"}]}]} />

로컬 레플리카용 로컬 계획을 생성합니다

<div id="parallel_replicas_mark_segment_size">
  ## parallel\_replicas\_mark\_segment\_size
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.9"},{"label": "0"},{"label": "이 설정의 값은 이제 자동으로 결정됩니다"}]}, {"id": "row-2","items": [{"label": "24.1"},{"label": "128"},{"label": "새로운 병렬 레플리카 코디네이터 구현에서 세그먼트 크기를 제어하기 위한 새로운 설정 추가"}]}]} />

병렬 읽기를 위해 레플리카 간에 분배할 수 있도록 파트를 가상으로 세그먼트로 나눕니다. 이 설정은 해당 세그먼트의 크기를 제어합니다. 수행 중인 작업을 완전히 이해하고 확신하는 경우가 아니라면 변경하지 않는 것이 좋습니다. 값은 \[128; 16384] 범위여야 합니다.

<div id="parallel_replicas_min_number_of_rows_per_replica">
  ## parallel\_replicas\_min\_number\_of\_rows\_per\_replica
</div>

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

쿼리에서 사용할 레플리카 수를 (읽을 것으로 예상되는 행 수 / min\_number\_of\_rows\_per\_replica)로 제한합니다. 최대값은 여전히 'max\_parallel\_replicas'로 제한됩니다.

<div id="parallel_replicas_mode">
  ## parallel\_replicas\_mode
</div>

<SettingsInfoBlock type="ParallelReplicasMode" default_value="read_tasks" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.10"},{"label": "read_tasks"},{"label": "이 설정은 병렬 레플리카 기능이 베타가 되는 과정의 일부로 도입되었습니다"}]}]} />

병렬 레플리카에서 사용자 지정 키와 함께 사용할 필터의 유형입니다. default - 사용자 지정 키에 modulo 연산을 사용합니다. range - 사용자 지정 키의 값 유형에서 가능한 모든 값을 사용해 사용자 지정 키에 범위 필터를 적용합니다.

<div id="parallel_replicas_only_with_analyzer">
  ## parallel\_replicas\_only\_with\_analyzer
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.2"},{"label": "1"},{"label": "분석기가 활성화된 경우에만 병렬 레플리카가 지원됩니다"}]}]} />

병렬 레플리카를 사용하려면 분석기가 활성화되어 있어야 합니다. 분석기가 비활성화되어 있으면 레플리카의 병렬 읽기가 활성화되어 있더라도 쿼리 실행은 로컬 실행으로 폴백됩니다. 분석기가 활성화되지 않은 상태에서 병렬 레플리카를 사용하는 것은 지원되지 않습니다.

<div id="parallel_replicas_plan_based">
  ## parallel\_replicas\_plan\_based
</div>

<ExperimentalBadge />

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.7"},{"label": "0"},{"label": "새로운 설정"}]}]} />

병렬 레플리카의 로컬/원격 경계를 계획 변환으로 표현합니다. 플래너는 먼저 단순한 로컬 계획을 생성한 뒤, 읽기 단계 위에 split 단계를 삽입하고 이를 로컬 읽기와 split 단계 아래 계획 부분에 대한 원격 읽기의 `UNION`으로 대체합니다. 이렇게 하면 해당 프래그먼트는 레플리카에서 실행되고, 나머지는 코디네이터에서 실행됩니다. Experimental 기능이며, `parallel_replicas_local_plan`보다 precedence가 우선합니다.

<div id="parallel_replicas_prefer_local_join">
  ## parallel\_replicas\_prefer\_local\_join
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.2"},{"label": "1"},{"label": "true이고 JOIN을 병렬 레플리카 알고리즘으로 실행할 수 있으며, 오른쪽 JOIN 부분의 모든 스토리지가 *MergeTree인 경우 GLOBAL JOIN 대신 로컬 JOIN을 사용합니다."}]}]} />

true이고 JOIN을 병렬 레플리카 알고리즘으로 실행할 수 있으며, 오른쪽 JOIN 부분의 모든 스토리지가 \*MergeTree인 경우 GLOBAL JOIN 대신 로컬 JOIN을 사용합니다.

<div id="parallel_replicas_prefer_local_replica">
  ## parallel\_replicas\_prefer\_local\_replica
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.5"},{"label": "1"},{"label": "새 설정입니다. 비활성화하면 병렬 읽기용 레플리카는 로컬 레플리카를 집합에 강제로 포함하지 않고 부하 분산 알고리즘에 따라 선택됩니다."}]}]} />

활성화된 경우(기본값) 로컬 레플리카는 병렬 읽기에 사용되는 레플리카 집합에 항상 포함됩니다.
비활성화된 경우 로컬 레플리카에는 우선권이 부여되지 않으며, 레플리카는 부하 분산 알고리즘에 따라서만 선택됩니다.
이렇게 하면 `max_parallel_replicas = 1`인 쿼리를 다른 호스트로 보낼 수 있으므로, 많은 짧은 쿼리가 클러스터 전체에 분산될 때 캐시 지역성을 개선할 수 있습니다.

<div id="parallel_replicas_support_projection">
  ## parallel\_replicas\_support\_projection
</div>

<SettingsInfoBlock type="Bool" default_value="1" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.8"},{"label": "1"},{"label": "새 설정입니다. 프로젝션 최적화는 병렬 레플리카에서 적용할 수 있습니다. parallel_replicas_local_plan이 활성화되어 있고 aggregation_in_order가 비활성화된 경우에만 적용됩니다."}]}]} />

프로젝션 최적화는 병렬 레플리카에서 적용할 수 있습니다. parallel\_replicas\_local\_plan이 활성화되어 있고 aggregation\_in\_order가 비활성화된 경우에만 적용됩니다.
