Skip to main content
Version: 4.0 GA

ANALYZE PROFILE

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.

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

ANALYZE PROFILE FROM '<query_id>', [<plan_node_id>[, ...] ]

Parameters

ParameterDescription
query_idThe ID of the query. You can obtain it using SHOW PROFILELIST.
plan_node_idThe 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

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

img

Relevant SQLs