Courseiva

CCNA Sf De Performance Optimization Questions

51 questions · Sf De Performance Optimization topic · All types, answers revealed

1
MCQmedium

A warehouse is being used for both ETL processes and ad-hoc BI reporting. Users report that BI reports are slow during ETL runs. What is the best optimization?

A.Increase the size of the existing warehouse.
B.Separate workloads into two distinct warehouses.
C.Use the 'Economy' scaling policy for the warehouse.
D.Enable search optimization for the BI reporting tables.
AnswerB

Workload isolation is critical in Snowflake. By dedicating one warehouse to ETL and another to BI reporting, you prevent contention. This allows you to optimize each warehouse for its specific workload pattern, ensuring consistent performance for BI users regardless of how heavy the ETL jobs are.

Why this answer

The most effective way to address contention between different workload types is to isolate them into separate virtual warehouses. ETL processes are typically compute-intensive, while BI reporting requires low latency. By separating these into two warehouses, the ETL process cannot starve the BI reports of resources, and you can size each warehouse appropriately for its specific task, ensuring both workloads run efficiently without competing for the same compute resources.

Exam trap

Candidates frequently suggest modifying warehouse scaling policies or query timeouts instead of the simplest architectural fix for workload contention: separation.

2
MCQeasy

A user runs the same complex analytical query twice within 5 minutes and notices the second execution is nearly instantaneous. Which Snowflake feature is primarily responsible for this performance improvement?

A.Metadata Caching
B.Warehouse Local Disk Caching
C.Query Acceleration Service
D.Result Cache
AnswerD

The Result Cache is the only feature that can provide near-instantaneous results for identical queries by skipping all compute processing. It remains valid for 24 hours as long as the underlying data remains unchanged, making it perfect for repeated dashboard queries or frequent analytical tasks.

Why this answer

Snowflake's Result Cache stores the results of queries for 24 hours. If a user executes the exact same query and the underlying data in the table has not changed, Snowflake will return the results directly from the cache, bypassing the compute warehouse entirely and providing sub-second response times.

Exam trap

Candidates often confuse the Result Cache with the Warehouse Cache (Local Disk). They fail to distinguish that the Result Cache returns results without using any compute resources at all.

3
MCQmedium

Which of the following is the best practice for using the query profile to identify performance bottlenecks?

A.Only analyze queries that take longer than one hour.
B.Start by identifying the operator with the highest time contribution.
C.Ignore spilling metrics if the query eventually finishes.
D.Focus primarily on the number of partitions scanned.
AnswerB

The operator with the highest time contribution is the most significant bottleneck. By focusing on this node first, you address the primary source of latency. This approach ensures that your optimization efforts have the greatest possible impact on the total query duration and overall warehouse credit consumption.

Why this answer

The most effective approach is to focus on the 'heavy' operators, which are the parts of the query plan consuming the most time or resources. By analyzing the Query Profile from the top-down, an engineer can isolate where the processing is stalling. This targeted analysis is crucial for performance tuning, as it prevents wasting time on minor optimizations and ensures that efforts are directed toward the root causes of latency, such as spilling or high I/O.

Exam trap

Candidates often waste time optimizing low-impact operators or early-stage filtering instead of focusing on the 'heavy' operators that actually contribute the highest percentage to the overall query execution time.

4
MCQeasy

A data engineer is reviewing a query profile for a query that performs a large join. The profile shows a high percentage of time spent in the 'Join' node with significant 'Bytes spilled to local storage'. The engineer wants to reduce local spilling without changing the query. Which action is most appropriate?

A.Reduce the size of the smaller table in the join by filtering it.
B.Add a clustering key on the join column of the larger table.
C.Change the join type from a hash join to a sort-merge join.
D.Increase the warehouse size to provide more memory for the join operation.
AnswerD

Local spilling occurs when the join operation's intermediate results exceed the memory available on a warehouse node. Increasing the warehouse size allocates more memory per node, allowing the join to process larger datasets in memory and reducing or eliminating local spilling. This directly addresses the memory constraint without altering the query. Other options like filtering or clustering might reduce data volume but do not directly increase the memory available to the join operation.

Why this answer

Local spilling during a join indicates that the join operation is exceeding the memory available on a warehouse node. Increasing the warehouse size provides more memory per node, which can accommodate larger intermediate results and reduce spilling. Filtering, clustering, or changing join types may have indirect benefits but do not directly resolve the memory pressure.

Therefore, scaling up the warehouse is the most appropriate action.

Exam trap

The trap here is assuming that reducing data volume through filtering or clustering will automatically fix spilling, when the issue is often insufficient memory for the operation.

5
MCQhard

Refer to the exhibit. A data engineer is analyzing a Query Profile for a long-running join operation. Based on the provided JSON statistics, what is the most effective action to improve the performance of this specific query?

A.Enable the Search Optimization Service on the join columns.
B.Apply a clustering key to the tables involved in the join.
C.Rewrite the query to use a Common Table Expression (CTE).
D.Scale up the virtual warehouse to a larger size.
AnswerD

Scaling up to a larger warehouse increases the available RAM and local SSD space for each compute node. This allows the join operation to be processed entirely in memory or reduces spillage to local disk, completely avoiding the highly latent remote disk spillage that is currently degrading the query performance.

Why this answer

The exhibit shows significant spillage to both local and remote disk, with 1.2TB reaching remote storage. Remote spillage is a critical performance bottleneck because it involves network latency to S3/Azure Blob. Moving to a larger warehouse provides more memory and local storage per node, allowing the join to stay in-memory or on faster local SSDs.

Exam trap

Candidates often try to optimize the query SQL or add indexes. They fail to recognize that remote disk spillage is a hardware-capacity issue that requires more memory per node via scaling.

6
MCQmedium

Which of the following is the most cost-effective way to handle massive concurrent read-only queries?

A.Increase the warehouse size.
B.Use a multi-cluster warehouse with economy scaling.
C.Enable query pruning.
D.Create materialized views for every user.
AnswerB

Multi-cluster warehouses scale horizontally to handle high concurrency. The 'Economy' policy specifically optimizes for cost by being more conservative about adding new clusters, which is ideal for read-only workloads where some queuing is acceptable to save credits compared to the 'Standard' policy.

Why this answer

Multi-cluster warehouses are designed specifically to handle high concurrency. By setting the scaling policy to 'Economy', Snowflake adds clusters only when the queue grows, prioritizing cost over immediate startup. This allows the system to scale horizontally to meet demand without requiring manual intervention, effectively balancing user experience with credit consumption.

It is the standard solution for environments where dashboard traffic spikes and performance must be maintained without over-provisioning compute resources.

Exam trap

Candidates often select 'Maximizing' scaling policy, thinking it is the best for performance, but it ignores the cost-effectiveness requirement specified in the question for handling massive read-only concurrency.

7
MCQmedium

A user complains that a dashboard query is slow during peak hours. The warehouse is configured with auto-suspend and auto-resume. What is the most likely cause of the latency observed during the initial execution?

A.The query result cache is full.
B.Warehouse provisioning time.
C.The warehouse size is too small.
D.The metadata cache is invalidated.
AnswerB

When a warehouse is suspended, the first query triggers the provisioning of compute resources. This latency is inherent to the cloud-native architecture of Snowflake. Once the resources are active, subsequent queries will run faster because the compute is already 'warm' and ready to process incoming execution requests.

Why this answer

When a warehouse is in a suspended state, the first query submitted triggers a 'cold start' as Snowflake provisions compute resources. This process involves allocating virtual nodes, which takes a few seconds, leading to latency. This is a common occurrence in environments using auto-suspend to save costs.

Understanding this behavior is vital for performance tuning, as engineers often confuse this infrastructure provisioning time with actual query execution performance issues.

Exam trap

