I have read in a few places that there are 3 levels of caching in Snowflake:
Metadata cache. Maintained in the Global Service Layer. This includes metadata relating to micro-partitions such as the minimum and maximum values in a column, number of distinct values in a column. This enables queries such as
SELECT MIN(col) FROM table
to return without the need for a virtual warehouse, as the metadata is cached.Query Result Cache. This is also maintained by the global services layer, and holds the results set from queries for 24 hours (which is extended by 24 hours if the same query is run within this period).
Warehouse data cache. This is maintained by the query processing layer in locally attached storage (typically SSDs) and contains micro-partitions extracted from the storage layer.
https://www.linkedin.com/pulse/caching-snowflake-one-minute-arangaperumal-govindsamy/
Then I also read in the Snowflake documentation that these caches exist:
Result Cache: This holds the results of every query executed in the past 24 hours. These are available across virtual warehouses, so query results returned to one user is available to any other user on the system who executes the same query, provided the underlying data has not changed.
Local Disk Cache. This is used to cache data used by SQL queries. Whenever data is needed for a given query it's retrieved from the Remote Disk storage, and cached in SSD and memory.
Remote Disk Cache. This holds the long term storage. This level is responsible for data resilience, which in the case of Amazon Web Services, means 99.999999999% durability. Even in the event of an entire data centre failure.
https://community.snowflake.com/s/article/Caching-in-Snowflake-Data-Warehouse
What is the correspondence between these ? Both have the Query Result Cache, but why isn't the metadata cache mentioned in the snowflake docs ? And is the Remote Disk cache mentioned in the snowflake docs included in Warehouse Data Cache (I don't think it should be.
So are there really 4 types of cache in Snowflake?:
- Metadata Cache
- Query Result Cache
- Local Disk Cache
- Remote Disk Cache