2025 Tables and Views Flashcards
What are the four types of tables in Snowflake
Permanent
Transient
Temporary
External
How long is the Fail Safe period
7 days immediately after the Time Travel retention period.
What is the max number of days Time Travel can be set for
90 days
In the Snowflake standard addition, what is the Time Travel period allowed to be set for?
0 - 1 day
What is the minimum edition to set Time Travel to more than 1 day?
Enterprise
What is the parameter to set Time Travel?
DATA_RETENTION_TIME_IN_DAYS
What is the difference between a Transient Table and a Permanent Table
Transient Tables have no Fail-Safe and limit time travel, max 1 day which is the default
Can a transient table be converted to another type of table after being created
No
When would you use a Transient Table
- When you have a lot of data but protection is not a concern.
- When data can be recovered from external means if required.
- Can be used to store data that should be maintained between sessions, but can be recovered in case of a system failure
What is the difference between Temporary Tables and other tables
These tables are only for the duration of the session and are only visible to the user. Once the session completes, the table is purce and nonrecoverable.
How long is the Time Travel retention period on a Temporary Table?
1 day or the reminder of the session, whichever is smaller
Once created, can a temporary table be changed?
No
For an External Table, what is stored in Snowflake?
The metadata, like the name of the file, the row number of each record, etc
Can you perform DML operations on an External Table?
No
What can be done to improve performance when querying an external table?
You can build a Materialized View on top of the table
What columns are included in external tables?
VALUE: the VARIANT field representing a single record in the file
METADATA$FILENAME: name and path of each staged file
METADATA$FILE_ROW_NUMBER: the row number of each staged file record
What does the command ALTER EXTERNAL TABLE … REFRESH do?
Once completed, the following activities are supported:
* Adds new files to table metadata
* Updates file changes in table metadata
* Removes files no longer available from table metadata
What is an option for triggering automatic refreshes of an External Table’s metadata?
Event Notification for Cloud Storage.
There is a charge of .06 per 1,000 event notifications
Can the types permanent/transient/temporary be applied to other database objects?
Yes, like Schemas and Databases. Everything created in those objects will inherit the type.
What happens when a temporary table and a non-temporary table have the same name?
Both are available but the temporary one takes precedence.
Is CREATE TABLE required to create Temporary Tables
No
What is the minimum edition required for 0-1 days of time travel on Temporary or Transient Tables
Enterprise
What is MAX_DATA_EXTENSION_TIME_IN_DAYS
Max number of days Snowflake can extended the data retention period for tables to prevent streams on the tables from becoming stale.
What is the default for MAX_DATA_EXTENSION_TIME_IN_DAYS
14 days, can be set 0 to 90