Primary Index Defaults - Advanced SQL Engine - Teradata Database

Database Design

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

You should always explicitly specify a primary index, a primary AMP index, or explicitly specify no primary index for your tables. If you don’t, a default is used which might not be appropriate for the object.

Teradata Database never creates a partitioned PI or NoPI by default and never creates a PA by default

Use the PrimaryIndexDefault field in DBS Control to determine whether Teradata Database automatically creates a table with a PI or NoPI if the table is created without the PRIMARY INDEX, PRIMARY AMP INDEX, and NO PRIMARY INDEX clause. For more information on the PrimaryIndexDefault field, see Teradata Vantage™ - Database Utilities , B035-1102 .

Problematic Selection of a Primary [AMP] Index Column Set

When the selection of a PI or PA column set is problematic, consider either of the following possible solutions.
  • Specify NO PRIMARY INDEX when you create the table.

    You can load rows into a NoPI table while you continue to determine an appropriate PI or PA. Such a table is sometimes referred to as a sandbox or staging table.

  • Use an identity column as the PI for the table (see Surrogate Keys).