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

# weight_lowering_* session settings

> 自動生成グループ weight_lowering_* に属する ClickHouse の session settings。

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.settings](/ja/reference/system-tables/settings) で確認でき、[ソースコード](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) から自動生成されています。

<h2 id="weight_lowering_age_seconds">
  weight\_lowering\_age\_seconds
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.10"},{"label": "0"},{"label": "新しいクエリ設定: `fair` ワークロードスケジューラにおいて、クエリの重みを引き下げるまでの経過時間（実時間）のしきい値。"}]}]} />

`fair` ワークロードスケジューラにおいて、クエリの実行時間 (実時間) がこの秒数に達すると、そのクエリの重みが `weight_lowering_factor` に従って引き下げられます。`0` (または負の値) を指定すると、経過時間のしきい値は無効になります。

<h2 id="weight_lowering_cpu_seconds">
  weight\_lowering\_cpu\_seconds
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.10"},{"label": "0"},{"label": "新しいクエリ設定: `fair` ワークロードスケジューラにおいて、クエリの重みを引き下げる基準となる、到達 CPU 秒数のしきい値。"}]}]} />

`fair` ワークロードスケジューラ向けの設定です。クエリの到達 CPU 秒数がこの値に達すると、その重みが `weight_lowering_factor` に従って引き下げられます。CPU リソースに適用されます。`0`(または任意の負の値)を指定すると、CPU しきい値は無効になります。到達 CPU とは、スケジューラが付与したサービス量のことで、CPU が実際に消費された時点ではなく、リクエストが付与された時点で計上されます。そのため、実際の消費量よりもアクティブなスロットごとに最大 1 クォンタム(`cpu_slot_quantum_ns`)分先行する場合があります。この設定が意味を持つのは、CPU スロットのプリエンプション(`cpu_slot_preemption = 1`、デフォルト)が有効な場合のみです。プリエンプションが無効な場合、CPU スロットには実際の CPU 時間ではなくスロットごとの固定コストが割り当てられるため、このしきい値は他の `fair` CPU 設定と同様に、実際の CPU 消費量を反映しなくなります。

<h2 id="weight_lowering_factor">
  weight\_lowering\_factor
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.10"},{"label": "1"},{"label": "新しいクエリ設定: `fair` ワークロードスケジューラにおいて、クエリが重み引き下げのしきい値を超えた時点でそのクエリの重みに適用される係数です。"}]}]} />

`fair` ワークロードスケジューラ向けの設定です。クエリが以下のいずれかの `weight_lowering_*` しきい値を超えると、その実効重みにこの係数が 1 回だけ乗算されます ((0, 1) の範囲の値を指定すると重みが下がり、より短いクエリや新しいクエリが優先的にスケジューリングされるようになります) 。複数のしきい値の効果が重なることはなく、最初に超えたしきい値によって引き下げが全量適用されます。`1.0` を指定すると引き下げは無効になります。値は `[0, 1]` の範囲に制限されるため、この係数はクエリの重みを下げることしかできず、上げることはありません。

<h2 id="weight_lowering_io_bytes">
  weight\_lowering\_io\_bytes
</h2>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.10"},{"label": "0"},{"label": "新しいクエリ設定: `fair` ワークロードスケジューラにおいて、クエリの重みを下げる契機となる I/O バイト数のしきい値。"}]}]} />

`fair` ワークロードスケジューラでは、クエリの I/O 量がこのバイト数に達すると、そのクエリの重みが `weight_lowering_factor` に従って引き下げられます。I/O リソースに適用されます。`0`(または任意の負の値)を指定すると、I/O のしきい値は無効になります。
