CertSafari
    Snowflake SnowPro Advanced: Architect (ARA-C01)· Lessons

    Domain 4 · Lesson 12/13

    Snowflake Warehouse Performance Tuning: Query Profile, Spilling, Queuing, QAS and Snowpark-Optimized Warehouses

    Outline performance tools, best practices, and appropriate scenarios where they should be applied.

    17 min read
    10% of exam
    14 sources
    Published 5 Oct 2026
    Docs as of 4 Oct 2026

    What you will be able to do

    • Use Query History, the Query Profile and ACCOUNT_USAGE views to find out why a query is slow
    • Read a Query Profile, spot the bottleneck (spilling, poor pruning, low cache use) and name the matching recommendation
    • Choose virtual warehouse settings: size, type, auto-suspend/resume, cluster counts, scaling policy and query acceleration
    • Explain how a clustering key and automatic clustering maintenance fit with natural clustering, and when they are worth their credits
    • Tell memory spillage apart from queuing, and pick scale up (resize) or scale out (multi-cluster) to match
    • Decide when the query acceleration service helps, and limit what it costs with the scale factor
    • Recognise workloads that need a Snowpark-optimized warehouse

    Key concept

    Symptom-driven warehouse tuning — Each warehouse lever fixes one specific symptom. More size fixes memory spillage, more clusters fix queuing, and query acceleration fixes outlier scans. You diagnose first, then apply the matching lever to a warehouse that runs similar work.

    1.Diagnose before you tune: Query History, Query Profile and warehouse load

    Tuning starts with evidence. In Snowsight, Monitoring » Query History has a Duration column that you can sort to find the longest-running queries. You can filter it by user or by warehouse. Once you have a slow query, open its Query Profile. It shows which parts of the query took the longest, and it shows which operator nodes are spilling data to storage. The sources used for this lesson don't list individual operator names or exact Query Profile thresholds. What they do teach is how to read the profile: find the nodes that take the most time or spill, then match each one to a lever.

    Query-level evidence doesn't show warehouse-level problems. For those, go to Compute » Warehouses and open the Warehouse Activity chart, which shows warehouse load and whether queries were queued. You can also analyse history in bulk by querying the SNOWFLAKE.ACCOUNT_USAGE views, such as QUERY_HISTORY. By default only ACCOUNTADMIN has the privileges to run those diagnostic queries.

    Snowflake's warehouse-level strategies and the problem each one targets
    StrategyWhat it addresses
    Reduce queuesTime a query spends waiting before it starts
    Resolve memory spillageA warehouse running out of memory so bytes spill onto storage
    Increase warehouse sizeNot enough compute resources for a query or set of queries
    Try query accelerationOffloading portions of query processing to serverless compute
    Optimize the warehouse cacheReading from the warehouse cache instead of from tables
    Limit concurrently running queriesToo many queries putting demands on the warehouse's resources
    Find the ten worst spilling queries of the last 45 days in ACCOUNT_USAGE.QUERY_HISTORYsql
    SELECT query_id, SUBSTR(query_text, 1, 50) partial_query_text, user_name, warehouse_name,
      bytes_spilled_to_local_storage, bytes_spilled_to_remote_storage
    FROM  snowflake.account_usage.query_history
    WHERE (bytes_spilled_to_local_storage > 0
      OR  bytes_spilled_to_remote_storage > 0 )
      AND start_time::date > dateadd('days', -45, current_date)
    ORDER BY bytes_spilled_to_remote_storage, bytes_spilled_to_local_storage DESC
    LIMIT 10;

    Checkpoint 1 of 7· Check yourself

    Users report that queries sometimes wait before they even start. Which Snowsight view shows directly whether queries were queued on a warehouse?

    Interpreting a Query Profile follows three steps: find the bottleneck, classify it, then recommend a change.

    1. Find the bottleneck. The Query Profile shows the query execution plan as operator nodes. Each node shows its operator type and the time it used, as a percentage of the query duration. The Most Expensive Nodes pane lists the operator nodes that take the longest, so start there. The profile's information panes are Profile Overview, Query Insights, Statistics, Most Expensive Nodes and Attributes. Query Insights gives a general recommendation when a condition affects performance. You can also read the same statistics in SQL with the GET_QUERY_OPERATOR_STATS table function.

    2. Classify it. Execution time is broken into Processing, Local Disk IO, Remote Disk IO, Network Communication, Synchronization and Initialization. Time in Processing means the CPU was busy. Time in the disk IO categories means processing was blocked waiting on disk. The Statistics pane adds spilling counters (bytes spilled to local and remote storage), IO figures such as the percentage scanned from cache, and Pruning figures: partitions scanned against partitions total.

    3. Recommend. Match the signal to a lever, then re-run the query and compare its execution time.

    From Query Profile signal to recommendation
    Query Profile signalLikely bottleneckRecommendation
    Bytes spilled to local or remote storage on an operator nodeWarehouse ran out of memoryUse a larger warehouse, or process data in smaller batches
    Partitions scanned is close to partitions total on a large, frequently queried tableLittle pruning, so the query reads most of the tableConsider a clustering key on the columns used in selective filters
    Low percentage scanned from cache for frequent, similar queriesWarehouse cache is not being reusedReview the auto-suspend setting so the cache isn't dropped between queries
    An outlier query with a large scan and a selective filterQuery uses more resources than the typical queryCheck QUERY_ACCELERATION_ELIGIBLE, then try the query acceleration service

    Virtual warehouse configuration is where most of these recommendations are applied. The main settings are:

    - Type: Standard or Snowpark-optimized. - Size: the compute available per cluster. It can be changed at any time, even while the warehouse runs. - AUTO_SUSPEND: seconds of inactivity before the warehouse suspends. The default is 600, or 10 minutes. 0 or NULL means it never suspends, which is not recommended unless the workload needs a continually running warehouse. The background process that suspends warehouses runs approximately every 30 seconds, so the setting doesn't give precise control, and a value below 30 or not a multiple of 30 might not behave as expected. Suspending drops the warehouse cache. Snowflake's guideline is about 5 minutes for DevOps, DataOps and data science use cases, and at least 10 minutes for BI and SELECT query warehouses. Match the value to the gaps in your workload: a warehouse that runs a query every 30 minutes gains nothing from a 10-minute setting. - AUTO_RESUME: defaults to TRUE, so the warehouse starts when a query is submitted. Snowflake recommends leaving it disabled if you wish to control costs or user access, and resuming the warehouse manually only when needed. With it enabled, expect a short delay on resume while compute is provisioned. - MIN_CLUSTER_COUNT and MAX_CLUSTER_COUNT: a value above 1 for MAX_CLUSTER_COUNT makes it a multi-cluster warehouse. Equal values mean Maximized mode, and a lower minimum means Auto-scale mode. SCALING_POLICY (STANDARD or ECONOMY) applies in Auto-scale mode. - ENABLE_QUERY_ACCELERATION: turns on the query acceleration service. - RESOURCE_MONITOR: caps the credits the warehouse can use.

    Changing the auto-suspend time limit, which is specified in secondssql
    ALTER WAREHOUSE my_wh SET AUTO_SUSPEND = 600;

    Clustering is the storage-side lever the profile's pruning figures point to. Snowflake generally produces well-clustered data, which is its natural clustering. Over time, particularly as DML occurs on very large tables, the data might no longer cluster well on the dimensions you query. A clustering key is a subset of columns, or expressions, that you designate to co-locate rows in the same micro-partitions. Queries that filter or sort on the key then skip data that doesn't match.

    Auto-clustering is the maintenance Snowflake performs for you. Once a key is defined, no further administration is needed, and Snowflake performs all future maintenance to keep the table clustered. It doesn't re-cluster immediately: Snowflake only performs automated maintenance if the table will benefit. That maintenance uses compute resources that consume credits, so cluster only when queries will benefit substantially. Clustering fits best when the table is very large (multiple terabytes), the queries are selective or sort, most queries use the same few columns, and the table is queried often but changes rarely. Snowflake recommends a maximum of 3 or 4 columns per key. A key can be set with CREATE TABLE or ALTER TABLE, and altered or dropped at any time. For selective point lookups on columns that aren't a good clustering key, the search optimization service is the alternative.

    Sources12345678

    2.Memory spillage and scaling up

    When a warehouse runs out of memory during a query, the data spills to local disk, and performance drops sharply. If the query needs even more memory, the data spills to remote cloud-provider storage, which is slower still. That means remote spill is the more serious signal. Snowflake recommends two remedies. You can use a larger warehouse, which gives the operation more memory and local storage, or you can process the data in smaller batches. Adding clusters doesn't help here, because each query still runs with one cluster's memory.

    Scaling up is cheap to try. You can resize a warehouse at any time, even while it is running. Each size step doubles the hourly credit rate, but billing is per second, with a 60-second minimum each time the warehouse starts. That means a larger warehouse that finishes the query faster doesn't necessarily cost more in total. After resizing, rerun the query and compare its execution time.

    Gen1 standard warehouse sizes and credits per hour (each step doubles)
    Warehouse sizeCredits / hour (Gen1)
    X-Small1
    Small2
    Medium4
    Large8
    X-Large16

    Checkpoint 2 of 7· Check yourself

    A warehouse has the query acceleration service enabled. QUERY_HISTORY shows a small nonzero bytes_spilled_to_remote_storage for many queries that otherwise run fast. What is the right interpretation?

    Checkpoint 3 of 7· Exam question

    An architect opens the Query Profile for a report that has slowed from 4 seconds to 90 seconds after a data volume increase. The profile shows one `TableScan` operator consuming 85% of total execution time, with a low percentage of partitions pruned relative to partitions scanned. What does this pattern indicate, and what should the architect try first?

    Sources39

    3.Queuing and scaling out with multi-cluster warehouses

    Queuing is a different problem from spilling. Each query might run fine once it starts, but it has to wait in a queue before starting, and that wait adds to the time before the user gets results. Warehouse query load measures the average number of queries that were running or queued over an interval, so it is the metric to watch for this symptom.

    A bigger warehouse isn't the natural fix for concurrency. The documented alternative is to scale out: a multi-cluster warehouse adds capacity without changing the warehouse size. Multi-cluster warehouses require the Enterprise Edition of Snowflake, and a MAX_CLUSTER_COUNT above 1 can only be set on Enterprise Edition or higher. A multi-cluster warehouse scales compute to meet user and query concurrency as demand changes, for example between peak and off-peak hours. In Auto-scale mode, Snowflake starts and shuts down clusters as load changes. A scaling policy controls this. The default Standard policy favours starting more clusters over saving credits: when a query is queued, or when the running clusters can't take more work, Snowflake adds a cluster. The Economy policy conserves credits by keeping running clusters fully loaded. It starts a new cluster only if the system estimates enough query load to keep that cluster busy for at least 6 minutes, and it marks the least-loaded cluster for shutdown when it has less than 6 minutes of work left. The trade-off is that queries may be queued and take longer to complete. Scaling policies apply only in Auto-scale mode. In Maximized mode (minimum equals maximum) all clusters run at the same time.

    You can also reduce contention by limiting how many queries run concurrently in the warehouse, so fewer queries compete for its resources.

    Checkpoint 4 of 7· Check yourself

    A BI warehouse handles each query quickly once the query starts, but at 9 a.m. dozens of dashboard queries queue. No query spills. Which change fits the symptom?

    Checkpoint 5 of 7· Exam question

    In the Query Profile's execution details panel, an architect sees a node labeled `Join` at the top of the "Most Expensive Nodes" list, consuming 70% of the total query time, while the `TableScan` nodes feeding it each consume under 5%. What should the architect conclude about where to focus tuning effort?

    Sources101191213

    4.Query acceleration service for outlier queries

    Some warehouses mostly run well-behaved queries plus an occasional outlier: a query that uses far more resources than typical. The query acceleration service (QAS) handles these outliers by offloading portions of the query processing work to shared compute resources that the service provides. It targets two patterns. The first is large scans with an aggregation or a selective filter. The second is large scans that insert or copy many rows. A query can be ineligible for several reasons: the scan has too few partitions, the filters aren't selective enough, the GROUP BY cardinality is too high, or the query uses nondeterministic functions such as RANDOM.

    You turn it on with ENABLE_QUERY_ACCELERATION = TRUE. It is also on by default for Gen2 standard warehouses and multi-cluster warehouses. Two metadata tools tell you whether QAS is worth enabling. The SNOWFLAKE.ACCOUNT_USAGE.QUERY_ACCELERATION_ELIGIBLE view ranks queries and warehouses by eligible execution time. The SYSTEM$ESTIMATE_QUERY_ACCELERATION function takes a query ID and returns estimated run times at different scale factors.

    SYSTEM$ESTIMATE_QUERY_ACCELERATION output for an eligible query: estimated seconds per scale factorjson
    {
      "estimatedQueryTimes": {
        "1": 171,
        "10": 115,
        "2": 152,
        "4": 133,
        "8": 120
      },
      "ineligibleReason": null,
      "originalQueryTime": 300.291,
      "queryUUID": "8cd54bf0-1651-5b1c-ac9c-6a9582ebd20f",
      "status": "eligible",
      "upperLimitScaleFactor": 10
    }

    Cost is controlled by QUERY_ACCELERATION_MAX_SCALE_FACTOR, which multiplies the warehouse's size and cost. For example, a Medium warehouse costs 4 credits per hour. With a scale factor of 5, it can lease up to 5 times its size, which can cost up to 20 extra credits per hour. QAS is billed per second, only while it is in use, and separately from warehouse usage. The default scale factor is 8 when you enable QAS explicitly and 2 when it is enabled implicitly on a Gen2 or multi-cluster warehouse. Setting it to 0 removes the upper bound.

    Checkpoint 6 of 7· Fill the gap

    Which property completes this statement so that the new warehouse has query acceleration enabled?

    CREATE WAREHOUSE my_wh WITH  ?  = true;

    Sources6

    5.Snowpark-optimized warehouses for memory-heavy code

    Warehouses come in two types, Standard and Snowpark-optimized. A Snowpark-optimized warehouse lets you configure the memory and CPU architecture of a single-node instance. By default it provides 16x memory per node compared with a standard warehouse. It is the recommended choice for Snowpark code with large memory needs or a dependency on a specific CPU architecture, such as ML training in a stored procedure on a single warehouse node. UDF and UDTF workloads can also benefit. Workloads that don't use Snowpark might not benefit. One trade-off: creating or resuming a Snowpark-optimized warehouse can take longer than a standard one.

    Creating a Snowpark-optimized warehousesql
    CREATE OR REPLACE WAREHOUSE snowpark_opt_wh WITH
      WAREHOUSE_SIZE = 'MEDIUM'
      WAREHOUSE_TYPE = 'SNOWPARK-OPTIMIZED';
    RESOURCE_CONSTRAINT options for Snowpark-optimized warehouses (default MEMORY_16X)
    Memory (up to)RESOURCE_CONSTRAINT valuesMinimum warehouse size
    16GBMEMORY_1X, MEMORY_1X_x86XSMALL
    256GBMEMORY_16X, MEMORY_16X_x86M
    1TBMEMORY_64X, MEMORY_64X_x86L

    Checkpoint 7 of 7· Check yourself

    A data science team's Python stored procedure trains a model in memory on one node and keeps failing for lack of memory on a standard warehouse. Which option is the documented fit?

    Sources14

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Adding clusters to a multi-cluster warehouse fixes a query that spills to remote storage.Why is that wrong?

      Spilling means a single query lacks memory. The documented fixes are a larger warehouse size or processing data in smaller batches. Extra clusters address concurrency.

      Covered in Memory spillage and scaling up

    2. 2.The QAS scale factor always defaults to 8.Why is that wrong?

      It is 8 when QAS is enabled explicitly, but 2 when Snowflake enables it automatically for Gen2 or multi-cluster warehouses at creation.

      Covered in Query acceleration service for outlier queries

    3. 3.After you define a clustering key, you must re-cluster the table manually, and it is re-clustered at once and for free.Why is that wrong?

      Snowflake maintains the clustering automatically, only when the table will benefit, and that maintenance consumes credits.

      Covered in Diagnose before you tune: Query History, Query Profile and warehouse load

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “The Query Profile allows you to examine which parts of a query are taking the longest”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “It includes a Most Expensive Nodes pane that identifies the operator nodes that are taking the longest to execute.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “Use the Warehouse Activity chart to visualize the load of the warehouse, including whether queries were queued.”
      ↩︎ Checkpoint
    2. 2.
      “to identify potential performance bottlenecks and improvement opportunities”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “Remote Disk IO — time when the processing was blocked by remote disk access.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
    3. 3.
      “You can use the Query Profile to identify which operation nodes are causing data to spill to storage.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “By default, only the ACCOUNTADMIN role has the privileges needed to execute the queries.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “If the query requires even more memory, it spills onto remote cloud-provider storage, which results in even worse performance.”
      ↩︎ Memory spillage and scaling up
      “Using a larger warehouse (effectively increasing the available memory/local storage space for the operation)”
      ↩︎ Exam trap 1
      “Using a larger warehouse (effectively increasing the available memory/local storage space for the operation)”
      ↩︎ Prediction
      “Snowflake writes a small amount of data to remote storage for each eligible query”
      ↩︎ Checkpoint
    4. 4.
      “Default:600 (the warehouse suspends automatically after 10 minutes of inactivity)”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “The background process that suspends a warehouse runs approximately every 30 seconds”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “TRUE: The warehouse resumes when a new query is submitted.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
    5. 5.
      “If you wish to control costs and/or user access, leave auto-resume disabled and instead manually resume the warehouse only when needed.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
    6. 6.
      “offloading portions of the query processing work to shared compute resources that are provided by the service”
      ↩︎ Query acceleration service for outlier queries
      “The Query Acceleration Service is also enabled by default in Snowflake Gen2 standard warehouses and multi-cluster warehouses.”
      ↩︎ Query acceleration service for outlier queries
      “leasing these resources can cost up to an additional 20 credits per hour”
      ↩︎ Query acceleration service for outlier queries
      “These credits are billed separately from warehouse usage.”
      ↩︎ Query acceleration service for outlier queries
      “When Snowflake automatically enables QAS for Gen2 or multi-cluster warehouses at creation time, the default scale factor is 2.”
      ↩︎ Exam trap 2
    7. 7.
      “The auto-suspend setting of the warehouse can have a direct impact on query performance because the cache is dropped when the warehouse is suspended.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
    8. 8.
      “the compute resources used to perform clustering consume credits”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “Snowflake only performs automated maintenance if the table will benefit from the operation.”
      ↩︎ Diagnose before you tune: Query History, Query Profile and warehouse load
      “All future maintenance on the rows in the table (to ensure optimal clustering) is performed automatically by Snowflake.”
      ↩︎ Exam trap 3
    9. 9.
      “They can also be resized at any time, even while running”
      ↩︎ Memory spillage and scaling up
      “Snowflake utilizes per-second billing (with a 60-second minimum each time the warehouse starts)”
      ↩︎ Memory spillage and scaling up
      “Another way that you can scale the capacity of Snowflake warehouses without changing the warehouse size is by using multi-cluster warehouses.”
      ↩︎ Queuing and scaling out with multi-cluster warehouses
    10. 10.
      “the query must wait in a queue before starting”
      ↩︎ Queuing and scaling out with multi-cluster warehouses
      “Optimizing a warehouse for query performance is more straightforward when the warehouse runs similar workloads.”
      ↩︎ Key concept
    11. 11.
      “Warehouse query load measures the average number of queries that were running or queued within a specific interval.”
      ↩︎ Queuing and scaling out with multi-cluster warehouses
    12. 12.
    13. 13.
      “enough query load to keep the cluster busy for at least 6 minutes”
      ↩︎ Queuing and scaling out with multi-cluster warehouses
      “In Maximized mode, all clusters run concurrently, so there is no need to start or shut down individual clusters.”
      ↩︎ Queuing and scaling out with multi-cluster warehouses
      “The scaling policy for a multi-cluster warehouse only applies if it is running in Auto-scale mode.”
      ↩︎ Queuing and scaling out with multi-cluster warehouses
      “Prevents/minimizes queuing by favoring starting additional clusters over conserving credits.”
      ↩︎ Checkpoint
    14. 14.
      “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
      “Initial creation and resumption of a Snowpark-optimized virtual warehouse might take longer than standard warehouses.”
      ↩︎ 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.”
      ↩︎ Checkpoint

    Continue to page 2 of 2

    Snowflake Caching, Clustering and Search Optimization: When to Use Each and What They Cost

    Spotted a mistake, or was something unclear? Tell us.