Snowflake automatically manages 3 caches to optimize query performance: the Result Cache (Cloud Services layer), the Metadata Cache (Cloud Services layer), and the Warehouse Cache (SSD on the compute layer). Understanding exactly which layer each cache runs in and what invalidates it matters both for performance tuning and for the SnowPro exams.
| Attribute | Result Cache | Metadata Cache | Warehouse Cache |
|---|---|---|---|
| Also known as | Query Result Cache | Cloud Services Cache | Local Disk Cache / SSD Cache |
| Layer | Cloud Services layer | Cloud Services layer | Compute layer (SSD inside the warehouse) |
| What is cached | Final query result set | Table metadata (row count, MIN/MAX, etc.) | Raw micro-partition data |
| Retention | 24 hours (extended on reuse) | Persistent (until data changes) | Only while the warehouse is running |
| Warehouse required? | No (served without a warehouse) | No (served without a warehouse) | Yes (SSD on the warehouse) |
| Credit consumption | None (within the Cloud Services allowance) | None (within the Cloud Services allowance) | Consumes warehouse credits |
| Invalidation | Table changed / 24 hours elapsed / SQL differs | DDL or DML changes to the table | Warehouse suspension |
The Result Cache stores the result set of any identical SQL query executed within the past 24 hours, and instantly returns it on a re-run without going through a warehouse.
Query execution flow (with Result Cache):
[SQL: SELECT region, SUM(amount) FROM sales GROUP BY region]
|
v
[Cloud Services layer]
|
+- Hit in Result Cache?
| |
| +- YES -> Return from cache instantly (no warehouse, no credits)
| |
| +- NO -> Execute on the warehouse
| |
| +- Return result + store in Result Cache (24 hours)
v
[Query result]| Invalidation trigger | Detail |
|---|---|
| Table data changes | When INSERT/UPDATE/DELETE/MERGE changes data in the target table |
| 24 hours elapsed | 24 hours since the last execution (each reuse extends the window by 24 hours) |
| SQL text differs | Even a one-character difference in whitespace, comments, or case |
| USE_CACHED_RESULT = FALSE | Explicitly disabled via the session parameter |
| Non-deterministic functions | Queries containing CURRENT_TIMESTAMP(), RANDOM(), UUID_STRING(), etc. |
| External functions | Queries that call an External Function |
-- Disable the Result Cache and run the query
ALTER SESSION SET USE_CACHED_RESULT = FALSE;
SELECT region, SUM(amount) FROM sales GROUP BY region;
-- -> Always re-executed on the warehouse
-- Re-enable the Result Cache
ALTER SESSION SET USE_CACHED_RESULT = TRUE;The Metadata Cache stores table metadata (row count, byte size, MIN/MAX values per micro-partition, etc.) in the Cloud Services layer. Queries that can be answered from metadata alone return results without using a warehouse.
-- Queries answered instantly from the Metadata Cache
SELECT COUNT(*) FROM large_table; -- row count is in metadata
SELECT MIN(id) FROM large_table; -- MIN/MAX are in partition metadata
SELECT MAX(created_at) FROM large_table;
-- These queries run even when the warehouse is SUSPENDED
-- Query Profile shows "METADATA-BASED RESULT"The Warehouse Cache caches raw micro-partition data on the SSDs of the warehouse's compute nodes. This reduces I/O to remote storage (S3 / Azure Blob / GCS) and shortens query execution time.
Query execution flow (with Warehouse Cache):
[SQL: SELECT * FROM sales WHERE region = 'APAC']
|
v
[Warehouse compute node]
|
+- Are the required micro-partitions already on SSD?
| |
| +- YES -> Read locally from SSD (fast)
| |
| +- NO -> Read from remote storage (S3, etc.)
| |
| +- Cache the loaded data on SSD
v
[Query result]| Behavior | Description |
|---|---|
| Cache persistence | Cache is retained while the warehouse is RUNNING |
| On suspend | Suspending the warehouse clears the cache |
| On resize | Scaling up adds nodes with empty caches; existing nodes keep their cache |
| LRU eviction | Once SSD capacity is reached, the least recently accessed data is evicted to make room |
| Multi-cluster | Each cluster has its own independent cache |
Cache evaluation priority:
[Incoming SQL query]
|
v
[1] Check the Metadata Cache
| Can metadata alone answer this? (COUNT(*), MIN, MAX, etc.)
| +- YES -> Return instantly (no warehouse)
| +- NO -> Continue
v
[2] Check the Result Cache
| Same SQL + same role + within 24 hours + data unchanged?
| +- YES -> Return cached result (no warehouse)
| +- NO -> Continue
v
[3] Execute on the warehouse (leveraging the Warehouse Cache)
| If the needed micro-partitions are on SSD, read them locally (fast)
| Otherwise read from remote storage and cache to SSD
v
[Return result + store in Result Cache]A warehouse's AUTO_SUSPEND setting has a major impact on how effective the Warehouse Cache is.
-- Cache-related signals in Query Profile
Result Cache hit:
-> Query Profile shows "QUERY RESULT REUSE"
-> No warehouse processing nodes are shown
Metadata Cache hit:
-> Query Profile shows "METADATA-BASED RESULT"
Warehouse Cache in use:
-> Check the Statistics tab for:
- Percentage Scanned from Cache: share of reads from SSD cache
- Bytes Scanned from Cache: bytes read from cache
-- Comparing Warehouse Cache effectiveness
-- 1st run: read from remote storage (Percentage Scanned from Cache = 0%)
-- 2nd run: read from SSD cache (Percentage Scanned from Cache ~ 100%)Cache
問題 1
A user ran the same SELECT statement 5 minutes ago using ROLE_A and is now re-running it under ROLE_B. The target table's data has not changed. What is the correct Result Cache behavior?
正解: B
The Result Cache is keyed by the executing role. Even with identical SQL, running under a different role does not hit the cache and the query re-runs on the warehouse. This is because Row Access Policies and Masking Policies can produce different results per role.
Does returning a query result from the Result Cache consume warehouse credits?
No. The Result Cache (Query Result Cache) is managed in the Cloud Services layer and returns results without going through a warehouse, so no warehouse credits are consumed. However, Cloud Services usage that exceeds 10% of warehouse credit consumption is billable, so it is not entirely free.
When does the Result Cache become invalidated?
The Result Cache is invalidated in the following situations: (1) target table data is changed (INSERT/UPDATE/DELETE/MERGE), (2) 24 hours have elapsed, (3) the SQL text differs by even a single character, or (4) the user sets USE_CACHED_RESULT = FALSE. Queries that include random functions (e.g. RANDOM()) or non-deterministic functions (e.g. CURRENT_TIMESTAMP()) are also excluded from the Result Cache.
What is the difference between the Warehouse Cache and the Result Cache?
The Result Cache stores the final result set of a query in the Cloud Services layer for 24 hours and returns it instantly when the same SQL is re-run. The Warehouse Cache (Local Disk Cache) caches raw micro-partition data on the warehouse's SSD, reducing I/O to remote storage when different queries access the same table data. The Warehouse Cache is only active while the warehouse is running and is cleared when it is suspended.
Practice with certification-focused question sets
無料で問題を解いてみるNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Snowflake Certifications: All 11 Exams Explained (2026)
Every SnowPro certification — Associate, Core, Specialty, Ad...
Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)
All 11 SnowPro exams ranked by difficulty with study-time es...
Snowflake Study Guide: Fastest Pass Route by Exam (2026)
How to pass SnowPro certifications efficiently — official ma...
SnowPro Core (COF-C03): Complete Exam Guide (2026)
Pass the SnowPro Core exam — six domains, scope, sample ques...
SnowPro Associate Platform (SOL-C01): Complete Guide (2026)
The entry-level SnowPro Associate exam — scope, weighting, s...