0% found this document useful (0 votes)
72 views

Caching in Snowflake

Caching provides temporary storage to access data faster. Snowflake uses two types of caches: 1. The query results cache stores query results in the cloud for up to 24 hours and is accessible across warehouses. Identical queries will retrieve cached results. 2. The local disk cache stores data fetched by queries in the warehouse's SSD and memory until the warehouse is suspended. It can retrieve subset data from queries even if the full data was previously cached. Caching improves query performance by retrieving data locally.

Uploaded by

mysites220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Caching in Snowflake

Caching provides temporary storage to access data faster. Snowflake uses two types of caches: 1. The query results cache stores query results in the cloud for up to 24 hours and is accessible across warehouses. Identical queries will retrieve cached results. 2. The local disk cache stores data fetched by queries in the warehouse's SSD and memory until the warehouse is suspended. It can retrieve subset data from queries even if the full data was previously cached. Caching improves query performance by retrieving data locally.

Uploaded by

mysites220
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Caching in Snowflake

by
Janardhan Bandi
Caching
• Cache is a temporary storage location that stores copies of files or
data, so that they can be accessed faster in near future.
• Cache plays vital role in saving costs and speeding up results.
• Improves query performance.
• 2 Types of caches in Snowflake
• Query Results Cache
• Local Disk Cache
Cloud Layer
Query ‘RESULTS’
(up to 24 hours)

VW Layer
‘DATA’
(until VW is UP and
running)
Results Cache
• Results Cache is located in cloud services layer. This Cached data will
be available for next 24 hours.
• Results Cache will be available and can be accessed across different
virtual warehouses.
• Query results returned to one user is available to any other user on
the system who executes the same query.
• Results cache works until underlying data has not changed.
• Here mandatory condition is query should be same, won’t work for
subset of data, and even won’t work if we re-order columns.
Local Disk Cache
• Local Disk Cache is located in the Virtual Warehouse (i.e. EC2/VM’s
RAM /SSD).
• Cache the Data(not the results) fetched 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.
• Cached data is only available until the VW is up, once VW is
suspended, cache gets deleted.
Local Disk Cache
• Even works when we query subset of data that is available in Local
disk cache.
Eg. Suppose when we query 10k records for the first time, Local
disk cache will hold this 10 k records data and next time if we try to
query only 2k or 3k records which is subset of above 10k, it will fetch
from Local disk cache itself.
• This Cache depends on the Virtual Warehouse Size we are using.
Eg. X-Small VW can’t hold Millions of records, but can fetch part of
the data from Local disk cache and remaining from Remote disk.
Thank you

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy