0 votes
in Snowflake by
Explain Snowflake caching and write its type.

1 Answer

0 votes
by

Consider an example where a query takes 15 minutes to run or execute. Now, if you were to repeat the same query with the same frequently used data, later on, you would be doing the same work and wasting resources.

Alternatively, Snowflake caches (stores) the results of each query you run, so whenever a new query is submitted, it checks if a matching query already exists, and if it did, it uses the cached results rather than running the new query again. Due to Snowflake's ability to fetch the results directly from the cache, query times are greatly reduced. 

Types of Caching in Snowflake 

  1. Query Results Caching: It stores the results of all queries executed in the past 24 hours.
  2. Local Disk Caching: It is used to store data used or required for performing SQL queries.  It is often referred to as
  3. Remote Disk Cache: It holds results for long-term use.

The following diagram visualizes the levels at which Snowflake caches data and results for subsequent use. 

...