Performance and Troubleshooting
This domain is one of the larger topic areas on the SnowPro Advanced: Data Engineer (DEA-C02) exam under the current (carried-over, unverified) blueprint weighting — second to Data Movement. It tests your ability to diagnose slow queries, interpret execution metadata, tune warehouses and clustering, troubleshoot data-loading pipelines, and monitor tasks and streams. Expect scenario-based questions where you must choose the correct tool, view, or remediation strategy from a set of plausible-sounding alternatives.
Query Profile: Operator Nodes, Partition Pruning Stats, Spilling to Disk
The Query Profile is accessed via Snowsight (or Classic UI) and shows a DAG of operator nodes for a completed or running query.
Key Operator Node Types
| Node Type | What It Does | Watch For |
|---|---|---|
| TableScan | Reads micro-partitions | Partitions scanned vs. total — pruning effectiveness |
| Filter | Applies WHERE predicates | Placement: should be as close to scan as possible |
| Join | Executes join logic | Build vs. probe side; inner table should be smaller |
| Aggregate | GROUP BY / DISTINCT | High memory → spill risk |
| Sort | ORDER BY / window functions | Common spill trigger |
| ExternalScan | Reads external stage files | No pruning metadata available |
| ResultNode | Returns final rows | Top of DAG |
Partition Pruning Statistics
In the TableScan node, inspect:
- Partitions total — all micro-partitions in the table
- Partitions scanned — partitions not eliminated by pruning
- Bytes scanned — actual data read after pruning
A well-clustered table on the filter column will show partitions scanned ≪ partitions total. If the ratio approaches 1.0, clustering is ineffective for that predicate.
Spilling to Disk
Spilling occurs when an operator's memory requirement exceeds the warehouse memory allocation for that node.
| Spill Type | Location | Cost |
|---|---|---|
| Local spill | Warehouse node's local SSD | Moderate — SSD I/O |
| Remote spill | Cloud storage (S3/Azure Blob/GCS) | Severe — network + object storage I/O |
Remediation options (in order of preference):
- Rewrite query to reduce intermediate result set (push filters earlier)
- Increase warehouse size (more memory per node)
- Use
CLUSTER BYto reduce data scanned upstream of the spilling operator - Split large queries into incremental steps with intermediate tables
Common traps:
- Exam may show a query that spills but also has poor pruning — the root cause is almost always pruning; fix pruning first.
- Remote spill is always worse than local spill; choosing "increase warehouse size" to fix remote spill is correct only if query rewriting is not an option listed.
- ExternalScan nodes never benefit from micro-partition pruning statistics.
EXPLAIN Plan: Interpreting Execution Plans, Identifying Bottlenecks
EXPLAIN generates a logical execution plan without running the query. EXPLAIN USING TABULAR / USING JSON / USING TEXT are the output format options. Default is TEXT.
EXPLAIN SELECT o.order_id, SUM(l.amount)
FROM orders o JOIN lineitems l ON o.order_id = l.order_id
WHERE o.region = 'EMEA'
GROUP BY o.order_id;
Key columns in the TABULAR output:
| Column | Meaning |
|---|---|
| step | Sequential execution step number |
| id | Node identifier within step |
| operation | Operator type (e.g., TableScan, Join, Aggregate) |
| objects | Tables / sub-queries referenced |
| expressions | Predicates and projections applied |
| cost | Relative optimizer cost estimate |
Identifying Bottlenecks via EXPLAIN
- Look for TableScan with no filter expression — full table scan.
- Verify Join order: the smaller (build) table should feed the inner side.
- Check for Aggregate or Sort steps without preceding Filter — optimizer missed pushdown.
EXPLAINdoes not show actual row counts, actual spill, or runtime statistics — use Query Profile for those.
Common traps:
EXPLAINdoes not consume credits and does not execute the query — exam frequently tests this boundary.EXPLAINreflects the optimizer's plan; the actual plan at runtime can differ (e.g., adaptive join decisions).EXPLAINcannot show partition pruning effectiveness because it doesn't access metadata at plan time.
Unlock with a paid plan
13 more sections (about 2,937 words) continue below. Every paid plan unlocks all DEA-C02 study guides, the full question bank and mock exams, from $4.97/month.