Candidates often incorrectly attribute the latency to network congestion or result cache misses, failing to realize that a suspended warehouse must provision resources before it can process any query.

8
MCQeasy

A query is slow because it is scanning a massive table. The filters are on columns that are not currently clustered. What is the most immediate step to improve performance?

A.Use the SEARCH OPTIMIZATION service.
B.Add a clustering key on the filter columns.
C.Rewrite the query to use an INNER JOIN.
D.Scale down the warehouse to a smaller size.
AnswerB

Clustering keys align the physical data storage with the query filter patterns. This allows Snowflake to skip micro-partitions that do not contain the data matching the filter criteria. This reduces I/O significantly, which is the primary bottleneck for massive table scans, leading to immediate performance improvements.

Why this answer

When dealing with massive table scans, the most immediate improvement comes from reducing the volume of data read. If the filter columns aren't clustered, adding a clustering key is the most direct way to inform the engine which partitions can be skipped. This is a foundational performance technique in Snowflake, allowing the database to prune partitions based on the filter criteria, thereby reducing I/O and accelerating query execution without needing to change existing query SQL code.

Exam trap

Candidates often suggest scaling up the warehouse size immediately to speed up the scan, missing that clustering is the most effective way to avoid reading irrelevant data entirely.

9
MCQmedium

A data engineer notices that a query performing a large GROUP BY on a high-cardinality column is slow. The Query Profile shows that the aggregation step is spilling to local disk. The engineer wants to reduce local spilling without changing the query logic. Which action is most appropriate?

A.Add an ORDER BY clause on the grouping column to sort data before aggregation.
B.Reduce the warehouse size to decrease contention among nodes.
C.Increase the warehouse size to provide more memory for the aggregation.
D.Set the MAX_CONCURRENCY_LEVEL parameter to 1 to give the query more resources.
AnswerC

A larger warehouse provides more memory per node and more nodes, allowing the aggregation to process higher-cardinality groups without exceeding memory limits. This directly reduces local spilling because the hash table can fit in memory. Scaling up is a standard response when the Query Profile shows local disk spilling in an aggregation step and the query logic cannot be changed.

Why this answer

Local disk spilling in a high-cardinality GROUP BY means the aggregation's hash table exceeds available memory on the nodes. Increasing the warehouse size adds memory and compute nodes, allowing the hash table to remain in memory and eliminating the spill. This is the most direct fix when the query logic cannot be changed and the profile clearly points to the aggregation step as the spill location.

Exam trap

The trap here is thinking that sorting or reducing warehouse size can fix spilling, when the real issue is insufficient memory per node for a high-cardinality aggregation.

10
MCQeasy

A data engineer is analyzing a query that filters on a column named 'status' which has only 5 distinct values. The table has 10 billion rows. The query is running slowly, and the query profile shows a full table scan. Which action is most likely to improve performance?

A.Use a materialized view that pre-filters on the 'status' column.
B.Add a search optimization service on the 'status' column.
C.Create a clustering key on the 'status' column.
D.There is no effective optimization for this query; full scan is expected.
AnswerD

When filtering on a low-cardinality column with only 5 distinct values, the query will typically return a large percentage of the table (e.g., 20% per value). Snowflake's micro-partition pruning is ineffective because most partitions contain all statuses. Thus, a full table scan is unavoidable and is the expected behavior. Other optimizations like clustering or search optimization do not help. The engineer should accept that the scan is necessary unless the query can be rewritten to filter on a more selective column.

Why this answer

Filtering on a low-cardinality column such as 'status' with only 5 values means the query will likely retrieve a large fraction of the table. Snowflake's pruning relies on micro-partition metadata, but with so few distinct values, each micro-partition will contain multiple statuses, so pruning cannot eliminate many partitions. Clustering or search optimization on such a column is ineffective.

Therefore, a full table scan is the expected and necessary operation, and there is no effective optimization for this specific filter.

Exam trap

The trap here is assuming that any filter can benefit from clustering or search optimization, when low-cardinality columns are inherently poor candidates for pruning.

11
MCQhard

A data engineer is analyzing a Query Profile for a query that joins a large fact table to a small dimension table. The profile shows a significant amount of time spent in the 'Join' operator, and the 'Bytes spilled to remote storage' metric is high. The engineer has already confirmed that the small table is used as the build side. Which optimization should the engineer try next to reduce remote spilling?

A.Increase the warehouse size to provide more memory per node.
B.Change the join type from inner join to left join to reduce data shuffling.
C.Use a clustering key on the join column of the large table to reduce the build side size.
D.Add a filter to the small table to reduce its size further.
AnswerA

Even with the small table as the build side, the probe side or other concurrent operations may exceed memory, causing remote spilling. Increasing warehouse size adds memory per node, which can eliminate the spill by allowing the join to process more data in memory. This is a direct way to address memory pressure without changing the query.

Why this answer

Remote spilling indicates that the join operator exceeded its memory budget. Even with a small build side, the probe side or concurrent operations can cause memory pressure. Increasing the warehouse size provides more memory per node, allowing the join to complete without spilling.

Other options either do not address memory or change semantics.

Exam trap

The trap here is assuming that remote spilling is always due to a large build side, when the probe side or overall memory pressure can also be the cause.

12
MCQmedium

A data engineer is analyzing a slow-running query that performs a large aggregation over a table with many columns. The query profile shows that most time is spent in the 'Aggregate' operator, and there is significant data spilling to local disk. Which action is most likely to reduce the spilling and improve performance?

A.Rewrite the query to use a window function instead of a GROUP BY aggregation.
B.Increase the warehouse size to provide more memory for the aggregation.
C.Add a clustering key on the column used in the GROUP BY clause.
D.Enable the USE_CACHED_RESULT parameter to reuse previous aggregation results.
AnswerB

Increasing the warehouse size provides more memory and compute resources per node, which can reduce or eliminate local disk spilling during aggregation. Spilling occurs when the aggregation's working set exceeds available memory. A larger warehouse has more memory, allowing the aggregation to be processed in-memory. This directly addresses the spilling issue and is a straightforward optimization.

Why this answer

Local disk spilling during aggregation indicates that the aggregation's working set exceeds the available memory on the warehouse nodes. Scaling up the warehouse provides more memory per node, which can allow the aggregation to be performed in-memory, reducing spilling and improving performance. This is a direct and effective solution for memory-bound operations.

Exam trap

The trap here is assuming that clustering or query rewriting will fix spilling, when the root cause is insufficient memory and scaling up is the most direct remedy.

13
MCQhard

Refer to the exhibit. The 'sales' table is very large and not clustered. Which action will provide the most significant performance improvement for this query?

A.Enable the Search Optimization Service on the sales table.
B.Increase the warehouse size.
C.Define a clustering key on (region, sale_date).
D.Materialize the query result in a view.
AnswerC

Clustering the table on these two columns will physically organize the micro-partitions. This enables excellent partition pruning, ensuring that the system only reads the partitions containing data for the specified region and date range, significantly reducing the I/O cost and improving the query execution speed.

Why this answer

Since the query filters by 'region' and 'sale_date', performance is bottlenecked by the need to scan large amounts of irrelevant data. By clustering the table on 'region' and 'sale_date', Snowflake will organize the micro-partitions so that they are logically grouped by these columns. This allows the query engine to ignore huge swaths of data, drastically reducing the I/O requirement and accelerating the scan portion of the query.

Exam trap

Test-takers often suggest scaling up the warehouse for filtered queries on large unclustered tables, ignoring that clustering keys are needed to fundamentally reduce unnecessary data scans.

14
MCQmedium

A data engineer notices that a daily aggregation query scans 4 TB of a 5 TB table even though it only needs the last seven days of data. The table has a DATE column but no clustering key, and the query filters with DATE >= CURRENT_DATE - 7. Query Profile shows almost no partition pruning. What is the most effective change to reduce bytes scanned?

