Tables - Advanced SQL Engine - Teradata Database

Database Introduction

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qia1556235689628.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata Vantage™

Tables are two-dimensional objects consisting of rows and columns. Data is organized in table format and presented to the users of a relational database. The following table describes basic table types:

Table Type Description
ANSI Temporal ANSI-compliant support for temporal tables. Using temporal tables, Teradata Database can process statements and queries that include time-based reasoning. Temporal tables record both system time (the time period when the information was recorded in the database) and valid time (the time period when the information is in effect or true in a real-world application).
Derived A derived table:
  • Is a type of temporary table obtained from one or more other tables as the result of a subquery.
  • Is specified in an SQL SELECT statement.
  • Avoids the need to use the CREATE and DROP TABLE statements for storing retrieved information.
  • Is useful when you are coding more sophisticated, complex queries.
Error Logging Error logging tables:
  • Store information about errors on an associated permanent table.
  • Log information about insert and update errors.
Global Temporary Global temporary tables:
  • Are private to the session.
  • Are dropped automatically at the end of a session.
  • Have a persistent table definition stored in the Data Dictionary. The saved definition may be shared by multiple users and sessions with each session getting its own instance of the table.
Global Temporary Trace Global temporary trace tables:
  • Store trace output for the length of the session.
  • Have a persistent table definition stored in the Data Dictionary.
  • Are useful for debugging SQL stored procedures (via a call to an external stored procedure written to the trace output) and external routines (UDFs, UDMs, and external stored procedures).
NoPI NoPI tables are permanent tables that do not have primary indexes defined on them.

They provide a performance advantage when used as staging tables to load data from FastLoad or TPump Array INSERT.

They can have secondary indexes defined on them to avoid full-table scans during row access.

Permanent Permanent tables allow different sessions and users to share table content.
Queue Queue tables:
  • Are permanent tables with a timestamp column. The timestamp indicates when each row was inserted into the table.
  • Establish first-in first-out (FIFO) ordering of table contents, which is needed for customer applications requiring event processing.
Volatile Volatile tables are used when:
  • Only one session needs the table.
  • Only the creator needs to access the table.
  • You want better performance than a global temporary table.
  • You do not need the table definition after the session ends.
The definition of a volatile table can survive across a system restart if it is contained in a macro.

For more information about table types, see Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144 and Teradata Vantage™ - Database Design, B035-1094.