Performance work on Snowflake separates cleanly into diagnostics and remediation. The diagnostic surface tells you where time and bytes are spent; the remediation surface gives you knobs that change physical layout, query execution, or compute topology.
An Architect's job is to know which knob each feature turns, which workload shape the knob fits, and where the knob has documented limits that disqualify it from a candidate solution. This section walks the diagnostic surface and the four major speedup features in the order an Architect approaches them when a workload is failing its latency or credit budget.
The diagnostic surface is the entry point for every performance investigation, because remediation chosen without a diagnosis tends to add cost without removing the bottleneck. A common failure pattern is to enable Search Optimization Service on a table where Automatic Clustering would actually solve the problem, or to add a Materialized View to absorb a workload that already pruned well and was bottlenecked on spill instead.
Each speedup feature has a narrow sweet spot; outside that sweet spot it adds serverless cost without changing query duration.
Snowflake's compute boundary is the second key concept for this section. Warehouses are the user-facing compute pool; serverless features (Automatic Clustering, Search Optimization Service, Materialized View refresh, Snowpipe, Tasks running serverless, Query Acceleration Service) draw on Snowflake-managed compute and are billed per-second against a Snowflake-managed credit line distinct from warehouse credits.
Architects routinely have to defend why a serverless line item in ACCOUNT_USAGE is the right answer for a given workload, because finance teams see two credit columns and ask which is which. The capability tables and decision anchors below give the per-feature framing required for that defence.
A final point of orientation: the speedup features are not mutually exclusive. A heavy BI dashboard query can simultaneously benefit from a Materialized View (pre-aggregated answers), clustering on the join key of the underlying fact (better pruning during MV refresh), Query Acceleration Service (absorbing the spiky scan-heavy queries that fall through the cache), and a multi-cluster warehouse (concurrency for end users).
The Architect's task is to verify that each feature is actually contributing, not just enabled.
Role of the Query Profile in diagnosing performance issues
Query Profile is the operator-level execution graph Snowflake records for every query. It is the only surface that exposes per-operator time, partition statistics, spill bytes, and join-side cardinalities at the resolution an Architect needs to remediate. Reading it well is a precondition for every other tool in the chapter, because every speedup feature targets a specific operator-level pattern.
The Profile is reached through Snowsight (Activity > Query History > query-detail > Query Profile) and is also surfaced programmatically via GET_QUERY_OPERATOR_STATS(query_id). The programmatic surface is the right answer when you need to capture profiles for a continuous fleet of queries, because the Snowsight UI does not scale beyond manual inspection.
-- Programmatic capture of operator-level statistics
-- The function returns one row per operator with attribute key-value pairs.
SELECT
step_id,
operator_id,
parent_operator_id,
operator_type,
execution_time_breakdown,
operator_statistics,
operator_attributes
FROM TABLE(GET_QUERY_OPERATOR_STATS('01ab2c3d-0000-0001-0000-000000000001'))
ORDER BY step_id, operator_id;
The four statistics that drive almost every remediation decision are pruning ratio, bytes scanned, spill bytes (local and remote), and per-partition execution skew. Pruning ratio appears in the TableScan operator as "Partitions scanned" over "Partitions total"; spill bytes appear at the operator level as "Bytes spilled to local storage" and "Bytes spilled to remote storage"; skew appears in the per-partition execution-time histogram visible on each parallelizable operator.
-- Bulk health check across a workload using ACCOUNT_USAGE
SELECT
query_id,
warehouse_size,
partitions_scanned,
partitions_total,
ROUND(partitions_scanned / NULLIF(partitions_total, 0) * 100, 1) AS pct_scanned,
bytes_spilled_to_local_storage,
bytes_spilled_to_remote_storage,
bytes_scanned,
execution_time / 1000 AS execution_seconds
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE start_time >= DATEADD(hour, -24, CURRENT_TIMESTAMP())
AND warehouse_name = 'BI_WH'
AND execution_time > 30000
ORDER BY execution_time DESC
LIMIT 50;
💡 Exam Trap: ACCOUNT_USAGE.QUERY_HISTORY lags the live system by up to 45 minutes and retains 365 days of rows; INFORMATION_SCHEMA.QUERY_HISTORY is real-time but only retains seven days. An Architect designing an alerting pipeline must pick INFORMATION_SCHEMA for live operations and ACCOUNT_USAGE for trend analysis; the exam regularly swaps these in distractors.
📊 Limit:
GET_QUERY_OPERATOR_STATSrequires the query to have completed within the last 14 days. Profiles for older queries are no longer retrievable through this function, even though QUERY_HISTORY still shows the metadata.
⚠️ Anti-Pattern: Diagnosing performance from raw query duration alone. A query that runs four times faster on a larger warehouse may still have a 1% pruning ratio, meaning the real win was hidden by brute-force compute and the workload will regress the moment data volumes climb.
How the Result Cache, Metadata Cache, and Data Cache operate
Snowflake caches at three layers, each with a distinct lifecycle, scope, and invalidation rule. The Architect-tier question is rarely "is X cached" but "which cache returned this row and what invalidates it."
How it works
- The Result Cache is account-scoped and lives in the cloud services layer.
- A query hit returns the previously computed result without consuming warehouse credits at all, and the user warehouse can even be suspended at the moment of the hit.
- A hit requires that the query text is byte-identical (after stripping comments and applying session normalisation), the calling role has the same effective privileges, the underlying micro-partitions are unchanged, and no non-deterministic functions appeared in the query.
- The idle lifetime is 24 hours, extended to a maximum of 31 days by repeated hits.
The Metadata Cache also lives in the cloud services layer and stores per-micro-partition column statistics (min, max, distinct count estimate, null count) that drive partition pruning. Queries answered entirely from metadata, such as SELECT COUNT(*) FROM t, SELECT MAX(col) FROM t, or SELECT MIN(col), MAX(col) FROM t, never touch the storage layer at all and return in milliseconds regardless of warehouse state. This is why the answer to "how do I make COUNT(*) faster on a 100 TB table" is not "make the warehouse bigger" but "the warehouse size does not matter."
The Data Cache (the warehouse-local SSD cache) holds raw micro-partition data on the local SSD of each warehouse node. It is warehouse-scoped, which means resuming a suspended warehouse may or may not preserve the cache: a short suspend often restores the same nodes; a long suspend, an ALTER WAREHOUSE ... RESIZE, or a multi-cluster scale-out may replace the underlying nodes and discard the cache. Architects intentionally tune AUTO_SUSPEND to balance idle cost against cache warmth.
-- Force a Result Cache miss while preserving the Data Cache
ALTER SESSION SET USE_CACHED_RESULT = FALSE;
-- A benchmark query: run twice, compare durations.
-- First run: cold Data Cache, full remote read.
-- Second run: warm Data Cache, identical query, local SSD read.
SELECT region, SUM(total_revenue)
FROM sales.core.fact_orders
WHERE order_date BETWEEN '2099-01-01' AND '2099-03-31'
GROUP BY region;
ALTER SESSION UNSET USE_CACHED_RESULT;
-- Inspect cache contribution in Query Profile statistics
SELECT
query_id,
percentage_scanned_from_cache,
bytes_scanned,
ROUND(bytes_scanned * percentage_scanned_from_cache / 100, 0) AS cached_bytes
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE query_id = '01ab2c3d-0000-0001-0000-000000000001';
💡 Exam Trap: The Result Cache is invalidated by any DML on the underlying tables, not just by changes to the rows returned. Loading a single row into a partition not touched by the query still flips a hash and breaks the cache hit. This is why Result Cache strategies for high-volume BI usually pair with Materialized Views, which absorb the same workload without that fragility.
📊 Limit: Result Cache idle lifetime is 24 hours from the most recent hit; the cumulative ceiling is 31 days. After 31 days a result is purged regardless of hit frequency.
When to use Search Optimization Service, Automatic Clustering, and Materialized Views
These three are the most frequently confused features on the Architect exam. They target three different query shapes and three different cost profiles.
Key points
- Automatic Clustering maintains a clustering depth on a column or expression you specify with
CLUSTER BY. - It reorganises micro-partitions in the background so that the min/max bounds of each partition stay tight along the cluster key.
- The serverless service is billed per second of background reclustering work.
- The right fit is a large table (typically multi-terabyte) where queries filter on a low-to-medium-cardinality column that does not coincide with natural ingestion order.
- The classic case is a fact table where ingestion is order-of-arrival but queries always filter on a business date.
- Search Optimization Service (SOS) maintains a separate indexed structure (a column-level access path index) that is consulted at query planning time for equality, IN-list, and substring predicates on high-cardinality columns.
- The serverless service is billed for the initial build and for incremental maintenance as new partitions arrive.
- The right fit is point-lookup access patterns: needle-in-haystack queries on identifiers, GUIDs, or VARIANT keys where pruning alone leaves too many partitions in scope.
- Materialized Views pre-compute the result of a single-source SELECT and refresh incrementally as the source changes.
- The serverless service is billed for the refresh work.
- The right fit is a query pattern that is read many times against a slow-changing aggregate of a single base table, typically a BI dashboard tile or a frequently filtered roll-up.
-- Automatic Clustering on a fact table
ALTER TABLE sales.core.fact_orders
CLUSTER BY (order_date, region_code);
-- Inspect clustering health
SELECT SYSTEM$CLUSTERING_INFORMATION(
'sales.core.fact_orders',
'(order_date, region_code)'
);
-- Search Optimization Service: enable on a wide table, restrict to columns that actually receive point lookups
ALTER TABLE customer.core.customer_events
ADD SEARCH OPTIMIZATION
ON EQUALITY(customer_id, session_id)
, SUBSTRING(user_agent);
-- Inspect maintenance cost
SELECT *
FROM SNOWFLAKE.ACCOUNT_USAGE.SEARCH_OPTIMIZATION_HISTORY
WHERE start_time >= DATEADD(day, -7, CURRENT_TIMESTAMP())
ORDER BY start_time DESC;
-- Materialized View for a high-frequency BI roll-up
CREATE MATERIALIZED VIEW analytics.bi.mv_daily_region_revenue AS
SELECT
order_date,
region_code,
COUNT(*) AS order_count,
SUM(total_revenue) AS revenue,
SUM(total_tax) AS tax
FROM sales.core.fact_orders
GROUP BY order_date, region_code;
Decision Anchor. Choose Automatic Clustering when filter predicates use range or low-to-medium-cardinality equality on a column the ingestion order does not preserve. Choose Search Optimization Service when filter predicates are equality, IN-list, or substring on a high-cardinality column and pruning alone leaves the workload doing too many partition reads.
Choose a Materialized View when a repeating aggregation is read far more often than the base table is updated and the aggregation is on a single base table.
💡 Exam Trap: Materialized Views in Snowflake support a restricted SQL surface. No joins, no
HAVING, noUNION, no window functions, noLIMIT, and a single base table only. The exam tests this constantly: an apparent MV solution to a multi-table aggregation is wrong unless the schema is denormalised first or a Dynamic Table is used instead.
⚠️ Anti-Pattern: Adding Search Optimization Service to a table that is already well clustered on the same column. SOS does not improve range queries that already prune well; the serverless bill arrives without a latency benefit. Run a
SYSTEM$CLUSTERING_INFORMATIONcheck first and compare pruning ratios on the actual workload.
🎯 Scenario: A finance team complains that the daily executive dashboard takes 90 seconds when it used to take 4. Query Profile shows a 92% pruning ratio on the fact table but the dashboard issues 18 near-identical aggregation queries over the same one-month window every refresh cycle. A Materialized View on the (order_date, region_code) aggregate cuts the workload to metadata reads on the MV, and the dashboard returns in under 5 seconds. SOS would be the wrong answer because the query is not a point lookup; reclustering would be the wrong answer because pruning is already healthy.
How Query Acceleration Service works and when to enable it
Query Acceleration Service (QAS) is a per-warehouse serverless side-pool that absorbs the scan-heavy portion of individual queries on demand.
It is enabled at the warehouse level and capped by QUERY_ACCELERATION_MAX_SCALE_FACTOR, which is the multiple of the warehouse's base compute that QAS may consume on a single eligible query.
The service is billed per second of acceleration credits used.
Comparison
QAS is fundamentally different from scaling up or scaling out the warehouse.
- Scaling up applies to every query the warehouse runs.
- Scaling out adds clusters for concurrent queries.
QAS targets individual queries with an unusually large scan and bursts compute only for the duration of that query's scan phase.
The eligibility heuristic is internal to Snowflake but documented to favour queries where the scan and filter dominate the operator cost.
-- Enable QAS on an existing warehouse with a scale-factor ceiling of 8
ALTER WAREHOUSE bi_wh SET
QUERY_ACCELERATION_MAX_SCALE_FACTOR = 8;
-- Check whether QAS is enabled and at what scale factor
SHOW WAREHOUSES LIKE 'BI_WH';
-- Eligible-query history
SELECT
query_id,
eligible_query_acceleration_time,
upper_limit_scale_factor
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_ACCELERATION_ELIGIBLE
WHERE start_time >= DATEADD(day, -7, CURRENT_TIMESTAMP())
ORDER BY eligible_query_acceleration_time DESC
LIMIT 25;
📊 Limit:
QUERY_ACCELERATION_MAX_SCALE_FACTORaccepts an integer from 0 to 100. A value of 0 disables QAS for that warehouse; a value of 1 caps acceleration at one warehouse-size worth of additional compute.
💡 Exam Trap: Queries that are bottlenecked on join build-side broadcasts, on sort, or on operator skew do not benefit from QAS. QAS targets scan-heavy operators only. The exam tests this with scenarios where a candidate is tempted to "fix concurrency" by enabling QAS instead of reaching for multi-cluster warehouses.
Multi-cluster warehouses and scaling policies (STANDARD, ECONOMY)
A multi-cluster warehouse runs between MIN_CLUSTER_COUNT and MAX_CLUSTER_COUNT independent clusters under a single warehouse name.
New queries are routed to existing clusters until concurrency limits push the warehouse to spin up additional clusters. Multi-cluster scales concurrency, never single-query latency.
The scaling policy controls how aggressively new clusters start and how patiently old clusters stop.
STANDARDis the default and is concurrency-first: a new cluster starts when the next query would queue, and an idle cluster shuts down after a short backoff.ECONOMYis credit-first: a new cluster starts only when the queue depth justifies the credit spend, and idle clusters wait roughly 6 minutes of inactivity before shutting down.
ECONOMY trades higher first-query queueing for lower credit consumption per workload.
-- Create a multi-cluster warehouse with the STANDARD policy
CREATE WAREHOUSE bi_wh WITH
WAREHOUSE_SIZE = 'MEDIUM'
MIN_CLUSTER_COUNT = 1
MAX_CLUSTER_COUNT = 6
SCALING_POLICY = 'STANDARD'
AUTO_SUSPEND = 60
AUTO_RESUME = TRUE;
-- Switch a steady ETL warehouse to ECONOMY where slight queueing is acceptable
ALTER WAREHOUSE etl_wh SET SCALING_POLICY = 'ECONOMY';
| Policy | Cluster start trigger | Cluster stop behaviour | Best fit |
|---|---|---|---|
| STANDARD | Next query would queue | Idle cluster stops on a short backoff | Interactive BI, dashboards, ad-hoc analyst workloads |
| ECONOMY | Sustained queue depth justifies the additional cluster | Idle cluster waits roughly 6 minutes before shutdown | Batch ETL, ELT, scheduled workloads where short queueing is tolerable |
💡 Exam Trap: ECONOMY scaling does not cap concurrency at a lower number; it changes the threshold at which an additional cluster is spun up. Both policies still honour
MAX_CLUSTER_COUNT. The exam frequently presents ECONOMY as "fewer clusters" when the correct framing is "fewer cluster starts and longer cluster lifetimes."
⚠️ Anti-Pattern: Using
MIN_CLUSTER_COUNT = MAX_CLUSTER_COUNTto force a fixed cluster count without a use case. This pattern (called "maximised" mode) is appropriate for predictable steady-state concurrency, but it disables the cost win of auto-scaling. Pick maximised only when you can justify the always-on credit profile.
Performance feature decision flow
The diagram below collapses the four speedup features and Query Acceleration Service into a single decision path an Architect can apply during design review.
