page122
105
With your session variables declared, you now declare your environment.
USE ROLE IDENTIFIER ( $tpc_owner_role );
USE DATABASE IDENTIFIER ( $tpc_database );
USE SCHEMA IDENTIFIER ( $tpc_owner_schema );
USE WAREHOUSE IDENTIFIER ( $tpc_warehouse_xs );
Session variables may appear cumbersome, but they provide a level of abstraction,
and I encourage their use.
Foundational Information
In this section, I describe the basic concepts relating to storage and micro-partitions to
establish some baseline information that this chapter later relies upon. I do not deep
dive into foundational information but instead provide a brief summary and links to
both documentation and other articles for your further investigation. I assume you have
some familiarity with the basic principles of persisting data and later will develop an
understanding of storage-related costs.
Centralized Storage
Regardless of whether Snowflake is deployed on AWS, Azure, or GCP, every time you
create a persistent Snowflake database object such as a table, storage is automatically
allocated from within the associated Snowflake VPC storage.
For reference I list the storage services provided by each cloud service provider
(CSP) here:
•
AWS: AWS Amazon Simple Storage Service (Amazon S3)
•
Azure: Blob Storage
•
GCP: Google Cloud Storage
S3-compatible storage is discussed later in the book.
You can find more information on the data life cycle at
https://docs.snowflake.
com/en/user-guide/data-lifecycle
.
ChaPTer 4
MiCro-ParTiTionS