> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# map_buckets_* MergeTree 테이블 설정

> map_buckets_* 생성 그룹에 속한 ClickHouse MergeTree 테이블 설정입니다.

export const VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["버전", "기본값", "설명"];
  const border = "1px solid rgba(128, 128, 128, 0.3)";
  const cell = {
    border,
    padding: "0.25rem 0.5rem",
    textAlign: "start",
    verticalAlign: "top"
  };
  return <details className="not-prose" style={{
    border,
    borderRadius: "0.5rem",
    margin: "0.5rem 0",
    padding: "0.5rem 0.75rem",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <summary style={{
    cursor: "pointer",
    fontWeight: 600,
    opacity: 0.72
  }}>
        버전 이력
      </summary>
      <table style={{
    borderCollapse: "collapse",
    width: "100%",
    margin: "0.5rem 0 0"
  }}>
        <thead>
          <tr>
            {headers.map(header => <th key={header} style={{
    ...cell,
    fontWeight: 600,
    opacity: 0.72
  }}>
                {header}
              </th>)}
          </tr>
        </thead>
        <tbody>
          {rows.map((row, row_index) => <tr key={row.id ?? row_index}>
              {(row.items ?? []).map((item, item_index) => <td key={item_index} style={{
    ...cell,
    overflowWrap: "anywhere"
  }}>
                  {item?.label}
                </td>)}
            </tr>)}
        </tbody>
      </table>
    </details>;
};

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](/ko/reference/system-tables/merge_tree_settings)에서 확인할 수 있으며, ClickHouse 소스 코드에서 자동 생성됩니다.

<div id="map_buckets_coefficient">
  ## map\_buckets\_coefficient
</div>

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

평균 맵 크기에서 버킷 수를 계산할 때 `sqrt` 및 `linear` [map\_buckets\_strategy](/ko/reference/settings/merge-tree-settings/map-buckets#map_buckets_strategy)에서 사용하는 계수입니다.
`sqrt` 전략의 경우: `round(map_buckets_coefficient * sqrt(avg_map_size))`.
`linear` 전략의 경우: `round(map_buckets_coefficient * avg_map_size)`.
`map_buckets_strategy`가 `constant`이면 이 설정은 무시됩니다.

<div id="map_buckets_min_avg_size">
  ## map\_buckets\_min\_avg\_size
</div>

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

`with_buckets` 직렬화를 적용하는 데 필요한 최소 평균 맵 크기(행당 키 수)입니다.
평균 맵 크기가 이 값보다 작으면 다른 버킷 설정과 관계없이 단일 버킷이 사용됩니다.
값이 `0`이면 임계값이 비활성화되며 버킷화 전략이 항상 적용됩니다.
이 설정은 효과가 거의 없는 작은 맵에 버킷 직렬화를 적용할 때 발생하는 오버헤드를 줄이는 데 유용합니다.

<div id="map_buckets_strategy">
  ## map\_buckets\_strategy
</div>

<SettingsInfoBlock type="MergeTreeMapBucketsStrategy" default_value="sqrt" />

평균 맵 크기를 기준으로 `with_buckets` `Map` 직렬화에서 버킷 수를 선택하는 전략을 제어합니다.

가능한 값:

* constant — 평균 맵 크기와 관계없이 항상 [max\_buckets\_in\_map](/ko/reference/settings/merge-tree-settings/max#max_buckets_in_map)을 버킷 수로 사용합니다.
* sqrt — 버킷 수로 `round(map_buckets_coefficient * sqrt(avg_map_size))`를 사용하며, 값은 `[1, max_buckets_in_map]` 범위로 제한됩니다.
* linear — 버킷 수로 `round(map_buckets_coefficient * avg_map_size)`를 사용하며, 값은 `[1, max_buckets_in_map]` 범위로 제한됩니다.
