↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / 配置参数

debug_io_direct

要求内核使用 O_DIRECT(大多数类 Unix 系统)、F_NOCACHE(macOS)或 FILE_FLAG_NO_BUFFERING(Windows),尽量减小关系数据和 WAL 文件缓存的影响。 可以将其设置为空字符串(默认值)以禁用直接 I/O,也可以设置为应使用直接 I/O 的操作列表,各项之间用逗号分隔。有效选项包括 data(主数据文件)、wal(WAL 文件)和 wal_init(WAL 文件初始分配时)。这个参数只能在服务器启动时设置。 某些操作系统和文件系统不支持直接 I/O,因此非默认设置可能会在启动时被拒绝或导致错误。 目前该特性会降低性能,仅用于开发人员测试。

英文手册覆盖始于 PostgreSQL 7.4. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 19·选择有来源记录的版本

boot val
未知
category
Developer Options
context
postmaster
doc same as
未知
documented
true
enumvals
未知
extra desc
An empty string disables direct I/O.
lang
en
max val
未知
metadata version
19beta4
min val
未知
name
debug_io_direct
short desc
Use direct I/O for file access.
source
pg-settings-source-snapshot
unit
未知
vartype
string

版本定义 PG 19

要求内核使用 O_DIRECT(大多数类 Unix 系统)、F_NOCACHE(macOS)或 FILE_FLAG_NO_BUFFERING(Windows),尽量减小关系数据和 WAL 文件缓存的影响。

可以将其设置为空字符串(默认值)以禁用直接 I/O,也可以设置为应使用直接 I/O 的操作列表,各项之间用逗号分隔。有效选项包括 data(主数据文件)、wal(WAL 文件)和 wal_init(WAL 文件初始分配时)。这个参数只能在服务器启动时设置。

某些操作系统和文件系统不支持直接 I/O,因此非默认设置可能会在启动时被拒绝或导致错误。

目前该特性会降低性能,仅用于开发人员测试。

比较版本

完整来源事实

doc html

<p>
        Ask the kernel to minimize caching effects for relation data and WAL
        files using <code class="literal">O_DIRECT</code> (most Unix-like systems),
        <code class="literal">F_NOCACHE</code> (macOS) or
        <code class="literal">FILE_FLAG_NO_BUFFERING</code> (Windows).
       </p><p>
        May be set to an empty string (the default) to disable use of direct
        I/O, or a comma-separated list of operations that should use direct I/O.
        The valid options are <code class="literal">data</code> for
        main data files, <code class="literal">wal</code> for WAL files, and
        <code class="literal">wal_init</code> for WAL files when being initially
        allocated.
        This parameter can only be set at server start.
       </p><p>
        Some operating systems and file systems do not support direct I/O, so
        non-default settings may be rejected at startup or cause errors.
       </p><p>
        Currently this feature reduces performance, and is intended for
        developer testing only.
       </p>

documentation revision

{"inputs":[{"file":"runtime-config-developer.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"44a1ecd5d3b37a3cbfe9e38d974931b46567a167311e11baaea0c5816b033e8b","version":"19rc2"},{"file":"runtime-config-developer.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"537fd5a2901e554c1bd89332a049781a3456a721270c9278b44c749b341ffabf","version":"19rc2"}],"release":"19rc2","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 19 · wiki-repair-20261023:c186c9df03ff7a7ce954189068d33072989e6abbf6f09e62924c12154a77b254

正文语言: zh-Hans · wiki-repair-20261023:c186c9df03ff7a7ce954189068d33072989e6abbf6f09e62924c12154a77b254