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

# allow_suspicious_* 会话设置

> ClickHouse 中 allow_suspicious_* 自动生成分组里的会话设置。

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](/zh/reference/system-tables/settings) 中查看，并根据 [源代码](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

<div id="allow_suspicious_codecs">
  ## allow\_suspicious\_codecs
</div>

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

如果将其设为 true，则允许指定无意义的压缩编解码器。

<div id="allow_suspicious_fixed_string_types">
  ## allow\_suspicious\_fixed\_string\_types
</div>

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

在 CREATE TABLE 语句 中，允许创建类型为 FixedString(n) 且 n > 256 的列。长度 >= 256 的 FixedString 很不寻常，通常表明存在误用

<div id="allow_suspicious_indices">
  ## allow\_suspicious\_indices
</div>

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

拒绝使用相同表达式的主索引/次级索引和排序键

<div id="allow_suspicious_low_cardinality_types">
  ## allow\_suspicious\_low\_cardinality\_types
</div>

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

允许或限制将 [LowCardinality](/zh/reference/data-types/lowcardinality) 用于固定大小为 8 字节及以下的数据类型：数值数据类型以及 `FixedString(8_bytes_or_less)`。

对于较小的固定值，使用 `LowCardinality` 通常效率不高，因为 ClickHouse 会为每一行存储一个数值索引。因此：

* 磁盘空间占用可能增加。
* RAM 占用可能更高，具体取决于字典大小。
* 某些函数可能会因额外的编码操作而执行更慢。

在 [MergeTree](/zh/reference/engines/table-engines/mergetree-family/mergetree) 引擎表中，基于上述所有原因，合并时间也可能增加。

可能的值：

* 1 — 不限制使用 `LowCardinality`。
* 0 — 限制使用 `LowCardinality`。

<div id="allow_suspicious_primary_key">
  ## allow\_suspicious\_primary\_key
</div>

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

允许在 MergeTree 中使用可疑的 `PRIMARY KEY`/`ORDER BY` (即 SimpleAggregateFunction) 。

<div id="allow_suspicious_ttl_expressions">
  ## allow\_suspicious\_ttl\_expressions
</div>

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

拒绝不依赖表中任何列的 TTL 表达式。这在大多数情况下都表明是用户误用。

<div id="allow_suspicious_types_in_group_by">
  ## allow\_suspicious\_types\_in\_group\_by
</div>

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

控制是否允许在 GROUP BY 键中使用 [Variant](/zh/reference/data-types/variant) 和 [Dynamic](/zh/reference/data-types/dynamic) 类型。

<div id="allow_suspicious_types_in_order_by">
  ## allow\_suspicious\_types\_in\_order\_by
</div>

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

允许或限制在 ORDER BY 键中使用 [Variant](/zh/reference/data-types/variant) 和 [Dynamic](/zh/reference/data-types/dynamic) 类型。

<div id="allow_suspicious_variant_types">
  ## allow\_suspicious\_variant\_types
</div>

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

在 CREATE TABLE 语句中，允许指定包含相近成员类型的 Variant 类型 (例如，不同的数值类型或日期类型) 。启用此设置后，在处理这些相近类型的值时可能会引入一定歧义。
