Example: NoPI Table CREATE Request That Converts PRIMARY KEY or UNIQUE Constraints to USIs - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

If you create a NoPI table that also specifies a PRIMARY KEY, one or more UNIQUE constraints, or both, Vantage creates unique secondary indexes on the same column sets as the constraints.

Consider this CREATE TABLE request.

     CREATE TABLE nopi_constraints (
       column_1 INTEGER NOT NULL
       column_2 INTEGER NOT NULL 
     CONSTRAINT UNIQUE (column_1)
     CONSTRAINT PRIMARY KEY (column_2))
     NO PRIMARY INDEX;

For example, Vantage creates USIs for the two constraints because you have specified NO PRIMARY INDEX explicitly.

     CREATE TABLE nopi_constraints (
       column_1 INTEGER NOT NULL
       column_2 INTEGER NOT NULL)
     UNIQUE INDEX (column_1)
     UNIQUE INDEX (column_2)
     NO PRIMARY INDEX;