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

> 将系统中各类通用组件（函数、表引擎、数据类型等）的内嵌文档汇总到单个表中的系统表，并以 Markdown 形式呈现参考文档。

# system.documentation

<div id="description">
  ## 描述
</div>

将系统中各类通用组件的内嵌文档汇总到一张表中。每一行对应一个实体 (如函数、表引擎、数据类型等) ，并包含该实体以 Markdown 形式呈现的参考文档——也就是发布在网站上、并通过按类型划分的 `system.*` 表公开的相同内容。

`description` 由内嵌文档中的结构化部分 (`description`、`syntax`、参数、示例等) 拼接而成，因此单个列即可容纳某个实体的完整文档。当内嵌文档在其 `description` 中承载了整个参考页面时 (对于那些网站页面由其自动生成的组件就是如此：表引擎、数据库引擎、数据类型、格式、表函数) ，该页面会按原样发布，不会附加由结构化元数据字段组成的章节——页面正文已经涵盖了这些内容。别名会渲染为指向规范实体的简短引用，例如 ``Alias of `trunc`.``

从某种意义上说，这张表汇集了按类型划分的文档表中提供的信息 ([`system.functions`](/docs/zh/reference/system-tables/functions)、[`system.table_engines`](/docs/zh/reference/system-tables/table_engines)、[`system.data_type_families`](/docs/zh/reference/system-tables/data_type_families) 等) 。它尤其是为客户端中的交互式 `help` 命令提供支持而设计的，但本身也很有用。

会收集以下类型的实体 (括号中显示的是 `type` 列的值) ：

* 函数 (`Function`)
* 聚合函数 (`Aggregate Function`)
* 表函数 (`Table Function`)
* 表引擎 (`Table Engine`)
* 数据库引擎 (`Database Engine`)
* 数据类型 (`Data Type`)
* 字典布局 (`Dictionary Layout`)
* 字典源 (`Dictionary Source`)
* 聚合函数组合器 (`Aggregate Function Combinator`)
* 数据跳过索引类型 (`Data Skipping Index`)
* 磁盘类型 (`Disk Type`)
* 设置 (`Setting`)
* MergeTree 设置 (`MergeTree Setting`)
* 服务器设置 (`Server Setting`)
* 格式 (`Format`)
* 压缩编解码器 (`Compression Codec`)
* profile events (`Profile Event`)
* 当前指标 (`Current Metric`)
* 异步指标 (`Asynchronous Metric`)
* 系统表 (`System Table`)

对于设置 (任何类型的设置) ，文档内容是该设置的说明，以及其类型和默认值；已废弃设置不会显示。对于系统表，文档内容是表注释以及其列列表 (每列的名称、类型和说明) 。

`source` 列保存定义该实体文档的源文件路径，相对于仓库根目录。对于大多数实体，它会在构建文档对象的位置 (组件的注册位置) 自动捕获；对于那些各自仅在单个源文件中记录文档的类型 (例如设置、profile events 和当前指标) ，该列的值就是该文件。

<div id="columns">
  ## 列
</div>

* `name` ([String](/docs/zh/reference/data-types/index)) — 实体的名称，例如 `domainWithoutWWW` 或 `MergeTree`。
* `type` ([Enum8('Function' = 1, 'Aggregate Function' = 2, 'Table Function' = 3, 'Table Engine' = 4, 'Database Engine' = 5, 'Data Type' = 6, 'Dictionary Layout' = 7, 'Dictionary Source' = 8, 'Aggregate Function Combinator' = 9, 'Data Skipping Index' = 10, 'Disk Type' = 11, 'Setting' = 12, 'MergeTree Setting' = 13, 'Server Setting' = 14, 'Format' = 15, 'Compression Codec' = 16, 'Profile Event' = 17, 'Current Metric' = 18, 'Asynchronous Metric' = 19, 'System Table' = 20)](/docs/zh/reference/data-types/index)) — 实体的类别，例如 `Function` 或 `Table Engine`。
* `description` ([String](/docs/zh/reference/data-types/index)) — 以 Markdown 渲染的实体参考文档，由内嵌文档组装而成 (与网站上发布的内容相同) ，包括语法、示例以及其他结构化部分 (如果有) 。
* `source` ([String](/docs/zh/reference/data-types/index)) — 定义该实体文档的源文件路径，相对于仓库根目录。如果源位置未知，则为空。

<div id="example">
  ## 示例
</div>

查阅特定实体的文档：

```sql title="Query" theme={null}
SELECT description
FROM system.documentation
WHERE type = 'Table Engine' AND name = 'MergeTree'
FORMAT TSVRaw;
```

同一个名称可能对应多种类型的实体 (例如，既有 `file` 表函数，也有 `file` 字典源) ，因此在所有类型中按名称查找会更方便：

```sql title="Query" theme={null}
SELECT type, name
FROM system.documentation
WHERE name = 'file'
ORDER BY type;
```

统计文档中各类实体的数量：

```sql title="Query" theme={null}
SELECT type, count()
FROM system.documentation
GROUP BY type
ORDER BY count() DESC;
```

<div id="see-also">
  ## 另见
</div>

* [`system.functions`](/docs/zh/reference/system-tables/functions) — 常规函数和聚合函数。
* [`system.table_functions`](/docs/zh/reference/system-tables/table_functions) — 表函数。
* [`system.table_engines`](/docs/zh/reference/system-tables/table_engines) — 表引擎。
* [`system.database_engines`](/docs/zh/reference/system-tables/database_engines) — 数据库引擎。
* [`system.data_type_families`](/docs/zh/reference/system-tables/data_type_families) — 数据类型。
* [`system.disk_types`](/docs/zh/reference/system-tables/disk_types) — 磁盘类型。
* [`system.settings`](/docs/zh/reference/system-tables/settings) — 设置。
* [`system.merge_tree_settings`](/docs/zh/reference/system-tables/merge_tree_settings) — MergeTree 设置。
* [`system.server_settings`](/docs/zh/reference/system-tables/server_settings) — 服务器设置。
* [`system.formats`](/docs/zh/reference/system-tables/formats) — 格式。
