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

# short_circuit_function_evaluation_* セッション設定

> short_circuit_function_evaluation_* グループとして生成された ClickHouse のセッション設定です。

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) で利用でき、[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](/ja/reference/functions/regular-functions/conditional-functions#if)、[multiIf](/ja/reference/functions/regular-functions/conditional-functions#multiIf)、[and](/ja/reference/functions/regular-functions/logical-functions#and)、[or](/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" />

いずれかの引数が 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" />

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