Query Profile is Snowflake's performance analysis tool that visually surfaces a query's execution plan and runtime statistics. In the Snowsight UI, you can inspect processing time, partitions scanned, and spill volume for each operator to pinpoint bottlenecks.
This article walks through how to read Query Profile in the Snowsight UI, how to identify Most Expensive Nodes, how to check partition pruning, how to analyze spill, and a step-by-step bottleneck identification flow. It is a frequently tested topic in the Performance Concepts domain of the SnowPro exams.
You inspect Query Profile in Snowsight (the web UI).
When you run SQL from a Worksheet, you can jump straight in via the Query Profile link next to the results tab. To pull Query Profile statistics from SQL, use the GET_QUERY_OPERATOR_STATS() table function.
-- Retrieve Query Profile statistics from SQL
SELECT *
FROM TABLE(GET_QUERY_OPERATOR_STATS('01b2c3d4-0001-abcd-0000-00012345abcd'));Query Profile shows each processing step as an operator (node) and connects them with arrows representing data flow, producing a DAG (directed acyclic graph).
| Operator | Description | What to check |
|---|---|---|
| TableScan | Reads data from a table | Partitions Scanned vs Total Partitions (pruning efficiency) |
| JoinFilter | JOIN processing | Rows Produced and spill volume |
| Filter | Filtering via WHERE clause | Input rows vs output rows (selectivity) |
| Sort | ORDER BY processing | Spill volume (sign of memory pressure) |
| Aggregate | GROUP BY and aggregate functions | Cardinality and spill volume |
| Result | Final result output | Rows Produced |
| WithClause / WithReference | CTE processing | Number of times the CTE result is reused |
Snowsight shows each node's share of total query processing time as a percentage and highlights the nodes that consumed the most resources in color.
| Cause of Most Expensive | Signal in Query Profile | Fix |
|---|---|---|
| Full table scan | Partitions Scanned = Total Partitions | Add a WHERE clause; set a clustering key |
| Large JOIN explosion | JoinFilter Rows Produced is dramatically larger than the input | Revisit JOIN conditions; push filters earlier |
| Remote Spill | Bytes Spilled to Remote Storage is large | Size up the warehouse; optimize the query |
| Sort processing large data volumes | Sort spill volume is large | Remove unnecessary ORDER BY clauses; add LIMIT |
Partition pruning is the optimization that skips reading unnecessary micro-partitions based on WHERE clause conditions. In Query Profile, check the following values on the TableScan operator.
Partitions Scanned / Partitions Total — the lower this ratio, the better pruning is working. When the ratio is close to 100%, setting a clustering key is effective.
-- Example: verifying pruning effectiveness
-- Set a clustering key on the column used in WHERE
ALTER TABLE large_events CLUSTER BY (event_date);
-- Check clustering state
SELECT SYSTEM$CLUSTERING_INFORMATION('large_events', '(event_date)');Spill happens when data that does not fit in memory during query execution gets written out to disk. It is one of the biggest causes of performance degradation.
| Spill type | Destination | Performance impact | Fix |
|---|---|---|---|
| Local Spill | Warehouse local SSD | Moderate latency | Size up the warehouse |
| Remote Spill | Cloud storage (S3/Blob/GCS) | Severe latency | Significant size-up or query redesign |
On each Query Profile operator, check the values of Bytes Spilled to Local Storage and Bytes Spilled to Remote Storage. If Remote Spill is occurring, sizing up the warehouse is the top-priority fix.
-- Top 10 longest-running queries in the last 24 hours
SELECT query_id, query_text, total_elapsed_time / 1000 AS elapsed_sec,
bytes_spilled_to_local_storage, bytes_spilled_to_remote_storage,
partitions_scanned, partitions_total
FROM snowflake.account_usage.query_history
WHERE start_time > DATEADD(hour, -24, CURRENT_TIMESTAMP())
AND execution_status = 'SUCCESS'
ORDER BY total_elapsed_time DESC
LIMIT 10;Query Profile
問題 1
In a Snowflake Query Profile, the TableScan operator shows "Partitions Scanned = 1,000 / Partitions Total = 1,000". Which is the most appropriate fix?
正解: C
Partitions Scanned = Partitions Total (0% pruning) means WHERE clause conditions are not narrowing partitions at all. In this case, setting a clustering key on a column you frequently use in WHERE rearranges data within micro-partitions and dramatically improves pruning efficiency. Sizing up the warehouse (A) raises read parallelism but does not reduce scanned volume. Result Cache (B) only helps on re-runs of the same query and does not address the root cause. Scaling out (D) improves concurrency but has no effect on the scan efficiency of a single query.
Try Query Profile practice questions
Check your SnowPro readiness with the bilingual question bank
Try free questions →Where can I access Query Profile?
Query Profile is available from Query History in Snowsight (the web UI). In Snowsight, open Activity → Query History, click the query you want to analyze, and the Query Profile tab appears. If you ran the query from a Snowsight Worksheet, you can also jump straight to it from the Query Profile link next to the results tab. SnowSQL and JDBC/ODBC clients cannot open Query Profile directly, but you can pull the same per-operator statistics from SQL using the GET_QUERY_OPERATOR_STATS() table function.
What is spill, and how does it affect performance?
Spill happens when a query produces more data than fits in memory (RAM) and Snowflake temporarily writes it out to local disk or remote storage (S3/Azure Blob/GCS). Local Spill goes to local disk; Remote Spill goes to cloud storage. Remote Spill is dramatically slower than Local Spill and severely degrades query performance. When Query Profile shows spill, the fixes are: (1) size up the warehouse (more memory), (2) optimize the query (fewer JOINs, tighter filter conditions), and (3) reduce scanned data by setting a clustering key.
What are Most Expensive Nodes?
Most Expensive Nodes are the operators (processing nodes) inside Query Profile that consume the most resources. Snowsight highlights the nodes with the largest processing time or resource usage in color. The usual suspects are full table scans (TableScan), large JOINs (JoinFilter), sorts (Sort), and aggregations (Aggregate). The recommended bottleneck-tuning flow is to identify the Most Expensive Node first, then check its Partitions Scanned/Total ratio, spill volume, and Bytes Sent to pinpoint the root cause.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Snowflake Certifications: All 11 Exams Explained (2026)
Every SnowPro certification — Associate, Core, Specialty, Ad...
Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)
All 11 SnowPro exams ranked by difficulty with study-time es...
Snowflake Study Guide: Fastest Pass Route by Exam (2026)
How to pass SnowPro certifications efficiently — official ma...
SnowPro Core (COF-C03): Complete Exam Guide (2026)
Pass the SnowPro Core exam — six domains, scope, sample ques...
SnowPro Associate Platform (SOL-C01): Complete Guide (2026)
The entry-level SnowPro Associate exam — scope, weighting, s...