SpinTheMic
Pro

Snowflake · Beginner

What types of caching does Snowflake use?

By Anurag Pandey, Lead Data Engineer ·

The short answer

Snowflake has two caches you should know: the result cache, handled by the cloud services layer, which returns a stored result when a query repeats and the data hasn't changed; and the warehouse cache, table data a running warehouse keeps locally, which is dropped when it suspends.

Practice this out loud

Opens this question on SpinTheMic. Start without signing up; sign in free for an AI report card.

Say it like this

About 50 seconds out loud. Use it as a model, then put it in your own words.

There are two caches I'd talk about. The first is the result cache. When a query runs again, the data in the tables hasn't changed and the query is the same, Snowflake skips execution and returns the stored result. The cloud services layer handles this, not the warehouse. A result is kept for 24 hours, and every reuse resets that clock, up to 31 days from the first run. The second is the warehouse cache. A running warehouse keeps table data it has already read on local storage, so the next query that needs the same data reads it faster. That cache is dropped when the warehouse suspends. So auto-suspend is a trade-off: a short setting saves credits, but repeated queries lose the warm cache and get slower.

What interviewers look for

  • You name both caches and say which layer handles each one.
  • You know the result cache needs the same query and unchanged table data.
  • You link the warehouse cache to the auto-suspend trade-off.

Common mistakes

  • Saying the result cache lives on the warehouse. The cloud services layer handles it.
  • Forgetting that a change to the table's data makes the stored result unusable.
  • Saying a suspended warehouse keeps its cache. It is dropped.

Follow-up questions to expect

  1. 1How would you turn off the result cache when benchmarking a query?
  2. 2How does auto-suspend affect warehouse caching?
  3. 3Why might the same query not hit the result cache twice?
Practice this out loud

Opens this question on SpinTheMic. Start without signing up; sign in free for an AI report card.

Checked against

All interview question guides