A.Enable search optimization service on the DATE column to improve range filter performance.
B.Create a materialized view that selects only the last seven days and refresh it on a schedule.
C.Replace the filter with a BETWEEN clause using explicit literal dates instead of CURRENT_DATE arithmetic.
D.Add a clustering key on the DATE column and let Automatic Clustering maintain it.
AnswerD

Without clustering, micro-partitions can contain rows spanning wide date ranges, so a seven-day filter cannot prune much. Clustering on DATE co-locates similar dates into the same micro-partitions, enabling the optimizer to skip partitions outside the range. Automatic Clustering keeps this ordering as new data arrives, directly reducing bytes scanned for the daily query.

Why this answer

Partition pruning depends on how well the filter column correlates with micro-partition boundaries. A DATE clustering key groups similar dates together, allowing the optimizer to skip most micro-partitions for a seven-day filter. Automatic Clustering preserves that layout over time.

Predicate rewrites, materialized views, and search optimization do not change the physical clustering that governs pruning in this scenario.

Exam trap

The trap here is believing that rewriting the date predicate or adding search optimization will improve pruning, when pruning is governed by the physical clustering of the filtered column.

15
MCQhard

A user is experiencing 'Data Spilling' in a query that performs a complex window function over a very large dataset. What is the most likely reason this is occurring and how should it be addressed?

A.The query is missing a filter, and scaling out will fix it.
B.The query requires a large sort buffer; scale up the warehouse.
C.The table is not clustered, which causes excessive scanning.
D.The query needs a dedicated 'Snowpark-optimized' warehouse.
AnswerB

Window functions perform memory-intensive operations like sorting. If the dataset exceeds the memory capacity of the current warehouse size, spilling occurs. Scaling up to a larger warehouse increases the memory available to the individual nodes, allowing the sort operation to complete in RAM without disk involvement.

Why this answer

Window functions require sorting data based on the partition and order keys specified in the query. If the dataset is too large for the memory assigned to the warehouse nodes, Snowflake will spill the sorting process to local disk or remote storage. Increasing the warehouse size allocates more memory per node, which can accommodate larger sort buffers, thereby reducing or eliminating the need for disk spilling during the window function operation.

Exam trap

Candidates often think that scaling out (adding clusters) fixes data spilling caused by large window functions, confusing concurrency handling with the need for more memory per node.

16
MCQmedium

A data engineer is optimizing a query that joins a very large fact table to a small dimension table. The Query Profile shows the small table being redistributed across all nodes before the join. Which action is most likely to improve performance?

A.Broadcast the small dimension table so it is replicated to all nodes and the large fact table is not redistributed.
B.Increase the warehouse size so the redistribution of the small table completes faster across more nodes.
C.Rewrite the query to use a correlated subquery instead of a join so the small table is not redistributed.
D.Add a clustering key to the small dimension table so its rows are stored contiguously.
AnswerA

When one side of a join is small, broadcasting it to every node lets each node join its local fact rows without shuffling the large table. This converts a costly redistribution of the large input into a cheap replication of the small input, which is exactly the pattern the profile is hinting at as the bottleneck.

Why this answer

The profile shows the small relation being shuffled, which is the expensive but avoidable side of the join. Broadcasting the small table replicates it to every node so the large fact table stays in place, eliminating the shuffle of the big input. This is the standard remedy when a join's redistribution targets the wrong relation.

Exam trap

The trap here is assuming that any redistribution in a join is unavoidable and must simply be run faster with a larger warehouse, when the distribution strategy itself can be changed.

17
MCQmedium

When analyzing a Query Profile, which indicator most strongly suggests that 'Partition Pruning' is performing effectively?

A.High bytes scanned relative to bytes total.
B.Low partitions scanned compared to total partitions.
C.High network transfer metrics in the profile.
D.The presence of a 'Join' operator in the query profile.
AnswerB

Effective partition pruning means the query engine can identify and ignore irrelevant micro-partitions. Seeing a low number of partitions scanned compared to the total available count in the table is the primary metric indicating that the filtering logic is successfully narrowing the data access scope.

Why this answer

Partition pruning is the process where Snowflake skips scanning micro-partitions that cannot possibly contain the data requested by the query. A low 'Partitions scanned' count relative to the total 'Partitions total' is the most direct indicator that the pruning process is working. This is highly efficient as it avoids I/O operations for data that is not relevant to the query's filters, leading to faster execution times.

Exam trap

Many students mistakenly look at query duration or bytes spilled instead of micro-partition metrics when specifically asked to evaluate the effectiveness of partition pruning.

18
MCQhard

A data engineer wants to optimize a query that performs a point lookup on a value nested deep within a VARIANT column in a 50TB table. Which approach is the most effective for optimizing this lookup?

A.Flatten the VARIANT column into a Materialized View.
B.Enable Search Optimization on the VARIANT column's specific paths.
C.Cluster the table based on the extracted value from the VARIANT column.
D.Use a standard VIEW to pre-parse the VARIANT data for all users.
AnswerB

Snowflake's Search Optimization Service can be configured to index specific fields within a VARIANT column. This allows the engine to quickly identify which micro-partitions contain the specific nested value, avoiding a full scan of the semi-structured data and providing high-performance lookups on very large datasets.

Why this answer

The Search Optimization Service in Snowflake supports semi-structured data, including fields within VARIANT, OBJECT, and ARRAY types. By enabling search optimization on these specific paths, Snowflake creates a specialized index that allows for efficient point lookups of nested values, significantly reducing the amount of data scanned from the 50TB table.

Exam trap

Candidates mistakenly believe traditional clustering keys or standard indexes work on semi-structured VARIANT data to optimize deep path lookups, missing the specialized nature of search optimization.

19
Multi-Selecthard

A data engineer is investigating a query that reads a large table and returns only a few rows after filtering on a high-cardinality column. The Query Profile shows a high percentage of partitions scanned relative to partitions total. Which two actions should the engineer take to improve pruning? (Choose two.)

Select 2 answers
A.Increase the virtual warehouse size so more compute nodes are available to evaluate the filter predicate in parallel.
B.Convert the table to a view over the same data so the optimizer can push the filter predicate down into the view definition.
C.Define a clustering key on the frequently filtered high-cardinality column so related values are co-located in the same micro-partitions.
D.Ensure the filter predicate references the column directly with a constant or a value known at compile time rather than a non-deterministic expression.
E.Apply a filter transformation inside the query that wraps the filtered column in a function such as UPPER or CAST before comparing it to a literal.
AnswersC, D

Clustering physically orders rows by the chosen column so that a selective filter can skip micro-partitions whose value ranges fall outside the predicate. When the profile shows most partitions being scanned for a selective filter, clustering on that filter column is the direct way to raise the pruning ratio and cut the scanned data volume.

Why this answer

Effective pruning depends on two things: physical co-location of similar values and predicates the optimizer can translate into partition-value bounds. Clustering the filtered column groups similar values, while a direct comparison to a constant gives the optimizer the bounds it needs. Together they shrink the set of micro-partitions that must be read for a selective filter.

Exam trap

The trap here is assuming that a larger warehouse or a view wrapper improves pruning, when pruning is governed by micro-partition value ranges and predicate form, not by compute size.

20
MCQhard

A table experiences performance degradation over time due to frequent DML operations (INSERT/UPDATE/DELETE). What is the most likely cause?

A.The metadata cache is exceeding its capacity.
B.Micro-partition fragmentation.
C.The warehouse cache is becoming corrupted.
D.The result cache is being constantly invalidated.
AnswerB

Frequent DML operations break the physical ordering within micro-partitions. As data is changed, the original clustering becomes scattered across many partitions, reducing the effectiveness of partition pruning. This forces the engine to scan more data than necessary to satisfy the same query, leading to significant performance degradation.

Why this answer

Frequent DML operations lead to 'micro-partition fragmentation'. When rows are updated or deleted, the micro-partitions become sub-optimally filled or 'dirty'. This forces the query engine to scan more partitions than necessary because the data is no longer organized linearly.

This fragmentation is a common performance bottleneck in write-heavy environments, and it requires periodic table maintenance or clustering to restore the efficiency of the partition pruning process for subsequent reads.

Exam trap

Candidates often assume the issue is related to warehouse size or query complexity, failing to recognize that DML operations naturally degrade partition organization over time, necessitating maintenance or clustering.

21
MCQmedium

What is the primary benefit of using a 'Materialized View' over a standard view in Snowflake?

A.It supports real-time data streaming updates.
B.It automatically updates based on all underlying table changes.
C.It reduces compute costs by pre-computing query results.
D.It is the only way to join two tables in Snowflake.
AnswerC

By storing the pre-computed output of a query, materialized views save compute resources for repetitive, complex queries. This reduces the need to run the underlying logic every time the view is accessed, significantly improving read performance and reducing the overall credit consumption for heavy analytical workloads.

Why this answer

Materialized views store the pre-computed results of a query, which avoids the overhead of re-calculating the results during each execution. This is extremely beneficial for queries that are complex, resource-intensive, and executed frequently. By contrast, a standard view computes its output every time it is called, consuming compute resources and potentially causing latency for end-users, whereas materialized views provide near-instant access to the computed dataset.

Exam trap

Many students confuse materialized views with result cache or standard views, forgetting that materialized views persistently store pre-computed results on disk to save compute costs.

22
Multi-Selecthard

While reviewing a Query Profile, a data engineer notices a 'Join' operator where the number of output rows is significantly larger than the sum of the input rows. Which TWO steps should be taken to resolve this performance issue? (Select TWO)

Select 2 answers
A.Increase the size of the warehouse to handle the extra rows.
B.Verify if the join keys have a many-to-many relationship.
C.Check for missing join predicates that cause a Cartesian product.
D.Enable the Search Optimization Service on the join columns.
E.Replace the JOIN with a UNION ALL operation.
AnswersB, C

A many-to-many relationship on join keys causes each row in the first table to match multiple rows in the second, leading to an explosion of output rows. Identifying this allows the engineer to decide if the data should be aggregated before the join to ensure a one-to-many relationship.

Why this answer

An output row count significantly larger than input row counts indicates an 'exploding join' or Cartesian product, usually caused by many-to-many relationships or missing join conditions. Validating the join predicates and ensuring the join keys are unique or properly filtered can stop the exponential growth of the intermediate result set.

Exam trap

Candidates often assume the join is just slow because the warehouse is too small. They fail to spot the 'exploding join' symptom, which is a logic error rather than a resource issue.

23
MCQmedium

A data engineer runs a query that joins a 5 TB fact table to a 200 GB dimension table. The query profile shows a broadcast operation for the dimension table and a local spilling node on the fact table. The engineer wants to reduce local spilling without changing the query results. The warehouse is a multi-cluster warehouse with sufficient memory. Which action is most likely to reduce local spilling?

A.Increase the warehouse size to provide more memory per node.
B.Add a clustering key on the join column of the fact table.
C.Reduce the size of the fact table by filtering out rows before the join.
D.Disable broadcast for the dimension table to force a shuffle join.
AnswerA

Local spilling happens when an operation exceeds the memory allocated to a warehouse node. Increasing the warehouse size adds more compute resources and memory per node, which can accommodate larger intermediate results and reduce or eliminate local spilling. This directly addresses the memory constraint without altering the query logic. Other options, such as changing join order or disabling broadcast, may not resolve the underlying memory issue if the data volume per node remains high.

Why this answer

Local spilling indicates that an operation is exceeding the memory available on a warehouse node. Increasing the warehouse size provides more memory per node, which can prevent or reduce spilling. While other actions like filtering or clustering might reduce data volume, they do not directly address the memory constraint of the operation.

Disabling broadcast could change the join strategy but may introduce other bottlenecks. Therefore, scaling up the warehouse is the most direct solution.

Exam trap

The trap here is assuming that any data reduction technique will fix spilling, when the root cause is often insufficient memory per node for the operation.

24
MCQmedium

A data engineer is loading 1TB of data from an S3 bucket into Snowflake using the COPY command. The data consists of 10,000 small files (approx. 100KB each). How will this file size affect the loading performance?

A.Loading will be slow due to the high overhead of processing many small files.
B.Performance will be optimal because many files allow for maximum parallelism.
C.The warehouse will automatically group the files into larger chunks before loading.
D.Snowflake will only use a single thread to maintain data integrity for small files.
AnswerA

Each file processed by the COPY command involves metadata overhead and network handshakes. With 10,000 tiny files, the warehouse spends more time managing the file list and opening connections than actually moving data, leading to very poor utilization of the compute resources and longer load times.

Why this answer

Snowflake performance is optimized when file sizes are between 100MB and 250MB compressed. Having 10,000 tiny files creates excessive overhead because each file requires a separate metadata operation and a separate request to the cloud storage. This prevents the warehouse from effectively parallelizing the load and saturating its compute nodes.

Exam trap

Candidates often assume that loading more files in parallel is always faster. They overlook the metadata overhead of thousands of tiny files, which prevents effective parallelization and saturates the compute nodes unnecessarily.

25
MCQmedium

Refer to the exhibit. Based on the Query Profile, what is the most likely bottleneck for this query?

A.Insufficient warehouse memory.
B.Inefficient data filtering and large data scans.
C.Network congestion between nodes.
D.Excessive joins causing data shuffling.
AnswerB

Because the table scan dominates the query profile, the query is likely reading more data than necessary. Implementing clustering keys or using partition pruning can reduce the volume of data scanned, directly targeting the primary cause of the high execution time shown in the profile.

Why this answer

In this profile, the Table Scan accounts for the vast majority (85%) of the total query time. This indicates that the query is spending most of its duration reading data from storage rather than performing complex joins or aggregations. The lack of remote disk spilling suggests that memory is sufficient.

Therefore, improving the scan performance through clustering or partition pruning is the most logical step to reduce execution time.

Exam trap

Candidates often misinterpret high scan times as a need for more compute power, failing to realize that high scan percentages indicate data organization issues like poor clustering or missing filters.

26
MCQhard

Which TWO of the following are considered 'anti-patterns' for performance in Snowflake?

A.Using one large warehouse for all user workloads.
B.Specifying column names instead of SELECT *.
C.Utilizing multi-cluster warehouses for concurrency.
D.Using SELECT * in production application code.
E.Implementing materialized views for performance.
AnswerA, D

Consolidating all workloads into one warehouse prevents resource isolation. A single complex query can monopolize the warehouse, causing delays for other users. Separating workloads into different warehouses based on priority or type is a best practice to ensure predictable performance and effective resource management.

Why this answer

Using a single massive warehouse for all workloads leads to poor resource isolation and contention, as simple queries compete with heavy ones. Additionally, using SELECT * in production code is an anti-pattern because it retrieves unnecessary columns, forcing the system to read more data blocks than required. Both practices degrade performance and increase costs by wasting I/O and compute resources on operations that could be avoided.

Exam trap

Candidates often confuse anti-patterns with regular scaling best practices, assuming that using large compute resources or dynamic filtering always hurts performance, leading them to misidentify basic tuning options as harmful choices.

27
MCQhard

A data engineer maintains a table that receives continuous small INSERT statements throughout the day. Query performance on this table has degraded even though total data volume is modest, and the Query Profile shows many very small micro-partitions being scanned. Which action best addresses the underlying cause?

A.Schedule periodic reclustering of the table using a clustering key on the most selective filter column.
B.Increase the warehouse size so the larger compute pool can scan the many small micro-partitions in parallel.
C.Batch the incoming rows and load them less frequently, or use a staging table and periodically merge into the target.
D.Convert the table to a transient table so Snowflake stops maintaining the metadata for the small micro-partitions.
AnswerC

Frequent single-row or tiny INSERT statements create many small micro-partitions, which inflates metadata overhead and forces the optimizer to scan numerous fragments. Accumulating rows and loading them in larger batches produces fewer, better-sized micro-partitions, directly reducing the fragmentation that the profile is revealing as the cause of the slowdown.

Why this answer

The profile evidence of many tiny micro-partitions points to ingestion pattern rather than query design or compute. Each small insert creates its own micro-partition, so the table becomes a patchwork of fragments that the optimizer must enumerate and scan. Batching or staging-then-merging reduces the number of partitions created, which lowers metadata and scan overhead at the source.

Exam trap

The trap here is reaching for reclustering or a larger warehouse when the real issue is that frequent small inserts are generating an excessive number of undersized micro-partitions.

28
MCQeasy

A data engineer notices that a query against a large table returns results quickly when filtering on one column but scans the entire table when filtering on another column. Both columns are used in equality predicates. What is the most likely explanation?

A.The fast column has a lower cardinality, so the optimizer can use metadata to skip partitions.
B.The fast column is a clustering key, so the optimizer can prune micro-partitions for that predicate.
C.The fast column is part of the table's primary key, which automatically prunes partitions.
D.The fast column is defined with a NOT NULL constraint, which enables partition skipping.
AnswerB

Clustering keys cause related rows to be co-located in the same micro-partitions, so equality predicates on the clustering column allow the optimizer to skip partitions that cannot contain matches. The other column lacks that physical ordering, so the scan must read all partitions. This explains the difference in performance between the two equality filters and is the most likely cause.

Why this answer

Micro-partition pruning depends on the physical ordering of data. A clustering key aligns the data so that equality filters on that column can skip irrelevant micro-partitions, while an unclustered column forces a full scan. This accounts for the difference in the observed query times.

Exam trap

The trap here is attributing pruning to constraints or cardinality when pruning actually depends on the physical clustering of data.

29
MCQmedium

Which of the following scenarios is most appropriate for using a Materialized View to optimize performance?

A.Frequently run queries involving complex joins and aggregations on static data.
B.Queries that are run only once a month.
C.Queries that access data from an external stage.
D.Queries that filter on non-deterministic functions.
AnswerA

Materialized views are ideal for frequently executed queries that involve intensive operations like complex joins and aggregations. Because the result set is stored and updated automatically as the base table changes, subsequent queries retrieve the result directly, drastically reducing compute costs and improving response times for end users.

Why this answer

Materialized Views in Snowflake are best suited for queries that are frequently executed, computationally expensive, and rely on stable, non-volatile data. By pre-computing the result set and storing it, Snowflake avoids the overhead of repeated aggregation or complex joins. This is essential for dashboarding or reporting where the same transformation is run repeatedly, saving both compute credits and time while ensuring the underlying data remains consistent with the base table.

Exam trap

Candidates often incorrectly suggest Materialized Views for high-churn or frequently updated tables, forgetting that materialized views incur maintenance costs and are best suited for static, high-read datasets.

30
Multi-Selectmedium

A data engineer is monitoring warehouse performance and notices a high 'Warehouse Overload' status. Which TWO metrics from the Query History or Warehouse Load monitoring views should be prioritized to confirm the warehouse is undersized? (Select TWO)

Select 2 answers
A.Queued Overload Time
B.Total Number of Queries Executed
C.Percentage of Metadata Scans
D.Remote Disk Spillage
E.Data Scanned from Cache
AnswersA, D

Queued Overload Time represents the amount of time a query spent waiting for warehouse resources because the warehouse was already at maximum capacity. A high value here is a direct indication that the warehouse is under-provisioned for the current level of concurrency and needs to scale out or up.

Why this answer

Warehouse overloading is characterized by queries waiting in a queue because all available compute threads are occupied. High queuing times (Queued Overload Time) and significant disk spillage (Remote Disk Spillage) are the primary indicators that the current warehouse size cannot handle the concurrency or the memory requirements of the workload.

Exam trap

Candidates often select general compute metrics like CPU utilization or warehouse credit usage instead of queuing and memory spill metrics when diagnosing undersized warehouses.

31
MCQeasy

A data engineer notices that a dashboard query returns instantly on repeat executions but takes much longer the first time each morning. No data has changed overnight. Which Snowflake feature is most directly responsible for the fast repeat executions?

A.The metadata cache holds micro-partition statistics that let the optimizer skip execution entirely and return a stored row set.
B.The query result cache stores the result of the identical query and returns it without re-executing, as long as the underlying data and query text are unchanged.
C.The local disk cache on the warehouse nodes retains the scanned micro-partitions so the second execution reads them without remote I/O.
D.The virtual warehouse remains suspended overnight, so the first execution warms it and later executions reuse the warmed compute.
AnswerB

When an identical query is re-run and the underlying tables have not changed, Snowflake returns the persisted result from the query result cache without recomputing it. That is why repeat executions are near-instant while the first execution after the cache expires or data changes must run fully, matching the observed morning pattern.

Why this answer

The near-instant repeat execution with unchanged data is the signature of the query result cache, which persists results and serves identical queries without recomputation. The first run of the day must execute because the result is not yet cached or was invalidated, and any data change would also invalidate it.

Exam trap

The trap here is attributing the speedup to a warmed warehouse or disk cache, when an unchanged identical query returning instantly is the query result cache at work.

32
Multi-Selecthard

A data engineer is optimizing a Snowflake environment for a data warehouse that experiences high concurrency during business hours. The engineer observes that many queries are small and frequent, and the warehouse is often queued. The engineer wants to reduce queueing and improve throughput without increasing cost significantly. Which two actions should the engineer take? (Choose two.)

Select 2 answers
A.Implement a separate warehouse for small, frequent queries and another for large, long-running queries.
B.Increase the warehouse size from Medium to Large.
C.Set the STATEMENT_QUEUED_TIMEOUT_IN_SECONDS parameter to a low value.
D.Enable the multi-cluster warehouse feature and set the minimum and maximum clusters to 2.
E.Enable the 'USE_CACHED_RESULT' parameter and increase the result cache size.
AnswersA, D

Workload separation isolates small queries from large ones, preventing large queries from monopolizing resources and causing queueing for small queries. By dedicating a warehouse to small, frequent queries, they can run with minimal queueing, while the other warehouse handles heavy workloads. This is a best practice for concurrency management and can be cost-effective if each warehouse is sized appropriately and auto-suspend is enabled.

Why this answer

High concurrency with many small queries is best addressed by increasing parallelism through multi-cluster warehouses and by isolating workloads to prevent resource contention. Multi-cluster warehouses dynamically add clusters to handle queued queries, while workload separation ensures that small queries are not blocked by large ones. Scaling up a warehouse or tweaking timeout parameters does not increase concurrency, and result caching is ineffective for unique queries.

Therefore, the two correct actions are enabling multi-cluster and separating workloads.

Exam trap

The trap here is confusing concurrency with per-query performance, leading to scaling up the warehouse instead of scaling out with multi-cluster or workload isolation.

33
MCQmedium

A data engineer runs a long-running aggregation query and inspects the Query Profile. The profile shows a single operator with an output row count roughly 400 times larger than its input row count, and the downstream operator is bottlenecked. Which action should the engineer take to resolve this?

A.Enable the Search Optimization Service on the base table so the exploding operator can skip micro-partitions and emit fewer rows.
B.Reduce the number of rows produced by the exploding operator by moving the aggregation to a separate earlier stage or by rewriting the join/grouping logic so cardinality grows later in the plan.
C.Disable the query result cache at the account level so the exploding operator re-executes and produces a smaller result set.
D.Increase the size of the virtual warehouse to add more compute nodes so the exploding operator can process more rows per second.
AnswerB

