> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# ANALYZE PROFILE

> ANALYZE PROFILE 以 Fragment 为单位分析指定 Query Profile，以树形结构展示。

## 功能

以 Fragment 为单位分析指定 Query Profile，并以树形结构展示。更多信息，参考 [Query Profile 概述](/documents/cn/4.2/best_practices/query_tuning/query_profile_overview.md)。

此功能自 v3.1 起支持。

> **注意**
>
> 默认情况下，该操作无需任何权限。如果将 FE 配置项 `authorization_enable_query_profile_access_check` 设置为 `true`，用户只能分析自己执行的查询的 Query Profile；分析其他用户执行的查询的 Query Profile，需要 SYSTEM 级 OPERATE 权限。

## 语法

```SQL theme={null}
ANALYZE PROFILE FROM '<query_id>', [<plan_node_id>[, ...] ]
```

## 参数说明

| **参数** | **说明** |
| - | - |
| query\_id | 查询 ID。您可以通过 [SHOW PROFILELIST](/documents/cn/4.2/sql-reference/sql-statements/cluster-management/plan_profile/SHOW_PROFILELIST.md) 获得。 |
| plan\_node\_id | Query Profile 中的计划节点 ID。您可以指定此参数以查看相应计划节点的详细指标。如果未指定此参数，则仅显示所有计划节点的摘要指标。 |

## 示例

示例一：查询 Query Profile，不指定节点 ID。

![img](https://mintcdn.com/mirrorship-docs/8FakUMFrFjmoxRt5/documents/images/f3e0ea5a6750980b90e7f5f3.jpeg?fit=max\&auto=format\&n=8FakUMFrFjmoxRt5\&q=85\&s=7788956a76b3d85fc255fdc8ce98a263)

示例二：查询 Query Profile，并指定节点 ID 为 `0`。数据库 会返回 Node ID 为 `0` 的节点的所有详细指标，并且高亮显示使用占比较高的指标，便于定位问题。

![img](https://mintcdn.com/mirrorship-docs/8gpPdHU-sBXASb5i/documents/images/20fc53aa7b20ee80324c0bcc.jpeg?fit=max\&auto=format\&n=8gpPdHU-sBXASb5i\&q=85\&s=e7b54b4bba2247ae3b14cbfaa56a417e)

## 相关 SQL

* [SHOW PROFILELIST](/documents/cn/4.2/sql-reference/sql-statements/cluster-management/plan_profile/SHOW_PROFILELIST.md)
* [EXPLAIN ANALYZE](/documents/cn/4.2/sql-reference/sql-statements/cluster-management/plan_profile/EXPLAIN_ANALYZE.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.