Primary Index Assignment - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

Most database tables require a primary index. (Some tables in the Data Dictionary do not have primary indexes and a global temporary trace table is not allowed to have a primary index.) To create a primary index, use the CREATE TABLE statement.

If you do not assign a primary index explicitly when you create a table, the database assigns a primary index, based on the following rules.

Primary Index Primary Key Unique Column Constraint Result
No Yes No Primary key column is a UPI.
No No Yes First column or columns having a UNIQUE constraint are a UPI.
No Yes Yes Primary key column is a UPI.
No No No First column of table is a NUPI.

If data type of first column is a LOB, CREATE TABLE operation ends and system returns an error message.

The best practice is to specify a primary index instead of having the database select a default primary index.