SnowPro Advanced: Architect · 25% of the exam

Performance Optimization: free practice questions

5 sample questions from our 63-question bank for this domain — answers and explanations included. These are the same scenario-based style as the real Snowflake exam.

1. A Snowflake architect is evaluating whether to enable the Query Acceleration Service (QAS) for a warehouse. Which characteristic of a query makes it MOST eligible for meaningful acceleration by QAS?

  • A. A query that performs a small lookup join between two well-clustered tables, returning fewer than 1,000 rows.
  • B. A query that scans a large table with selective filters and performs aggregations, where the scan phase dominates total query time.✓ Correct
  • C. A query that is blocked in the warehouse queue due to high concurrency, waiting for an available slot.
  • D. A query that spills large intermediate results to remote storage during a multi-stage hash join.
Explanation

Correct: QAS is designed for queries that have large, parallelizable scan-and-filter-aggregation patterns — where a significant portion of the query time is spent scanning micro-partitions. QAS offloads the scan portions to additional serverless compute, reducing wall-clock time for these 'outlier' queries. Distractor A is wrong because small lookup joins that already return quickly have little to gain from QAS; the service targets long-running scan-heavy queries. Distractor C is wrong because QAS does not address warehouse queuing/concurrency — that is solved by multi-cluster warehouses or query queuing policies. Distractor D is wrong because spilling during hash joins is a memory pressure problem (solved by increasing warehouse size or rewriting the query), not a scan acceleration problem; QAS primarily accelerates the scan phase, not in-memory hash join operations.

2. A Snowflake architect is profiling a query that runs a window function (ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY event_time)) across a 200 GB events table. The Query Profile shows a 'WindowFunction' node consuming 78% of total execution time with 'Bytes spilled to local storage' at 12 GB. The warehouse is currently Medium (4 nodes). Which TWO actions should the architect take to improve performance?

  • A. Upsize the warehouse to Large or X-Large to provide more memory per node, reducing spilling from the WindowFunction operator.✓ Correct
  • B. Enable Automatic Clustering on the events table using (customer_id, event_time) as the clustering key so that rows with the same customer_id are co-located in the same micro-partitions, reducing the data shuffle required by the window partition.
  • C. Rewrite the ROW_NUMBER() window function as a subquery with a GROUP BY to avoid the window function overhead entirely.
  • D. Use the Query Acceleration Service to offload the WindowFunction node computation to serverless workers.
  • E. Apply a WHERE clause filter to limit the query to a specific date range before the window function is evaluated, reducing the number of rows that the WindowFunction node must sort and partition.✓ Correct
Explanation

Correct (A): The WindowFunction node is spilling to local storage, which is a memory pressure problem. Upsizing the warehouse provides more total RAM across more nodes, allowing the sort and partition operations within the window function to complete in-memory rather than spilling to disk. Correct (E): Applying a WHERE clause filter (e.g., limiting to a date range) reduces the total number of rows the window function must process. Fewer rows means smaller sort buffers, less memory pressure, and reduced or eliminated spilling — directly addressing the bottleneck. Why B is wrong: Automatic Clustering on (customer_id, event_time) would help pruning for queries that filter on customer_id, but window functions must process all data within each partition value across the full dataset. Clustering reduces scan I/O but does not eliminate the need to sort and partition rows during window function execution. Why C is wrong: ROW_NUMBER() cannot be trivially replaced with GROUP BY because GROUP BY collapses rows while ROW_NUMBER() assigns a rank to each row within its partition. These are semantically different operations. Why D is wrong: QAS accelerates large partition-scan workloads (filters, aggregations over many micro-partitions). It does not offload window function computation to separate serverless nodes — window functions are executed within the warehouse compute.

3. A data team is troubleshooting slow performance on a query that performs a self-join on a large events table. The Query Profile shows that the 'Filter' operator immediately downstream of the TableScan on one side of the join is consuming a disproportionate amount of execution time, while the actual join operator is fast. What optimization technique does this pattern suggest is MISSING from the query execution plan?

  • A. Partition pruning — the query's WHERE clause predicates should have eliminated partitions before the scan, but clustering is absent.
  • B. Filter pushdown — the filter predicate should have been pushed down to occur during the scan phase rather than as a separate post-scan operator, reducing the rows passed to the join.✓ Correct
  • C. Join reordering — the self-join should be reordered so the filtered side is the build side of the hash join.
  • D. Broadcast join — the optimizer should have broadcast the filtered side to eliminate the need for a separate filter operator.
Explanation

