Skip to content

How Snowflake's layers of caching change what a query actually has to do

Snowflake uses multiple layers of caching to speed up query execution and reduce compute costs, primarily the result cache and the local disk (warehouse) cache. Understanding which cache serves a query and what invalidates it is essential for optimizing performance and controlling credit consumption.

1 · Learn the must-know

  • The result cache stores query results for 24 hours and is used when an identical SQL query (same text, same warehouse role/privileges) is re-run and the underlying data hasn't changed, bypassing compute entirely (no warehouse credits consumed).
  • Each re-use of a cached result extends its retention up to a maximum of 31 days from the first execution, after which it is purged.
  • The result cache is available globally across virtual warehouses and users (with proper access), since it's managed by the cloud services layer, not tied to a specific warehouse.
  • The local disk cache (warehouse cache/SSD cache) stores raw micro-partition data scanned during query execution on the compute nodes of a running warehouse, speeding up subsequent queries that access the same data.
  • The local disk cache is lost when a warehouse is suspended or resized, since it lives on the compute cluster's local SSD storage.
  • Functions that are non-deterministic (e.g., CURRENT_TIMESTAMP(), RANDOM()) or queries involving external functions/UDFs with side effects bypass the result cache and force re-execution.

2 · Check your understanding

Check this objectiveFree · always available

A Snowflake Practitioner runs SELECT * FROM ORDERS WHERE REGION = 'WEST' against a table that has not changed since the last load. Two minutes later, the same statement is issued again by the same session, but the warehouse used for the first run was suspended in between. The second execution completes in under a second and the query history shows zero warehouse activity for it. Which mechanism explains this behavior?

Your objective map0 tried · 0 answered correctly · 19 untouched

What you have tried across SnowPro Core's objectives, not a readiness score.

Snowflake AI Data Cloud Features and Architecture31% of the exam0 of 6 tried
Account Management and Data Governance20% of the exam0 of 3 tried
Data Loading, Unloading, and Connectivity18% of the exam0 of 3 tried
Performance Optimization, Querying, and Transformation21% of the exam0 of 4 tried
Data Collaboration10% of the exam0 of 3 tried

3 · Keep going