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

> 包含后台调度池中各任务信息的系统表。

# system.background_schedule_pool

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

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

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

包含有关后台调度池中任务的信息。后台调度池用于执行周期性任务，例如 Distributed 发送操作、缓冲区刷新以及消息代理操作。

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

* `pool` ([String](/zh/reference/data-types/index)) — 池名称。可能的值：`schedule` — 通用调度池，`buffer_flush` — 用于刷新 Buffer 表数据的池，`distributed` — 用于分布式表操作的池，`message_broker` — 用于消息代理操作的池。
* `database` ([String](/zh/reference/data-types/index)) — 数据库名称。
* `table` ([String](/zh/reference/data-types/index)) — 表名称。
* `table_uuid` ([UUID](/zh/reference/data-types/index)) — 表 UUID。
* `query_id` ([String](/zh/reference/data-types/index)) — 查询 ID (如果当前正在执行) 。注意：这不是真实的查询，而是一个随机生成的 ID，用于匹配 `system.text_log` 中的日志。
* `elapsed_ms` ([UInt64](/zh/reference/data-types/index)) — 任务执行时间 (如果当前正在执行) 。
* `log_name` ([String](/zh/reference/data-types/index)) — 任务的日志名称。
* `deactivated` ([UInt8](/zh/reference/data-types/index)) — 任务是否已停用 (始终为 false，因为已停用的任务会从池中移除) 。
* `scheduled` ([UInt8](/zh/reference/data-types/index)) — 任务是否已调度。
* `delayed` ([UInt8](/zh/reference/data-types/index)) — 任务是否为延迟调度。
* `executing` ([UInt8](/zh/reference/data-types/index)) — 任务当前是否正在执行。

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

```sql title="Query" theme={null}
SELECT * FROM system.background_schedule_pool LIMIT 5 FORMAT Vertical;
```

```text title="Response" theme={null}
Row 1:
──────
pool:        distributed
database:    default
table:       data
table_uuid:  00000000-0000-0000-0000-000000000000
query_id:
elapsed_ms:  0
log_name:    BackgroundJobsAssignee:DataProcessing
deactivated: 0
scheduled:   1
delayed:     0
executing:   0
```

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

* [system.background\_schedule\_pool\_log](/zh/reference/system-tables/background_schedule_pool_log) — 包含后台调度池任务执行的历史。
