Saving cash by using cache
With on-premises databases, inefficient operations resulted in longer execution times. In Snowflake’s variable spend model, that extra time is coupled with monetary penalties. Besides writing efficient SQL, Snowflake users should also understand the various caches associated with the service and virtual compute layers to understand where they can take advantage of pre-calculated results. A firm grasp of Snowflake caching will also inform decisions when modeling and building data pipelines.
Let us start with the services layer and familiarize ourselves with the caches it manages and offers its users.
Services layer
The services layer handles two types of cache: metadata and query results cache.
Metadata cache
The services layer manages object metadata, such as structure, row counts, and distinct values by column. Reviewing this metadata through related SQL functions or the Snowflake UI will not require a running warehouse and does not...