An operator whose output rows massively exceed its input rows indicates an unintended row explosion, usually from a fan-out join or an incorrect grouping key. Because the explosion happens before the aggregation, the downstream operator must process every duplicated row, so fixing the cardinality growth is the only action that addresses the actual bottleneck.

Why this answer

The decisive clue is an operator emitting far more rows than it receives, which is the signature of a cardinality explosion rather than a compute or pruning problem. Adding warehouse capacity, toggling result caching, or enabling search optimization all leave that multiplication intact. Only restructuring the plan so the aggregation occurs before or alongside the fan-out keeps downstream operators from processing duplicated rows.

Exam trap

The trap here is assuming a large intermediate row count always means insufficient warehouse compute, when the profile is actually pointing to a join or grouping that multiplies rows.

34
MCQmedium

A company is using a Multi-cluster Warehouse (MCW) with a 'Standard' scaling policy. Users report that during peak morning hours, query queuing occurs briefly before a new cluster starts. What is the effect of changing the scaling policy to 'Economy' in this scenario?

A.Queuing will decrease because the Economy policy optimizes cluster distribution.
B.Queuing will increase because the warehouse waits longer to start a new cluster.
C.Performance will remain identical but the total credit consumption will decrease.
D.The warehouse will automatically scale up to a larger T-shirt size.
AnswerB

The Economy policy only starts a new cluster if it estimates there is enough work to keep it busy for at least six minutes. This delay is intended to prevent the frequent starting and stopping of clusters to save credits, but it directly results in longer queue times for users.

Why this answer

The Economy scaling policy prioritizes credit savings over immediate performance by waiting until there is enough consistent load to keep a new cluster busy for six minutes. In this scenario, switching to Economy would likely increase queuing times because the system becomes more conservative about spinning up additional compute resources compared to the Standard policy.

Exam trap

Candidates often select the 'Economy' policy expecting it to improve performance by conserving resources, missing that it actually increases queuing by delaying the startup of new clusters.

35
MCQmedium

A data engineer runs a query on a Snowflake virtual warehouse that scans a 5 TB table but returns only 100 rows. The Query Profile shows that the TableScan operator processed 5 TB of data even though a highly selective filter on a non-clustered column was applied. The warehouse is sized Medium. Which action will most effectively reduce the amount of data scanned by this query?

A.Create a materialized view that selects all columns from the table.
B.Add a clustering key on the filtered column and enable automatic clustering.
C.Increase the warehouse size from Medium to 2X-Large.
D.Add a search optimization service to the table.
AnswerB

Clustering the table on the filtered column co-locates similar values in the same micro-partitions, so the optimizer can prune micro-partitions that cannot contain matching rows. This directly reduces bytes scanned by the TableScan, which is the reported bottleneck. Because the table is large and the filter is highly selective, clustering yields the greatest reduction in I/O and improves performance without resizing the warehouse.

Why this answer

The TableScan reads 5 TB because the filter column is not clustered, so micro-partition pruning cannot eliminate irrelevant data. Adding a clustering key on the filtered column, with automatic clustering enabled, reorganizes micro-partitions so the optimizer can skip most of them. This reduces bytes scanned and directly targets the bottleneck shown in the Query Profile, rather than adding compute or duplicating data.

Exam trap

The trap here is assuming that a larger warehouse reduces the volume of data scanned, when it only increases the speed at which the same bytes are processed.

36
MCQeasy

A data engineer is investigating a slow query that scans a large table. The Query Profile shows that the table scan is reading a very high number of micro-partitions compared to the total number of partitions in the table. The query filters on a column that is not the clustering key. What is the most likely explanation for the high number of partitions read?

A.The query is using a full table scan because the filter column is not indexed.
B.The table has too many columns, causing the scan to read all partitions.
C.The table is not clustered on the filter column, so pruning is ineffective.
D.The warehouse is too small, causing the scan to read partitions multiple times.
AnswerC

When a table is not clustered on the filter column, the micro-partition metadata may show wide ranges for that column, causing the optimizer to scan many partitions to find matching rows. Without clustering, data is organized by insertion order, which often leads to overlapping values and poor pruning. This directly explains the high number of partitions read.

Why this answer

Pruning efficiency depends on how well data is clustered on the filter column. Without clustering, micro-partitions contain overlapping values, so the optimizer cannot skip many partitions. This results in a high number of partitions read.

Warehouse size, indexing, and column count do not affect the number of partitions scanned in Snowflake.

Exam trap

The trap here is assuming that a small warehouse or lack of indexes causes more partitions to be read, when pruning is purely a metadata and clustering concern.

37
MCQmedium

A data engineer notices that a recurring daily query that joins a large fact table with a date dimension is taking longer than expected. The query filters on a date range and joins on a date key. The fact table is clustered by date_key, and the date dimension is small. The query profile shows a Cartesian join warning. Which action should the engineer take to resolve the Cartesian join and improve performance?

A.Ensure the join condition uses the correct columns and is not accidentally omitted.
B.Add a WHERE clause to filter the date dimension to the same range as the fact table.
C.Add a clustering key on the date dimension's date key.
D.Increase the warehouse size to handle the larger result set.
AnswerA

A Cartesian join warning indicates that the join is producing a Cartesian product, typically because the join condition is missing, always true, or uses incorrect columns. The engineer should verify that the join predicate correctly matches the date_key in the fact table to the primary key in the date dimension. Fixing the join condition eliminates the Cartesian product, reducing the result set to the intended matches and dramatically improving performance. This is the direct solution to the warning.

Why this answer

A Cartesian join warning in the query profile signals that the join is producing a Cartesian product, usually due to a missing or incorrect join condition. The most direct fix is to ensure the join predicate correctly matches the fact table's date_key to the date dimension's key. This eliminates the Cartesian product, reducing the result set and improving performance.

Other options like filtering or scaling up do not address the root cause and may lead to incorrect results or inefficiency.

Exam trap

The trap here is assuming that performance issues from a Cartesian join can be solved by adding filters or more resources, when the real fix is correcting the join condition.

38
MCQhard

A data engineer runs a transformation that loads a 50 GB staged file into a target table using a COPY INTO statement with a single large file. The warehouse is a MEDIUM multi-cluster warehouse. The load takes far longer than expected because one node processes the entire file. Which change most directly improves load throughput?

A.Split the staged file into multiple smaller files of roughly 100-250 MB compressed and load them in the same COPY INTO statement.
B.Set the ON_ERROR option to CONTINUE and re-run the COPY INTO statement.
C.Enable multi-cluster scaling by setting the maximum cluster count to four on the warehouse.
D.Increase the warehouse size from MEDIUM to 4X-LARGE before running the same COPY INTO statement.
AnswerA

COPY INTO parallelizes work across the files in a stage, so a single monolithic file forces one thread to process the entire load. Splitting the data into many smaller compressed files lets the warehouse distribute file processing across nodes, dramatically increasing throughput. The 100-250 MB compressed target size is the recommended range that balances parallelism against per-file overhead, making this the most direct fix for the described bottleneck.

Why this answer

COPY INTO distributes work per file, so throughput scales with the number of files rather than the size of the warehouse. Breaking a single large file into many moderately sized compressed files enables parallel processing across nodes, which is the direct remedy for a load dominated by one file.

Exam trap

The trap here is reaching for a larger warehouse or multi-cluster scaling when the real constraint is that a single file cannot be parallelized.

39
MCQhard

A data engineer is optimizing a query that aggregates a large sales table by product category and region. The query currently uses a GROUP BY on two high-cardinality columns and produces a large intermediate result set. The query profile shows significant network traffic and remote spilling. The engineer wants to reduce remote spilling without changing the aggregation logic. Which approach is most likely to achieve this?

