Example: NoPI Table CREATE Request that Converts PRIMARY KEY or UNIQUE Constraints to USIs - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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;