Study FAQ
What is the difference between Snowflake persisted query results and the warehouse cache?
Also asked as 2
- Which Snowflake cache survives warehouse suspension?
- Why can a Snowflake query return immediately after its warehouse was suspended?
Answer
Persisted query results can return a previously computed answer without running the query again, even after the original warehouse suspends. A running warehouse’s local disk cache holds data previously read during execution, so another query can still run and read some data locally. Suspending the warehouse clears that local cache. Micro-partition metadata remains available to support pruning.
Persisted results typically expire after 24 hours. Eligible reuse resets that window up to 31 days from the first execution. Reuse requires conditions such as an exact matching query, unchanged contributing table data and micro-partitions, and the necessary privileges. Non-reusable functions and different result-affecting settings can prevent reuse. Eligibility does not guarantee that Snowflake will reuse a result.
For a tuning comparison, use ALTER SESSION SET USE_CACHED_RESULT = FALSE in the test session when the query must execute. Control the warehouse’s local cache state separately so the runs have comparable scan conditions.
Using persisted query results · Snowflake warehouse cache · Micro-partition metadata
Full explanation
Virtual Warehouses: Sizing, Scaling, Concurrency, and Cost
Study guide · COF-C03
Read the full explanation