Correct: Filter pushdown is an optimization where filter predicates are applied as early as possible — ideally during the scan phase — so that fewer rows are materialized and passed to downstream operators like joins. When the Query Profile shows a separate, expensive Filter node after the TableScan rather than the filter being absorbed into the scan, it indicates that filter pushdown did not occur. This can happen with certain query constructions (e.g., filters on computed columns or expressions) that prevent the optimizer from pushing the filter into the scan. Rewriting the query to use simple column filters often enables pushdown. Distractor A is wrong because partition pruning is a metadata-level operation that happens before scan execution — it would show up as a difference between 'Partitions total' and 'Partitions scanned', not as a slow Filter node in the profile. Distractor C is wrong because join reordering affects which table is the build vs. probe side; it does not explain a slow Filter node upstream of the join. Distractor D is wrong because broadcast join selection is about eliminating shuffle for small tables; it does not affect whether a filter is applied during or after a scan.

4. An architect is investigating a query that aggregates billions of rows. In the Query Profile, the 'Bytes spilled to remote storage' metric is non-zero while 'Bytes spilled to local storage' is zero. What does this indicate, and what is the BEST remediation?

  • A. The warehouse ran out of local SSD cache and then remote (S3/Azure/GCS) object storage; upgrade to the next warehouse size to increase available memory and local storage.
  • B. The warehouse ran out of in-memory space, bypassed local disk, and spilled directly to remote storage; upgrade to the next warehouse size to increase available memory.✓ Correct
  • C. The query is scanning too many micro-partitions; add a clustering key to reduce partition scans and eliminate the spill.
  • D. Remote storage spilling is a normal optimization Snowflake uses for large aggregations; no action is needed.
Explanation

Spilling to remote storage occurs when the warehouse exhausts both available memory AND local SSD space — data overflows all the way to remote object storage, which is the slowest tier. Option B correctly identifies that upgrading warehouse size increases available memory (and local disk), which eliminates or reduces the need to spill. Option A incorrectly implies local SSD was exhausted first (if local SSD were exhausted first, 'Bytes spilled to local storage' would be non-zero); in the scenario, local spill is zero, meaning the spill went directly past local SSD — this is unusual but possible when local SSD is already heavily utilized by cached data from other queries. Option C is incorrect because partition pruning reduces data scanned but does not directly address the aggregation memory pressure causing the spill. Option D is incorrect; remote storage spilling severely degrades performance and should always be investigated.

5. A data engineer observes the following in a query's Query Profile: the 'Bytes spilled to local storage' metric is 120 GB and 'Bytes spilled to remote storage' is 45 GB for a single aggregation node. The query runs on an X-Large warehouse. Which TWO actions would MOST directly reduce or eliminate this spilling behavior?

  • A. Increase the warehouse size to 2X-Large or 3X-Large to provide more in-memory capacity per node.✓ Correct
  • B. Enable multi-cluster warehouse auto-scaling so additional clusters can be spun up to share the workload.
  • C. Rewrite the query to push GROUP BY columns through a subquery to reduce intermediate row counts before aggregation.✓ Correct
  • D. Partition the source table by a column unrelated to the GROUP BY key to increase data locality.
  • E. Add a RESULT_SCAN on the query output to cache the final result set and avoid recomputation.
  • F. Suspend and resume the warehouse to clear the warehouse cache before rerunning the query.
Explanation

Correct A: Upgrading the warehouse size increases the per-node memory available for in-memory sort and aggregation buffers, directly addressing spilling caused by insufficient RAM. Correct C: Rewriting the query to reduce intermediate row counts before the final aggregation (e.g., pre-aggregating in a subquery or CTE) decreases the amount of data the aggregation node must hold in memory at once, reducing or eliminating spilling. Distractor B is wrong because multi-cluster auto-scaling adds clusters for concurrency (multiple simultaneous queries), not for a single query's memory requirements — a single query runs on one cluster. Distractor D is wrong because partitioning by an unrelated column does not affect the intermediate data volume produced by the aggregation node. Distractor E is wrong because RESULT_SCAN retrieves a previously cached result; it does not help a query that is currently spilling. Distractor F is wrong because clearing the warehouse cache removes the local SSD data cache for table scans, which could actually make performance worse and does nothing to address in-memory aggregation spilling.

58 more questions in this domain

Practice the full bank with instant grading, flashcards, and a timed mock exam.

Start practicing free
Performance Optimization — Free SnowPro Advanced: Architect Practice Questions | DataCertPrep — Certification Prep