QITS Column - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

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

The first column defined for any queue table must be a Queue Insertion Time Stamp (QITS) column. Each queue table has only one QITS column, and it must be defined exactly as indicated with the following attributes.

QITS_column_name TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)

where QITS_column_name indicates the name you specify for the QITS column.

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 is user-, not system-defined; however, the only significant option you have when defining the QITS column is its name.

A QITS column cannot be defined as any of the following:
  • UNIQUE
  • PRIMARY KEY
  • Unique secondary index
  • Identity column

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

You should select the primary index column set that best optimizes the performance of browse mode select operations on the table, just as you would for a non-queue table.

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