> ## 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 analyzes a specific query profile on a per-fragment basis, and displays it in a tree structure.

ANALYZE PROFILE analyzes a specific query profile on a per-fragment basis, and displays it in a tree structure. For more information about query profile, see [Query Profile Overview](/documents/4.2/best_practices/query_tuning/query_profile_overview.md).

This feature is supported from v3.1 onwards.

> **CAUTION**
>
> By default, no privilege is required to perform this operation. If the FE configuration item `authorization_enable_query_profile_access_check` is set to `true`, a user can analyze only the profiles of the queries they ran, and analyzing the profile of a query run by another user requires the SYSTEM-level OPERATE privilege.

## Syntax

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

## Parameters

| **Parameter** | **Description** |
| - | - |
| query\_id | The ID of the query. You can obtain it using [SHOW PROFILELIST](/documents/4.2/sql-reference/sql-statements/cluster-management/plan_profile/SHOW_PROFILELIST.md). |
| plan\_node\_id | The ID of the plan node in the profile. You can specify this parameter to view the detailed metrics of the corresponding plan node(s). If this parameter is not specified, only the summary metrics of all plan nodes are displayed. |

## Examples

Example 1: Querying the Query Profile without specifying node ID.

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

Example 2: Querying the Query Profile and specifying node ID as `0`. The database returns all detailed metrics for Node ID `0` and highlights metrics with high usage for easier problem identification.

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

## Relevant SQLs

* [SHOW PROFILELIST](/documents/4.2/sql-reference/sql-statements/cluster-management/plan_profile/SHOW_PROFILELIST.md)
* [EXPLAIN ANALYZE](/documents/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.