17.10 - QITS_column_name - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
English (United States)

The Query Insertion Timestamp (QITS) column

The first column defined for any queue table must be a QITS column. Vantage uses the QITS column to maintain the FIFO ordering of rows in the queue table. Each queue table has only one QITS column, and it must be defined with the following attributes:

   column_name TIMESTAMP(6) [WITH TIME ZONE] NOT NULL
               DEFAULT CURRENT_TIMESTAMP(6)

The precision specification is optional for the TIMESTAMP data type specification and its DEFAULT attribute, but you cannot define either with a precision value other than 6.

The QITS column cannot be defined as any of the following:

  • UNIQUE PRIMARY INDEX
  • UNIQUE
  • PRIMARY KEY
  • Unique secondary index (see CREATE INDEX )
  • Identity column

The QITS column can be the NUPI for a table, but you should avoid following that practice. Be aware that if you do not define an explicit primary index, primary key, or uniquely constrained column in the table, then the QITS column becomes its primary index by default because it is the first column defined for the table.

You might find it useful to find additional queue management columns for functions such as message identification or queue sequencing.