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

# Configuración de tabla de MergeTree para map_buckets_*

> Configuración de tablas MergeTree de ClickHouse en el grupo generado map_buckets_*.

export const VersionHistory = ({rows = []}) => {
  if (rows.length === 0) {
    return null;
  }
  const headers = ["Versión", "Valor predeterminado", "Comentario"];
  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
  }}>
        Historial de versiones
      </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
  }}>Tipo</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>Predeterminado</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          Modificable sin reiniciar
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

Estas opciones de configuración están disponibles en [system.merge\_tree\_settings](/es/reference/system-tables/merge_tree_settings) y se generan automáticamente a partir del código fuente de ClickHouse.

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

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

El coeficiente utilizado en [map\_buckets\_strategy](/es/reference/settings/merge-tree-settings/map-buckets#map_buckets_strategy) `sqrt` y `linear` para calcular el número de buckets a partir del tamaño medio del Map.
Para la estrategia `sqrt`: `round(map_buckets_coefficient * sqrt(avg_map_size))`.
Para la estrategia `linear`: `round(map_buckets_coefficient * avg_map_size)`.
Se ignora cuando `map_buckets_strategy` es `constant`.

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

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

El tamaño medio mínimo de Map (número de claves por fila) necesario para aplicar la serialización `with_buckets`.
Si el tamaño medio de Map es inferior a este valor, se usa un solo bucket independientemente del resto de la configuración de buckets.
Un valor de `0` desactiva el umbral y siempre aplica la estrategia de uso de buckets.
Esta configuración es útil para evitar la sobrecarga de la serialización en buckets en valores Map pequeños, donde el beneficio es insignificante.

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

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

Controla la estrategia para seleccionar el número de buckets en la serialización `with_buckets` de `Map` en función del tamaño promedio del Map.

Posibles valores:

* constant — Usa siempre [max\_buckets\_in\_map](/es/reference/settings/merge-tree-settings/max#max_buckets_in_map) como número de buckets, independientemente del tamaño promedio del Map.
* sqrt — Usa `round(map_buckets_coefficient * sqrt(avg_map_size))` como número de buckets, limitado al intervalo `[1, max_buckets_in_map]`.
* linear — Usa `round(map_buckets_coefficient * avg_map_size)` como número de buckets, limitado al intervalo `[1, max_buckets_in_map]`.