A.Add a clustering key on the product category column.
B.Rewrite the query to use a two-step aggregation with a temporary table.
C.Enable the query acceleration service on the warehouse.
D.Increase the warehouse size to provide more memory per node.
AnswerD

Remote spilling happens when intermediate results exceed local memory and are written to remote storage. Increasing the warehouse size allocates more memory per node, allowing the aggregation to process larger partitions in memory and reducing the need to spill remotely. This directly addresses the memory constraint without altering the query. While other options might have indirect benefits, scaling up the warehouse is the most straightforward way to mitigate remote spilling caused by memory-intensive aggregations.

Why this answer

Remote spilling occurs when an operation's intermediate results exceed available memory and are written to remote storage. Increasing the warehouse size provides more memory per node, which can accommodate larger intermediate results and reduce or eliminate remote spilling. While clustering and query acceleration can improve performance in other ways, they do not directly address the memory pressure of the aggregation.

Rewriting the query might help but is not as direct or reliable as scaling up.

Exam trap

The trap here is assuming that clustering or query acceleration will fix spilling, when the core issue is memory capacity for the aggregation operation.

40
MCQmedium

Which of the following describes the purpose of the 'Result Cache' in Snowflake?

A.It stores data blocks to improve subsequent table scans.
B.It provides instant access to query results without compute costs.
C.It allows users to manually clear cache for specific tables.
D.It persists query results permanently in the user's stage.
AnswerB

The Result Cache stores the output of previous queries. When a subsequent query matches the original exactly, Snowflake retrieves the results from the cache instead of running the query again. This avoids the need to spin up or utilize a warehouse, resulting in zero cost for that specific operation.

Why this answer

The Result Cache is a managed feature that stores the output of a query for a period (typically 24 hours). If an identical query is submitted later, Snowflake returns the cached results immediately without using any compute resources. This is a critical performance and cost optimization tool, as it eliminates the need to re-process large datasets for common, repeated queries, providing near-zero latency and zero credit consumption.

Exam trap

Test-takers frequently confuse the Result Cache with virtual warehouse caches, assuming that active warehouse compute credits are required to retrieve previously executed identical query outputs.

41
MCQhard

A data engineer is analyzing a Query Profile for a query that joins three large tables. The profile shows that the optimizer chose a broadcast join for one of the joins, but the broadcasted table is 50 GB. The query is spilling to remote disk. Which action is most likely to improve performance by changing the join strategy?

A.Add a clustering key on the join columns of all three tables.
B.Increase the warehouse size to 4X-Large.
C.Rewrite the query to use a CROSS JOIN instead of an INNER JOIN.
D.Collect statistics on the join columns and ensure the tables are not stale.
AnswerD

The optimizer relies on statistics to estimate cardinality and choose join strategies. If statistics are stale or missing, it may incorrectly estimate the broadcasted table as small and choose a broadcast join. Refreshing statistics on the join columns gives the optimizer accurate row counts, allowing it to select a more appropriate join strategy, such as a hash join with a smaller build side, reducing spilling.

Why this answer

The optimizer chose a broadcast join for a 50 GB table, which is inefficient and causes spilling. This often happens when statistics are stale or missing, leading to underestimation of the table size. Collecting statistics on the join columns provides accurate cardinality estimates, enabling the optimizer to choose a better join strategy, such as a hash join with a smaller build side.

This directly addresses the root cause.

Exam trap

The trap here is assuming that a larger warehouse fixes a poor join strategy, when the real issue is likely inaccurate statistics driving the optimizer's choice.

42
MCQmedium

Refer to the exhibit. A data engineer runs this query to investigate clustering costs. The output shows high credit consumption but the 'Clustering Depth' of the table remains high. What is the most likely cause of this behavior?

A.The table is being continuously updated with data that overlaps existing ranges.
B.The clustering key is defined on a column with a 'Date' data type.
C.The warehouse used for clustering is too small for the table size.
D.The Search Optimization Service is conflicting with the clustering service.
AnswerA

When new data is inserted or existing data is updated in a way that creates overlapping ranges in the clustering key, the clustering service must work harder. If the rate of these changes is high, the service consumes many credits while struggling to keep the table well-organized.

Why this answer

High credit consumption combined with high clustering depth usually indicates that the table is being frequently updated or appended with data that is significantly 'out of order' relative to the clustering key. This causes the Automatic Clustering service to continuously work to re-sort the data, but the constant influx of unsorted data prevents the depth from improving.

Exam trap

Candidates often blame the Automatic Clustering service for being broken. They fail to realize that constant, out-of-order DML updates effectively 'undo' the clustering, causing a loop of expensive, ineffective maintenance.

43
MCQeasy

A data engineer notices that a dashboard query is running slowly. The query filters a large table on a column with high cardinality and returns a small number of rows. The engineer wants to improve performance for this specific query pattern. Which Snowflake feature is most appropriate?

A.Query acceleration service
B.Search optimization service
C.Materialized view
D.Clustering key on the filtered column
AnswerB

Search optimization service is designed to accelerate selective point lookups and queries that filter on high-cardinality columns and return a small number of rows. It builds a search access path that allows the optimizer to quickly locate matching rows without scanning all micro-partitions. This directly addresses the slow dashboard query pattern.

Why this answer

Search optimization service is the ideal Snowflake feature for accelerating selective point lookups on high-cardinality columns. It creates a persistent search access path that allows the optimizer to efficiently find matching rows, reducing the need to scan entire micro-partitions. This results in faster response times for dashboard queries that filter on specific values and return few rows.

Exam trap

The trap here is confusing search optimization with clustering or query acceleration, but only search optimization is purpose-built for selective point lookups on high-cardinality columns.

44
MCQeasy

A data engineer is reviewing a Query Profile for a query that filters a large table on a column with a very high cardinality, such as a UUID. The query applies an equality predicate on that column and returns a single row. The table is not clustered on that column. Which Snowflake feature is designed to accelerate this type of highly selective point lookup?

A.Automatic clustering
B.Search optimization service
C.Materialized view with a cluster by clause
D.Query acceleration service
AnswerB

Search optimization service is specifically designed to accelerate highly selective point lookups and equality predicates on columns, even when the table is not clustered on those columns. It maintains a search access path that allows the optimizer to find matching micro-partitions quickly. For a UUID equality filter returning a single row, this is the intended use case and provides significant latency improvement.

Why this answer

Search optimization service is designed to accelerate highly selective point lookups and equality predicates, such as a UUID equality filter returning a single row. It maintains a search access path that lets the optimizer locate matching micro-partitions without scanning the entire table. Clustering, query acceleration, and materialized views serve different purposes and do not target point lookups as directly.

Exam trap

The trap here is confusing search optimization with clustering, when search optimization is the feature specifically built for highly selective point lookups.

45
MCQmedium

A query is filtering a table based on a 'TRANSACTION_DATE' column using a range (e.g., BETWEEN '2023-01-01' AND '2023-01-31'). The table is 500GB and not explicitly clustered. Why might this query still perform well and show good partition pruning?

A.The Result Cache is automatically storing the range for all users.
B.Snowflake automatically clusters all Date columns by default.
C.The data was inserted in chronological order, creating natural clustering.
D.The query is small enough to fit entirely in the warehouse's metadata cache.
AnswerC

Most time-series data is loaded as it is generated, meaning rows with similar dates are grouped into the same micro-partitions. Snowflake’s metadata tracks the min/max values of every column in each partition, so a range filter on a naturally ordered column can effectively prune most of the table.

Why this answer

Snowflake micro-partitions are immutable and created in the order data is inserted. If the data is naturally loaded in chronological order, the 'TRANSACTION_DATE' values will be naturally clustered within the micro-partitions. This 'natural clustering' allows the metadata-driven pruning to skip partitions that fall outside the date range, even without an explicit clustering key.

