What you will be able to do
- Choose between resizing a warehouse and adding clusters by telling a slow, complex query apart from a queuing problem
- Work out the credit cost of a warehouse size, a multi-cluster configuration and a resize
- Balance query speed against credit consumption by comparing what a query costs per run before and after a change, and by testing sizes on homogeneous workloads
- Decide when a memory-heavy Snowpark workload needs a Snowpark-optimized warehouse and which RESOURCE_CONSTRAINT to set
- Measure queued load in ACCOUNT_USAGE and cap warehouse spend with auto-suspend and resource monitors
Key concept
Scale up vs scale out — Scaling up means making each cluster bigger, which helps a large or complex query finish faster. Scaling out means adding clusters of the same size, which lets more queries run at once instead of waiting in a queue. Neither one fixes the other's problem.
1.Scaling up: warehouse size, query complexity and credits
Every query, DML statement and load in Snowflake runs on a virtual warehouse, and the warehouse's size sets how much compute each of its clusters has. Each size step from X-Small to 6X-Large doubles the compute and doubles the credits per hour. Billing is per second, with a 60-second minimum each time the warehouse starts. So a warehouse that resumes for a 5-second query is still billed for a full minute.
| Size | Credits / hour | Note |
|---|---|---|
| X-Small | 1 | Default for CREATE WAREHOUSE |
| Small | 2 | |
| Medium | 4 | |
| Large | 8 | |
| X-Large | 16 | Default for warehouses created in Snowsight |
| 4X-Large | 128 |
Query complexity decides whether a bigger size pays off. A large join or aggregation that is CPU- and memory-bound on a Small warehouse gets more compute and memory per cluster after a resize, so it finishes sooner. A short lookup doesn't, and on a larger warehouse it just runs at a higher rate. The safe way to test is to upsize, re-run the query, and go back to the original size if the speed-up doesn't justify the cost. A resize doesn't affect queries that are already running. The new resources go to queued and newly submitted queries.
Some other changes look like fixes for a slow query but aren't. Adding clusters (scaling out) gives more queries a place to run, but each query still runs on a single cluster of the same size. Search optimization speeds up selective point lookups that return a few rows, not aggregations across a whole fact table. A resource monitor threshold sends an alert or suspends a warehouse when spending hits a limit, and it adds no compute. Data loading is also a poor reason to upsize, because load speed depends more on the number and size of the files than on the warehouse size.
Balancing optimization against credit consumption means judging a change by what each query costs to run, not by the warehouse's hourly rate. A warehouse consumes credits only while it runs, so a faster query costs less, and the cheapest size is often not the smallest one. Measure the cost of a query before a change and again after it, and keep whichever setup costs less for a speed the business accepts.
Per-second billing and auto-suspend make that comparison cheap to run. You can start a new warehouse at a larger size and decrease it once you see the workload. A fair test runs the same queries on several sizes, for example X-Large, Large and Medium, using queries that normally finish within 5 to 10 minutes.
Sizing only works when the warehouse runs similar queries. Put dashboard lookups on one warehouse and month-end joins on another: on a shared warehouse the lookups pay the joins' rate, and the joins stay starved at the lookups' size. When only a handful of outlier queries need more compute, the query acceleration service bills extra for just those queries instead of upsizing the whole warehouse.
Checkpoint 1 of 8· Check yourself
An analyst runs a monthly report on a Small warehouse. It joins and aggregates a large fact table and takes 40 minutes. Few other queries run at the same time, and the warehouse rarely has a queue. Which change is most likely to make this report finish faster?
This is one complex query on a lightly loaded warehouse, so it needs more compute per cluster, which means scaling up. Extra clusters only let more queries run at the same time. Search optimization helps selective point lookups, not full-table aggregations. A resource monitor adds no compute.
“Using a larger warehouse has the biggest impact on larger, more complex queries, and may not improve the performance of small, basic queries.”Source: docs.snowflake.com
Checkpoint 2 of 8· Exam question
A dashboard runs a single complex aggregation query against a 10 TB fact table. The query currently runs on a Small warehouse and takes 40 minutes because it is CPU- and memory-bound on one node, but only a handful of users run it concurrently. Which change addresses the bottleneck?
Correct answer: A — Resize the warehouse to a larger size (scale up) so the single query gets more compute and memory per node to process the complex aggregation faster
- A. Correct: a single expensive query bound by CPU and memory on one node benefits from scaling up, since a larger warehouse size gives each node in the cluster more compute and memory to work through the same aggregation faster.
- B. Incorrect: multi-cluster warehouses scale out to handle more concurrent queries by spinning up additional clusters, but they do not make any single query run faster because each query still executes on one cluster.
- C. Incorrect: search optimization service accelerates highly selective point-lookup and equality/IN predicates on large tables, not a full-table aggregation scan that touches most of the data regardless of index structures.
- D. Incorrect: resource monitor notify thresholds only alert administrators about credit consumption; they do not change how compute resources are allocated to a running query, so they would not reduce the 40-minute runtime.
2.Scaling out: multi-cluster warehouses for queuing
Queuing is a capacity problem, not a speed problem. A warehouse reserves compute for each query it accepts. When it has none left, the next query waits until a running one finishes. A BI warehouse where every dashboard query finishes in seconds once it starts, but users still wait at 9 a.m., has this problem. A multi-cluster warehouse solves it by adding more clusters of the same size. Multi-cluster warehouses require Enterprise Edition.
A multi-cluster warehouse has a minimum and a maximum cluster count, and their values set the mode. The SCALING_POLICY property controls how aggressively auto-scale mode starts and shuts down clusters, which helps control credits. Snowflake's advice is to start in auto-scale with a low maximum, such as 2 or 3 with a minimum of 1, and raise it as you learn the workload's peaks.
| Mode | How it is set | Behaviour | Fits |
|---|---|---|---|
| Maximized | Minimum = maximum (greater than 1) | All clusters start when the warehouse starts | Steady, high concurrency that doesn't change much |
| Auto-scale | Minimum < maximum | Clusters start when queries queue and shut down as load drops | Concurrency that fluctuates, such as business-hours peaks |
Credits scale with the number of clusters actually running. The maximum hourly cost is the size's rate times the maximum cluster count, so a Medium warehouse with 3 clusters can use at most 12 credits an hour. In auto-scale mode, if one cluster runs for two hours, a second runs for the second hour and a third runs for 30 minutes, the warehouse uses 14 credits, not 24. Resizing a multi-cluster warehouse applies the new size to every cluster. The maximum cluster count also shrinks as size grows: 300 for X-Small to Medium, 160 for Large and 10 for 4X-Large and above.
Two other changes can look like answers to queuing. The parameters STATEMENT_QUEUED_TIMEOUT_IN_SECONDS and STATEMENT_TIMEOUT_IN_SECONDS limit how long a statement can wait or run. They add no capacity, so queued work gets cancelled instead of served. A materialized view changes what each query reads, but the same number of queries still competes for one cluster. Resizing helps concurrency only a little, because resizing is mainly meant to make queries faster.
Checkpoint 3 of 8· Check yourself
Dashboard queries on a Medium BI warehouse (Enterprise Edition) finish in seconds once they start. But on weekday mornings, users wait because queries queue, and the warehouse is quiet the rest of the day. Which configuration best fixes the waiting without paying for idle capacity?
The waiting comes from a lack of capacity at peak times, and the load goes up and down. Auto-scale mode (minimum lower than maximum) adds clusters of the same size only while queries queue, then shuts them down. Maximized mode runs every cluster all the time, so you pay for idle clusters during quiet hours. Resizing mainly speeds up individual queries. A queue timeout cancels the waiting queries instead of running them.
“start with Auto-scale mode and start small (for example, maximum = 2 or 3, minimum = 1)”Source: docs.snowflake.com
Checkpoint 4 of 8· Exam question
A BI warehouse serves dozens of analysts running short, similar dashboard queries. During business hours, Query Profile shows individual queries complete quickly once running, but WAREHOUSE_LOAD_HISTORY shows a high queued-load ratio during peak hours. Which configuration change best relieves the bottleneck?
Correct answer: A — Enable multi-cluster warehouse mode with an appropriate maximum cluster count so extra clusters start automatically when queued load rises
- A. Correct: high queued-load with fast individual queries indicates a concurrency problem, not a per-query compute problem, and multi-cluster warehouses are designed to add clusters automatically so more short queries run in parallel instead of waiting in line.
- B. Incorrect: the queries already run fast once started, so scaling up compute per query would not address queries that are stuck waiting for a slot on an already-busy single cluster.
- C. Incorrect: a materialized view can reduce the work each query does, but it does not increase the number of queries a warehouse can run concurrently, so queuing caused by too many simultaneous statements on one cluster would persist.
- D. Incorrect: lowering the queued timeout only cancels queries that wait too long; it discards work instead of letting it run, and does nothing to add capacity for the concurrent dashboard load.
3.Snowpark-optimized warehouses for memory-heavy code
Some Snowpark workloads fail because they run out of memory, not because they lack compute. A Python stored procedure that trains a model runs on a single warehouse node. If the training data doesn't fit in that node's memory, the job fails with an out-of-memory error at any standard size. A Snowpark-optimized warehouse fixes this by giving each node 16 times the memory of a standard warehouse by default. UDF and UDTF workloads can benefit too. Workloads that don't use Snowpark might not benefit.
The RESOURCE_CONSTRAINT property controls memory per node and CPU architecture. Each memory tier requires a minimum warehouse size. The 1 TB option is currently available only on AWS, where it is still in preview.
| Memory (up to) | RESOURCE_CONSTRAINT values | Minimum warehouse size |
|---|---|---|
| 16GB | MEMORY_1X, MEMORY_1X_x86 | XSMALL |
| 256GB | MEMORY_16X, MEMORY_16X_x86 (MEMORY_16X is the default) | M |
| 1TB | MEMORY_64X, MEMORY_64X_x86 | L |
CREATE WAREHOUSE so_warehouse WITH
WAREHOUSE_SIZE = 'LARGE'
WAREHOUSE_TYPE = 'SNOWPARK-OPTIMIZED'
RESOURCE_CONSTRAINT = 'MEMORY_16X_X86';Snowpark-optimized warehouses have extra costs. They use credits at their own rate, listed in the Snowflake Service Consumption Table, and they can take longer than standard warehouses to create and resume. The usual alternatives don't fix a single-node memory limit. Adding clusters doesn't split one stored procedure across clusters. The query acceleration service offloads the scanning and filtering parts of large queries, not a model held in memory.
Checkpoint 5 of 8· Fill the gap
A Python stored procedure that trains a model on a single warehouse node fails with out-of-memory errors at every standard warehouse size. You create a Large warehouse with 256 GB of memory per node on x86 to fix it. Which value completes the statement?
CREATE WAREHOUSE so_warehouse WITH
WAREHOUSE_SIZE = 'LARGE'
WAREHOUSE_TYPE = ?
RESOURCE_CONSTRAINT = 'MEMORY_16X_X86';The job fails because one node runs out of memory, and a bigger standard warehouse doesn't fix that. A Snowpark-optimized warehouse gives each node much more memory, and only that type accepts a RESOURCE_CONSTRAINT memory tier such as MEMORY_16X_X86. Extra clusters can't split one stored procedure across clusters, and 'MEMORY-OPTIMIZED' isn't a warehouse type.
Source: docs.snowflake.comCheckpoint 6 of 8· Exam question
A data engineering team runs a Python stored procedure that trains a scikit-learn model entirely within a single Snowpark session, and the workload frequently fails with out-of-memory errors even on a Large standard warehouse. Which warehouse configuration should the team use instead?
Correct answer: A — A Snowpark-optimized warehouse, which provides substantially more memory per node than a standard warehouse of the same size for memory-intensive single-node workloads
- A. Correct: Snowpark-optimized warehouses provide significantly more memory per node than standard warehouses of the same size, which is exactly suited to single-node, memory-intensive workloads like in-memory ML model training that run inside one Snowpark session.
- B. Incorrect: resizing a standard warehouse increases the number of servers in the cluster and per-node resources at higher tiers, but a single-threaded, single-node Python training job cannot spread across that added cluster capacity, so the out-of-memory condition on that node persists.
- C. Incorrect: multi-cluster warehouses scale out to run more concurrent queries across separate clusters; they do not give one single stored procedure execution access to more memory on the node it happens to run on.
- D. Incorrect: query acceleration service targets scan-heavy and filtering portions of SQL queries by offloading them to serverless compute; it does not apply to memory consumed by a Python process executing arbitrary in-memory training code.
4.Measuring queues and load in ACCOUNT_USAGE
Look at the warehouse's load before choosing a fix. The SNOWFLAKE.ACCOUNT_USAGE schema keeps history views for the account. Its WAREHOUSE_LOAD_HISTORY view reports load as a ratio: total execution time of queries in a given state, divided by the length of the interval. Four queries totalling 276 seconds in a 300-second interval give a load of 0.92. A high avg_queued_load means queries are waiting for capacity, so scale out. A high avg_running load with no queuing means the queries already compete for resources, so a bigger warehouse may help less than expected.
SELECT TO_DATE(start_time) AS date,
warehouse_name,
SUM(avg_running) AS sum_running,
SUM(avg_queued_load) AS sum_queued
FROM snowflake.account_usage.warehouse_load_history
WHERE TO_DATE(start_time) >= DATEADD(month,-1,CURRENT_TIMESTAMP())
GROUP BY 1,2
HAVING SUM(avg_queued_load) >0;ACCOUNT_USAGE has two practical limits. You need access to the shared SNOWFLAKE database, and by default only ACCOUNTADMIN has it. The views also lag behind real time: up to 120 minutes for RESOURCE_MONITORS and up to 180 minutes for QUERY_ACCELERATION_ELIGIBLE. When you need current data, use INFORMATION_SCHEMA table functions in the database instead, such as INFORMATION_SCHEMA.MATERIALIZED_VIEW_REFRESH_HISTORY(), which has a matching ACCOUNT_USAGE view.
Checkpoint 7 of 8· Fill the gap
Users say queries on a reporting warehouse sometimes wait before they start. Before you add clusters, you want a list of only the days in the last month when queries on each warehouse waited for capacity. Which column completes the HAVING clause?
SELECT TO_DATE(start_time) AS date,
warehouse_name,
SUM(avg_running) AS sum_running,
SUM(avg_queued_load) AS sum_queued
FROM snowflake.account_usage.warehouse_load_history
WHERE TO_DATE(start_time) >= DATEADD(month,-1,CURRENT_TIMESTAMP())
GROUP BY 1,2
HAVING SUM( ? ) >0;avg_queued_load measures time that queries spent waiting for warehouse capacity. Filtering on it keeps only the days with queuing, which is the signal to scale out with more clusters. avg_running measures load from queries that are already running. A high running load with no queuing means queries compete for resources, so it is not a sign that you need more clusters.
Source: docs.snowflake.com5.Warehouse constraints on credit consumption
Several warehouse settings each cap spending in a different way:
- Auto-suspend, on by default, stops an idle warehouse from using credits. On a multi-cluster warehouse it applies only when the minimum number of clusters is running and nothing has run for the set period.
- Maximum cluster count caps how far auto-scale can multiply the hourly rate.
- Who can resize: restrict it, because users who upsize for one query often forget to size back down.
- Resource monitors set a credit quota for each interval and take actions at threshold percentages of that quota.
Each resource monitor can have one SUSPEND action, one SUSPEND_IMMEDIATE action and up to five NOTIFY actions. Thresholds can go above 100%. SUSPEND lets running queries finish and then suspends the warehouse. SUSPEND_IMMEDIATE cancels running queries. NOTIFY only sends a notification. A monitor does nothing until it has at least one action and is assigned to the account or to warehouses. Each warehouse can belong to only one monitor below the account level, and an account-level monitor doesn't override a warehouse's own monitor.
Resource monitors have two limits. First, they only control warehouses. Serverless features such as Snowpipe, automatic reclustering and materialized view maintenance run on Snowflake-provided compute that no monitor can suspend. Second, they aren't exact. A warehouse can keep using credits for a short time after the threshold, even with SUSPEND_IMMEDIATE. To enforce a hard quota, set the suspend threshold below 100%, for example at 90%.
Checkpoint 8 of 8· Check yourself
At 6 p.m., three clusters are running on an auto-scale multi-cluster warehouse with a minimum of 1 cluster, a maximum of 4 clusters and auto-suspend set to 10 minutes. Then all queries stop. When can auto-suspend stop the warehouse from using credits?
Auto-suspend works on the whole warehouse, not on individual clusters. On a multi-cluster warehouse, it suspends the warehouse only when the minimum number of clusters is running and nothing has run for the set period. Before that, auto-scale shuts down the extra clusters as the load drops.
“Auto-suspend only occurs when the minimum number of clusters is running and there is no activity for the specified period of time.”Source: docs.snowflake.com
Sources
(13)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Size specifies the amount of compute resources available per cluster in a warehouse.”
↩︎ Scaling up: warehouse size, query complexity and credits“Snowflake utilizes per-second billing (with a 60-second minimum each time the warehouse starts)”
↩︎ Scaling up: warehouse size, query complexity and credits“Data loading performance is influenced more by the number of files being loaded”
↩︎ Scaling up: warehouse size, query complexity and credits“Snowflake provides some object-level parameters that can be set to help control query processing and concurrency”
↩︎ Scaling out: multi-cluster warehouses for queuing“Multi-cluster warehouses are an Enterprise Edition feature.”
↩︎ Scaling out: multi-cluster warehouses for queuing“Auto-suspend ensures that you don’t leave a warehouse running (and consuming credits) when there are no incoming queries.”
↩︎ Warehouse constraints on credit consumption“Auto-suspend only occurs when the minimum number of clusters is running and there is no activity for the specified period of time.”
↩︎ Checkpoint - 2.
“Using a larger warehouse has the biggest impact on larger, more complex queries, and may not improve the performance of small, basic queries.”
↩︎ Scaling up: warehouse size, query complexity and credits“If a warehouse is heavily loaded, concurrent queries might be competing for its compute resources”
↩︎ Measuring queues and load in ACCOUNT_USAGE“By default, only the ACCOUNTADMIN role has the privileges needed to execute the queries.”
↩︎ Measuring queues and load in ACCOUNT_USAGE“Best practice is to limit who can adjust the size of a warehouse.”
↩︎ Warehouse constraints on credit consumption“if a query runs twice as fast on the next largest warehouse, the total cost of running the query remains the same.”
↩︎ Exam trap 2“if a query runs twice as fast on the next largest warehouse, the total cost of running the query remains the same.”
↩︎ Prediction - 3.
“Selective point lookup queries on tables.”
↩︎ Scaling up: warehouse size, query complexity and credits - 4.
“virtual warehouses consume credits only during the time they are running a query, so a faster query costs less to run.”
↩︎ Scaling up: warehouse size, query complexity and credits“virtual warehouses consume credits only during the time they are running a query, so a faster query costs less to run.”
↩︎ Exam trap 3 - 5.
“per-second credit billing and auto-suspend give you the flexibility to start with larger sizes and then adjust the size to match your workloads.”
↩︎ Scaling up: warehouse size, query complexity and credits“The queries you experiment with should be of a size and complexity that you know will typically complete within 5 to 10 minutes”
↩︎ Scaling up: warehouse size, query complexity and credits“try to execute relatively homogeneous queries (complexity, data sets, etc.) on the same warehouse”
↩︎ Scaling up: warehouse size, query complexity and credits - 6.
“This can be cost effective for warehouses that run a mixed workload”
↩︎ Scaling up: warehouse size, query complexity and credits - 7.
“If sufficient resources are not available to execute all the queries submitted to the warehouse, Snowflake queues the additional queries”
↩︎ Scaling out: multi-cluster warehouses for queuing“Snowflake automatically starts additional clusters, up to the maximum number defined for the warehouse.”
↩︎ Scaling out: multi-cluster warehouses for queuing“the maximum number of credits consumed per hour for a Medium-size multi-cluster warehouse with 3 clusters is 12 credits.”
↩︎ Scaling out: multi-cluster warehouses for queuing“Multi-cluster warehouses are best utilized for scaling resources to improve concurrency for users/queries.”
↩︎ Key concept“They are not as beneficial for improving the performance of slow-running queries or data loading.”
↩︎ Exam trap 1“start with Auto-scale mode and start small (for example, maximum = 2 or 3, minimum = 1)”
↩︎ Checkpoint - 8.
“The default configuration for a Snowpark-optimized warehouse provides 16x memory per node compared to a standard warehouse.”
↩︎ Snowpark-optimized warehouses for memory-heavy code“Example workloads include Machine Learning (ML) training use cases using a stored procedure on a single virtual warehouse node.”
↩︎ Snowpark-optimized warehouses for memory-heavy code“Initial creation and resumption of a Snowpark-optimized virtual warehouse might take longer than standard warehouses.”
↩︎ Snowpark-optimized warehouses for memory-heavy code - 9.
“reducing the wall-clock time spent in scanning and filtering”
↩︎ Snowpark-optimized warehouses for memory-heavy code - 10.
“Latency for the view may be up to 120 minutes (2 hours).”
↩︎ Measuring queues and load in ACCOUNT_USAGE - 11.
“Latency for the view may be up to 180 minutes (three hours).”
↩︎ Measuring queues and load in ACCOUNT_USAGE - 12.
“SUSPEND_IMMEDIATE: Suspend all assigned warehouses immediately and cancel any currently running queries or statements using the warehouses.”
↩︎ Warehouse constraints on credit consumption - 13.
“a warehouse can be assigned to only a single resource monitor below the account level.”
↩︎ Warehouse constraints on credit consumption“Utilize buffers in the quota thresholds for actions (e.g. set a threshold to 90% instead of 100%).”
↩︎ Warehouse constraints on credit consumption“An account-level resource monitor does not control credit usage by the Snowflake-provided compute resources for serverless features”
↩︎ Exam trap 4