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

> 包含处理器级别性能分析信息的系统表 （可在 `EXPLAIN PIPELINE` 中查看）

# system.processors_profile_log

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

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

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

此表包含处理器级别的性能分析信息 (可在 [`EXPLAIN PIPELINE`](/zh/reference/statements/explain#explain-pipeline) 中查看) 。

<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)) — 事件发生时的日期和时间，精确到微秒。
* `id` ([UInt64](/zh/reference/data-types/int-uint)) — 处理器 ID。
* `parent_ids` ([Array(UInt64)](/zh/reference/data-types/array)) — 父处理器 ID。
* `plan_step` ([UInt64](/zh/reference/data-types/int-uint)) — 创建该处理器的查询计划步骤 ID。如果该处理器不是由任何步骤添加的，则该值为 0。
* `plan_step_name` ([String](/zh/reference/data-types/string)) — 创建该处理器的查询计划步骤名称。如果该处理器不是由任何步骤添加的，则该值为空。
* `plan_step_description` ([String](/zh/reference/data-types/string)) — 创建该处理器的查询计划步骤描述。如果该处理器不是由任何步骤添加的，则该值为空。
* `plan_group` ([UInt64](/zh/reference/data-types/int-uint)) — 如果该处理器由查询计划步骤创建，则表示其所属的组。组是对由同一查询计划步骤添加的处理器进行的逻辑分组。组仅用于美化 EXPLAIN PIPELINE 结果的输出。
* `initial_query_id` ([String](/zh/reference/data-types/string)) — 初始查询的 ID (用于 distributed query execution) 。
* `query_id` ([String](/zh/reference/data-types/string)) — 查询 ID。
* `name` ([LowCardinality(String)](/zh/reference/data-types/lowcardinality)) — 处理器名称。
* `elapsed_us` ([UInt64](/zh/reference/data-types/int-uint)) — 该处理器执行耗时的微秒数。
* `input_wait_elapsed_us` ([UInt64](/zh/reference/data-types/int-uint)) — 该处理器等待数据 (来自其他处理器) 的微秒数。
* `output_wait_elapsed_us` ([UInt64](/zh/reference/data-types/int-uint)) — 该处理器因输出端口已满而等待的微秒数。
* `input_rows` ([UInt64](/zh/reference/data-types/int-uint)) — 处理器消耗的行数。
* `input_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 处理器消耗的字节数。
* `output_rows` ([UInt64](/zh/reference/data-types/int-uint)) — 处理器生成的行数。
* `output_bytes` ([UInt64](/zh/reference/data-types/int-uint)) — 处理器生成的字节数。
* `processor_uniq_id` ([String](/zh/reference/data-types/string)) — 管道中处理器的唯一 ID。
* `step_uniq_id` ([String](/zh/reference/data-types/string)) — 计划中步骤的唯一 ID。

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

```sql title="Query" theme={null}
EXPLAIN PIPELINE
SELECT sleep(1)
┌─explain─────────────────────────┐
│ (Expression)                    │
│ ExpressionTransform             │
│   (SettingQuotaAndLimits)       │
│     (ReadFromStorage)           │
│     SourceFromSingleChunk 0 → 1 │
└─────────────────────────────────┘

SELECT sleep(1)
SETTINGS log_processors_profiles = 1
Query id: feb5ed16-1c24-4227-aa54-78c02b3b27d4
┌─sleep(1)─┐
│        0 │
└──────────┘
1 rows in set. Elapsed: 1.018 sec.

SELECT
    name,
    elapsed_us,
    input_wait_elapsed_us,
    output_wait_elapsed_us
FROM system.processors_profile_log
WHERE query_id = 'feb5ed16-1c24-4227-aa54-78c02b3b27d4'
ORDER BY name ASC
```

```text title="Response" theme={null}
┌─name────────────────────┬─elapsed_us─┬─input_wait_elapsed_us─┬─output_wait_elapsed_us─┐
│ ExpressionTransform     │    1000497 │                  2823 │                    197 │
│ LazyOutputFormat        │         36 │               1002188 │                      0 │
│ LimitsCheckingTransform │         10 │               1002994 │                    106 │
│ NullSource              │          5 │               1002074 │                      0 │
│ NullSource              │          1 │               1002084 │                      0 │
│ SourceFromSingleChunk   │         45 │                  4736 │                1000819 │
└─────────────────────────┴────────────┴───────────────────────┴────────────────────────┘
```

这里可以看到：

* `ExpressionTransform` 正在执行 `sleep(1)` 函数，因此其 `work` 会耗时 1e6，所以 `elapsed_us` > 1e6。
* `SourceFromSingleChunk` 需要等待，因为 `ExpressionTransform` 在执行 `sleep(1)` 期间不接受任何数据，因此它会有 1e6 us 处于 `PortFull` 状态，所以 `output_wait_elapsed_us` > 1e6。
* `LimitsCheckingTransform`/`NullSource`/`LazyOutputFormat` 需要等待，直到 `ExpressionTransform` 执行完 `sleep(1)` 并处理结果，因此 `input_wait_elapsed_us` > 1e6。

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

* [`EXPLAIN PIPELINE`](/zh/reference/statements/explain#explain-pipeline)
