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

# min_bytes_* 会话设置

> ClickHouse 中 min_bytes_* 分组下的会话设置。

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

<div id="min_bytes_to_use_direct_io">
  ## min\_bytes\_to\_use\_direct\_io
</div>

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

启用 direct I/O 访问存储磁盘所需的最小数据量。

ClickHouse 在从表中读取数据时会使用此设置。如果所有待读取数据的总存储量超过 `min_bytes_to_use_direct_io` 字节，ClickHouse 就会使用 `O_DIRECT` 选项从存储磁盘读取数据。

可能的值：

* 0 — 禁用 direct I/O。
* 正整数。

<div id="min_bytes_to_use_mmap_io">
  ## min\_bytes\_to\_use\_mmap\_io
</div>

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

这是一个实验性设置。它用于设置读取大文件时，在不将数据从内核复制到用户空间的情况下所需的最小内存量。推荐阈值约为 64 MB，因为 [mmap/munmap](https://en.wikipedia.org/wiki/Mmap) 较慢。它仅对大文件有意义，并且只有在数据驻留于页缓存中时才有帮助。

可能的值：

* 正整数。
* 0 — 读取大文件时仅通过将数据从内核复制到用户空间的方式进行读取。
