index - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

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

Keyword that defines a nonunique secondary index (NUSI) for the table.

You can define a secondary index on a column that has a UDT data type.

You can define a nonunique secondary index on a column that has a Geospatial data type.

If you specify INDEX without the preceding keyword UNIQUE, the index is a nonunique secondary index (NUSI).

The INDEX list is an extension to ANSI SQL.

Unlike the indexes created by the UNIQUE and PRIMARY KEY constraint definitions, indexes defined by the index list can have nullable columns.

You cannot define a secondary index on a column defined with any of the following data types:
  • BLOB
  • CLOB
  • LOB UDT
  • VARIANT_TYPE
  • ARRAY
  • VARRAY
  • Period
  • XML
  • JSON
  • DATASET
index_name
Optional name for the index.
For information about naming database objects, see Teradata Vantage™ - SQL Fundamentals, B035-1141.
ALL
Ignore the assigned case specificity for a column. This property enables a NUSI defined with the ALL option to do the following:
  • Include case-specific values.
  • Cover a table or join index on a NOT CASESPECIFIC column set.
ALL enables a NUSI to cover a query, enhancing performance by eliminating the need to access the base table itself when all columns needed by a query are contained in the NUSI.
Be aware that specifying the ALL option might also require additional index storage space.
You cannot specify multiple NUSIs that differ only by the presence or absence of the ALL option.
You cannot specify the ALL option for primary or unique secondary indexes.
index_column_name
Column set whose values are to be used as the basis for a secondary index.
Columns in the list cannot have any of the following data types: BLOB, CLOB, Period, XML, Geospatial, JSON, or DATASET.
If you specify more than one column name, the index is created on the combined values of each column named. A maximum of 64 columns can be specified for an index, and a maximum of 32 secondary indexes can be created for one table.