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

# short_circuit_function_evaluation_* إعدادات الجلسة

> إعدادات الجلسة في ClickHouse ضمن المجموعة المُولَّدة short_circuit_function_evaluation_*.

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](/ar/reference/system-tables/settings)، وهي مُولَّدة تلقائيًا من [المصدر](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

## short\_circuit\_function\_evaluation

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

يسمح بحساب الدوال [if](/ar/reference/functions/regular-functions/conditional-functions#if) و[multiIf](/ar/reference/functions/regular-functions/conditional-functions#multiIf) و[and](/ar/reference/functions/regular-functions/logical-functions#and) و[or](/ar/reference/functions/regular-functions/logical-functions#or) وفقًا [للتقييم المختصر](https://en.wikipedia.org/wiki/Short-circuit_evaluation). يساعد ذلك على تحسين تنفيذ التعبيرات المعقدة في هذه الدوال ومنع الاستثناءات المحتملة (مثل القسمة على صفر عندما لا يكون ذلك متوقعًا).

القيم الممكنة:

* `enable` — يفعّل التقييم المختصر للدوال المناسبة لذلك (التي قد تطرح استثناءً أو تكون كثيفة حسابيًا).
* `force_enable` — يفعّل التقييم المختصر لجميع الدوال.
* `disable` — يعطّل التقييم المختصر.

## short\_circuit\_function\_evaluation\_for\_nulls

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.1"},{"label": "1"},{"label": "السماح بتنفيذ الدوال ذات الوسيطات Nullable فقط على الصفوف التي تكون فيها جميع الوسيطات ذات قيم non-NULL"}]}]} />

يُحسّن هذا الإعداد تقييم الدوال التي تُرجع NULL إذا كانت أي وسيطة NULL. وعندما تتجاوز نسبة قيم NULL في وسيطات الدالة قيمة short\_circuit\_function\_evaluation\_for\_nulls\_threshold، يتجاوز النظام تقييم الدالة على أساس كل صف على حدة. وبدلًا من ذلك، يُرجع NULL فورًا لجميع الصفوف، ما يجنّب إجراء عمليات حسابية غير ضرورية.

يتحكم هذا الإعداد في التحسين فقط. أما الدوال التي لا يمكن تنفيذها على القيمة الافتراضية لوسيطاتها - مثل `parseDateTime` أو `IPv4StringToNum` أو `intDiv` - فإنها تتخطى دائمًا الصفوف التي تحتوي على NULL بغض النظر عن هذا الإعداد، لأن القيمة المخزّنة خلف NULL هي القيمة الافتراضية لنوع الوسيطة، وتنفيذ الدالة عليها سيؤدي إلى رفع استثناء على بيانات صالحة في الأصل.

## short\_circuit\_function\_evaluation\_for\_nulls\_threshold

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.1"},{"label": "1"},{"label": "عتبة نسبة قيم NULL لتنفيذ الدوال ذات الوسيطات Nullable فقط على الصفوف التي تكون فيها جميع الوسيطات ذات قيم غير NULL. يُطبَّق هذا عند تمكين الإعداد short_circuit_function_evaluation_for_nulls."}]}]} />

عتبة نسبة قيم NULL لتنفيذ الدوال ذات الوسيطات Nullable فقط على الصفوف التي تكون فيها جميع الوسيطات ذات قيم غير NULL. يُطبَّق هذا عند تمكين الإعداد short\_circuit\_function\_evaluation\_for\_nulls.
عندما تتجاوز نسبة الصفوف التي تحتوي على قيم NULL إلى إجمالي عدد الصفوف هذه العتبة، فلن تُقيَّم تلك الصفوف التي تحتوي على قيم NULL.
