> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 记录后台调度池任务执行历史的系统表。

# system.background_schedule_pool_log

<Info>
  **在 ClickHouse Cloud 中查询**

  此系统表中的数据分别保存在 ClickHouse Cloud 各节点的本地。因此，如需查看所有数据的完整情况，需要使用 `clusterAllReplicas` 函数。更多详情请参见[此处](/zh/reference/system-tables/overview#system-tables-in-clickhouse-cloud)。
</Info>

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

仅当指定了 [background\_schedule\_pool\_log](/zh/reference/settings/server-settings/settings#background_schedule_pool_log) 这一服务器设置时，才会创建 `system.background_schedule_pool_log` 表。

此表包含后台调度池中任务执行的历史记录。后台调度池用于执行周期性任务，例如分布式发送、缓冲区刷写以及消息 broker 相关操作。

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

* `hostname` ([LowCardinality(String)](/zh/reference/data-types/lowcardinality)) — 执行查询的服务器主机名。
* `event_date` ([Date](/zh/reference/data-types/date)) — 事件日期。
* `event_time` ([DateTime](/zh/reference/data-types/datetime)) — 事件时间。
* `event_time_microseconds` ([DateTime64(6)](/zh/reference/data-types/datetime64)) — 精确到微秒的事件时间。
* `query_id` ([String](/zh/reference/data-types/string)) — 与后台任务关联的查询标识符。
* `database` ([LowCardinality(String)](/zh/reference/data-types/lowcardinality)) — 数据库名称。
* `table` ([LowCardinality(String)](/zh/reference/data-types/lowcardinality)) — 表名称。
* `table_uuid` ([UUID](/zh/reference/data-types/uuid)) — 后台任务所属表的 UUID。
* `log_name` ([LowCardinality(String)](/zh/reference/data-types/lowcardinality)) — 后台任务名称。
* `duration_ms` ([UInt64](/zh/reference/data-types/int-uint)) — 任务执行耗时 (毫秒) 。
* `error` ([UInt16](/zh/reference/data-types/int-uint)) — 发生异常时的错误代码。
* `exception` ([String](/zh/reference/data-types/string)) — 发生错误时的文本消息。

`system.background_schedule_pool_log` 表会在后台任务首次执行后创建。

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

```sql theme={null}
SELECT * FROM system.background_schedule_pool_log LIMIT 1 FORMAT Vertical;
```

```text theme={null}
Row 1:
──────
hostname:                clickhouse.eu-central1.internal
event_date:              2025-12-18
event_time:              2025-12-18 10:30:15
event_time_microseconds: 2025-12-18 10:30:15.123456
query_id:
database:                default
table:                   data
table_uuid:              00000000-0000-0000-0000-000000000000
log_name:                default.data
duration_ms:             42
error:                   0
exception:
```

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

* [system.background\_schedule\_pool](/zh/reference/system-tables/background_schedule_pool) — 包含后台调度池中当前已调度任务的相关信息。
