Introduction to Teradata Volatile Tables and Snowflake Temporary Tables
Teradata and Snowflake offer temporary tables. This post will compare and contrast the types of tables available on each platform.
We will examine table types found only in Teradata and Snowflake and show their ideal use cases.
What is the equivalent of Teradata Volatile Tables in Snowflake?
Snowflake has the so-called Temporary Tables. These are roughly equivalent to the volatile tables in Teradata.
In both Teradata and Snowflake, the lifetime of these tables is the session. The tables are automatically dropped as soon as a session ends.
What are the differences between the Teradata Volatile Table and the Snowflake Temporary Table?
Snowflake temporary tables can shadow permanent tables in the same schema and support Time Travel subject to 0/1-day retention and session lifetime. They have no Fail-safe. Do not assume unavailable Time Travel or recovery after session end. Teradata same-name resolution should be checked with qualified names; that behavior was not tested here.
What is the syntax of Teradata Volatile Tables or Snowflake Temporary Tables?
Use ON COMMIT PRESERVE ROWS for temporary-table data that must survive a transaction commit. ON COMMIT DELETE ROWS deletes at the transaction boundary, not immediately after every insert in every mode. GTT definitions are persistent and data instances are per session; restart/recovery behavior was not tested here. The volatile-table syntax example is CREATE VOLATILE TABLE Customer (CustomerId INTEGER, OpenDate DATE) PRIMARY INDEX (CustomerId) ON COMMIT PRESERVE ROWS;
Which table type is only available in Teradata?
Use ON COMMIT PRESERVE ROWS for temporary-table data that must survive a transaction commit. ON COMMIT DELETE ROWS deletes at the transaction boundary, not immediately after every insert in every mode. GTT definitions are persistent and data instances are per session; restart/recovery behavior was not tested here. The volatile-table syntax example is CREATE VOLATILE TABLE Customer (CustomerId INTEGER, OpenDate DATE) PRIMARY INDEX (CustomerId) ON COMMIT PRESERVE ROWS;
Which table type is only available in Snowflake?
Snowflake transient tables have no Fail-safe; permanent tables can have Fail-safe after Time Travel. Transient Time Travel is configurable at 0 or 1 day. Storage history can remain after DROP, so costs do not necessarily stop at table deletion.
Deciding what to change in your data platform?
Compare optimisation, modernisation and migration against your workload and business requirements.
Get the complete Teradata tuning book, free
Teradata Query Performance Tuning: The DWHPro Guide
By Roland Wenzlofsky & Artemios Vogiatzis
206 pages on statistics and demographics, access paths and indexes, query execution plans, and joins. Get the full PDF and practical Teradata updates from DWHPro.
Confirm your email to receive your download link. Privacy policy. Unsubscribe in any newsletter.
About the free book