Introduction
Query Profile records execution information for all working nodes involved in a query, helping you quickly identify bottlenecks affecting query performance. It is a powerful tool for diagnosing and tuning query performance in the database.From v3.3.0 onwards, the database supports providing Query Profile for data loading with INSERT INTO FILES() and Broker Load. For details of the metrics involved, see OlapTableSink Operator.
How to Enable Query Profile
Enable Query Profile
You can enable Query Profile by setting the variableenable_profile to true:
Query Profile for Slow Queries
It is not recommended to enable Query Profile globally in production for long periods, as it may impose additional system overhead. To capture and analyze only slow queries, set the variablebig_query_profile_threshold to a time duration greater than 0s. For example, setting it to 30s means only queries exceeding 30 seconds will trigger Query Profile.
Runtime Query Profile
For long-running queries, it can be difficult to determine progress or detect issues before completion. The Runtime Query Profile feature (v3.1+) collects and reports Query Profile data at fixed intervals during execution, providing real-time insight into query progress and bottlenecks. When Query Profile is enabled, Runtime Query Profile is automatically activated with a default reporting interval of 10 seconds. Adjust the interval withruntime_profile_report_interval:
Configurations
How to Obtain Query Profile
Via Web UI
- Access
http://<fe_ip>:<fe_http_port>in your browser. - Click queries in the top navigation.
- In the Finished Queries list, select the query you want to analyze and click the link in the Profile column.


Via SQL Function (get_query_profile)
Example workflow:
last_query_id(): Returns the ID of the most recently executed query in your session. Useful for quickly retrieving the profile of your last query.show profilelist;: Lists recent queries along with their IDs and status. Use this to find thequery_idneeded for profile analysis.get_query_profile('<query_id>'): Returns the detailed execution profile for the specified query. Use this to analyze how a query was executed and where time or resources were spent.
In Managed Version
In the database Managed (Enterprise) environments, you can conveniently access query profiles directly from the query history in the web console. The managed UI provides an intuitive, visual representation of each query’s execution profile, making it easy to analyze performance and identify bottlenecks without manual SQL commands.Interpret Query Profile
Explain Analyze
Most users may find it challenging to analyze the raw text directly. The database provides a Text-based Query Profile Visualized Analysis method for a more intuitive understanding.Managed Version
In the enterprise edition (EE), the Managed Version provides a built-in visualization tool for query profiles. This tool offers an interactive, graphical interface that makes it much easier to interpret complex query execution details compared to raw text output. Key features of the visualization tool include:- Operator-level breakdown: View the execution plan as a tree or graph, with each operator’s metrics (time, rows, memory) clearly displayed.
- Bottleneck highlighting: Quickly identify slow or resource-intensive operators through color-coded indicators.
- Drill-down capability: Click on any operator to see detailed statistics, including input/output rows, CPU time, memory usage, and more.
- Open the database Managed web console.
- Navigate to the Query or Query History section.
- Select a query and click the Profile or Visualize button.
- Explore the visualized profile to analyze performance and identify optimization opportunities.