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

# short_circuit_function_evaluation_* セッション設定

> short_circuit_function_evaluation_* グループとして生成された 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/ja/reference/system-tables/settings) で利用でき、[source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) から自動生成されます。

<div id="short_circuit_function_evaluation">
  ## short\_circuit\_function\_evaluation
</div>

<SettingsInfoBlock type="ShortCircuitFunctionEvaluation" default_value="enable" />

[if](/docs/ja/reference/functions/regular-functions/conditional-functions#if)、[multiIf](/docs/ja/reference/functions/regular-functions/conditional-functions#multiIf)、[and](/docs/ja/reference/functions/regular-functions/logical-functions#and)、[or](/docs/ja/reference/functions/regular-functions/logical-functions#or) 関数を、[短絡評価](https://en.wikipedia.org/wiki/Short-circuit_evaluation)方式で計算できるようにします。これにより、これらの関数内の複雑な式の実行を最適化し、起こりうる例外 (たとえば、想定されない場合のゼロ除算など) を防ぐのに役立ちます。

設定可能な値:

* `enable` — 短絡評価に適した関数 (例外をスローする可能性がある関数や、計算負荷が高い関数) に対して、短絡関数評価を有効にします。
* `force_enable` — すべての関数に対して、短絡関数評価を有効にします。
* `disable` — 短絡関数評価を無効にします。

<div id="short_circuit_function_evaluation_for_nulls">
  ## short\_circuit\_function\_evaluation\_for\_nulls
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.1"},{"label": "1"},{"label": "すべての引数が非 NULL 値である行に対してのみ、Nullable 引数を持つ関数を実行できるようにする"}]}]} />

いずれかの引数が NULL の場合に NULL を返す関数の評価を最適化します。関数の引数に含まれる NULL 値の割合が short\_circuit\_function\_evaluation\_for\_nulls\_threshold を超えると、システムは関数を行ごとに評価するのをスキップします。代わりに、すべての行に対して即座に NULL を返し、不要な計算を回避します。

<div id="short_circuit_function_evaluation_for_nulls_threshold">
  ## short\_circuit\_function\_evaluation\_for\_nulls\_threshold
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.1"},{"label": "1"},{"label": "Nullable な引数を持つ関数を、すべての引数が非 NULL 値である行に対してのみ実行するための NULL 値の比率のしきい値。設定 short_circuit_function_evaluation_for_nulls が有効な場合に適用されます。"}]}]} />

Nullable な引数を持つ関数を、すべての引数が非 NULL 値である行に対してのみ実行するための NULL 値の比率のしきい値。設定 short\_circuit\_function\_evaluation\_for\_nulls が有効な場合に適用されます。
NULL 値を含む行の比率が全行数に対してこのしきい値を超えると、それらの行は評価されません。