Exam trap

Candidates often assume a table must have an explicit clustering key to be fast. They fail to understand that natural data insertion order can provide the same benefits as explicit clustering.

46
MCQeasy

A data engineer runs a dashboard query that aggregates sales by region for the current month. The query scans a large fact table but returns only a few rows. The Query Profile shows that most time is spent scanning micro-partitions that do not contain the current month's data. Which feature should the engineer use to improve performance for this recurring query?

A.Enable the USE_CACHED_RESULT session parameter for the dashboard user.
B.Create a materialized view that pre-aggregates sales by region and month.
C.Increase the warehouse size to a larger multi-cluster warehouse.
D.Add a search optimization service to the fact table on the region column.
AnswerB

A materialized view stores the pre-computed aggregation, so the recurring dashboard query can read a much smaller, pre-aggregated result set instead of scanning the full fact table. Snowflake automatically maintains the materialized view as base data changes, and the optimizer can rewrite queries to use it, dramatically reducing scan time for this repetitive aggregation pattern.

Why this answer

The recurring dashboard query aggregates a large fact table but returns few rows, and the profile shows scanning of unnecessary micro-partitions. A materialized view pre-aggregates sales by region and month, so the query reads a compact result instead of the base table. Snowflake maintains the view automatically and can transparently rewrite the query to use it, cutting scan time and cost for this repetitive pattern.

Exam trap

The trap here is confusing result caching or search optimization with a materialized view, when only a materialized view pre-aggregates and persistently reduces the scanned data for recurring aggregations.

47
MCQeasy

A user runs a query twice in succession with no data changes. The second query completes in near-zero time. What feature is responsible for this performance?

A.Warehouse Local Cache.
B.Metadata Cache.
C.Query Result Cache.
D.Search Optimization Service.
AnswerC

The Query Result Cache is specifically designed to store and reuse the output of previously executed queries. When a query is repeated and the data remains unchanged, Snowflake retrieves the result directly, bypassing the execution process entirely and resulting in near-instant performance for the user.

Why this answer

The Query Result Cache stores the output of every query for a rolling 24-hour period. When a subsequent query matches the exact SQL text and the underlying data in the source tables has not changed, Snowflake returns the result from the cache. This mechanism avoids the need to spin up compute resources or scan data, providing an instantaneous response for repeated queries, which is a major efficiency feature for frequently accessed reports.

Exam trap

Candidates frequently mistake this behavior for warehouse caching or data clustering improvements, failing to identify that the Query Result Cache specifically handles identical SQL executions on unchanged data.

48
MCQmedium

When designing a clustering key for a table that is frequently joined with other tables, which strategy generally provides the best performance for the join operation?

A.Cluster on the most frequently used filter column in the WHERE clause.
B.Cluster on the column with the highest cardinality in the table.
C.Cluster on the column used as the join key.
D.Cluster on a column that is never updated or changed.
AnswerC

Clustering on join keys allows Snowflake to perform partition pruning during the join. If both tables in a join are clustered on their respective join keys, the optimizer can significantly reduce the amount of data read and processed, as it only needs to compare partitions with overlapping key ranges.

Why this answer

Clustering a table on the columns used in join predicates (the join keys) ensures that Snowflake can use join pruning and potentially more efficient join algorithms. When data is co-located within micro-partitions based on the join key, the engine can skip entire partitions that do not have matching keys in the other table, reducing I/O.

Exam trap

Candidates often choose clustering keys based on the primary key or date, regardless of query patterns. They overlook the importance of matching the clustering key to the join predicate.

49
MCQmedium

A data engineer is tuning a query that joins two large tables. The query is performing a 'Remote Disk Spilling' operation. Which optimization strategy is most effective to resolve this?

A.Increase the multi-cluster warehouse scaling policy to 'Maximized'.
B.Enable Result Cache by setting USE_CACHED_RESULT to TRUE.
C.Scale up the warehouse to a larger size.
D.Implement a materialized view on the joined columns.
AnswerC

Increasing the warehouse size provides more memory per node. Since a single query can only execute within the memory limits of the nodes assigned to it, a larger warehouse provides the necessary resources to hold intermediate join states in RAM, effectively eliminating the need to spill to remote storage.

Why this answer

Remote disk spilling occurs when the memory allocated to the virtual warehouse is insufficient to hold the intermediate result sets of a join or aggregation. By increasing the size of the warehouse, the memory available per node doubles, allowing larger datasets to be processed entirely in-memory. This significantly reduces latency associated with I/O operations and speeds up complex join operations that frequently cause spilling in standard configurations.

Exam trap

Candidates often suggest rewriting the query or adding indexes, but Snowflake does not use traditional indexes; scaling up the warehouse is the standard solution to provide more memory for joins.

50
MCQmedium

A data engineer maintains a very large fact table that is loaded nightly with the previous day's orders. Analysts run reports that almost always filter on ORDER_DATE and also aggregate by CUSTOMER_ID. The engineer wants search optimization to accelerate point lookups on ORDER_ID and CUSTOMER_ID without adding clustering maintenance overhead. Which configuration best meets these requirements?

A.Define a clustering key on (ORDER_DATE, CUSTOMER_ID) and let automatic clustering maintain it.
B.Add a unique constraint on ORDER_ID and rely on the optimizer to use it for pruning.
C.Create a materialized view that pre-aggregates the table by ORDER_DATE and CUSTOMER_ID.
D.Enable the search optimization service on the CUSTOMER_ID and ORDER_ID columns.
AnswerD

Search optimization builds a persistent search access path that accelerates equality and IN predicates on the designated columns, which is exactly the point-lookup pattern described. It is maintained automatically as new micro-partitions are added by nightly loads, so no manual reclustering work is required. Clustering keys would instead target range pruning and require background maintenance, so enabling search optimization is the appropriate low-overhead choice here.

Why this answer

Search optimization is designed for selective point lookups and equality predicates on specific columns, and it is maintained automatically as new data lands, which matches the nightly-load pattern and the desire to avoid clustering maintenance. Clustering and materialized views address different access patterns, and unique constraints do not create physical access paths.

Exam trap

The trap here is assuming that a clustering key or unique constraint can substitute for search optimization when the real workload is single-value lookups.

51
MCQhard

A data engineer runs a nightly transformation that joins a 12 TB fact table to a 300 GB dimension table. The fact table is clustered by DATE_KEY, and the dimension is small enough to fit in memory. Query Profile shows the join operator building a hash table on the 12 TB side and spilling to remote disk. The engineer wants to eliminate the remote spill without increasing warehouse size. Which action should the engineer take?

A.Increase the warehouse size by one step so the join operator receives more memory per node.
B.Add a clustering key on the 12 TB fact table using the dimension's primary key column.
C.Convert the 12 TB fact table to a materialized view joined with the dimension table and refresh it nightly.
D.Rewrite the join so the 300 GB dimension table is the build side and the 12 TB fact table is the probe side.
AnswerD

Hash joins build the hash table on the smaller input and stream the larger input as the probe side. With a 300 GB dimension as the build side and the 12 TB fact as the probe side, the hash table is far smaller and can be held in memory, avoiding remote disk spill. This directly addresses the spill without resizing the warehouse.

Why this answer

Hash join performance depends on which input is used to build the in-memory hash table. Building on the smaller dimension and probing with the large fact table keeps the hash table resident in memory, eliminating remote disk spilling. Clustering, resizing, or materializing the join do not correct the build-side selection, so they leave the root cause of the spill unaddressed.

Exam trap

The trap here is assuming that a remote spill is always solved by a larger warehouse or by clustering, when the join's build-side choice is what determines whether the hash table fits in memory.

Ready to test yourself?

Try a timed practice session using only Sf De Performance Optimization questions.