You can use a query profile to visualize the details of a query execution. The query profile helps you troubleshoot performance bottlenecks during the query's execution. For example:
To view a query profile, you must either be the owner of the query or you must have at least CAN MONITOR permission on the SQL warehouse that executed the query.
View a query profileâYou can view the query profile from the query history using the following steps:
Click Query History in the sidebar.
Click the name of a query. A query details panel appears on the right side of the screen.
The query summary includes:
Click See query profile. A Details panel opens on the right side of the screen.
note
If Query profile is not available is displayed, no profile is available for this query. A query profile is not available for queries that run from the query cache. To circumvent the query cache, make a trivial change to the query, such as changing or removing the LIMIT
.
The detailed query profile includes summary metrics on the left side of the panel and a graph view of operators on the right.
Explore query metricsâThe left side of the query profile has the following tabs:
Details: Opens the Details panel which shows query summary metrics.
Top operators: Opens the Top operators panel which shows the most expensive operators used in your query. This can be useful for identifying optimization opportunities.
Query text: Opens the Query text panel which shows the full text of the query.
note
Some non-Photon operations are executed as a group and share common metrics. In this case, all operations have the same value as the parent operator for a given metric.
Explore the DAGâThe right half of the query profile shows the directed acyclic graph (DAG) of the query. The graph view shows metrics such as Time spent, Memory peak, and Rows. Click on each metric to change the reporting metric shown.
You can interact with the DAG in the following ways:
For Databricks SQL queries, you can also view the query profile in the Spark UI. Click the kebab menu near the top of the page, then click Open in Spark UI.
By default, metrics for some operations are hidden. These operations are unlikely to be the cause of performance bottlenecks. To see information for all operations, and to see additional metrics, click at the top of the page, then click Enable verbose mode.
Common operationsâThe most common operations are:
SUM
, COUNT
, or MAX
within each group.WHERE
clause, and a subset of rows is returned.To share a query profile with another user:
To import the JSON for a query profile:
View query history.
Click the kebab menu on the upper right, and select Import query profile (JSON).
In the file browser, select the JSON file that was shared with you and click Open. The JSON file is uploaded and the query profile is displayed.
When you import a query profile, it is dynamically loaded into your browser session and does not persist in your workspace. You need to re-import it each time you want to view it.
To close the imported query profile, click X at the top of the page.
You can also access the query profile in the following parts of the UI:
From the SQL editor: During and after query execution, a link near the bottom of the page displays the time elapsed and number of rows returned. Click that link to open the query details panel. Click See query profile.
note
If you have the new SQL editor enabled (Public Preview), your link appears as it does in a notebook.
From a notebook: If your notebook is attached to a SQL warehouse or serverless compute, you can access the query profile using the link under the cell that contains the query. Click See performance to open the run history. Click a statement to open the query details panel.
From the Lakeflow Declarative Pipelines UI: You can access the query history and profile from the Query History tab in the pipeline UI. See Access query history for Lakeflow Declarative Pipelines.
From the jobs UI: You can access query profiles for jobs run on SQL warehouses and serverless compute. For jobs run on serverless compute, see View query details for job runs to learn how to view query details in the jobs UI.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4