Specifying the Primary Index for a Hash Index - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

A hash index must have a primary index. Unlike other base tables, you do not use the keywords PRIMARY INDEX to specify the primary index for a hash index.

The following table explains how the primary index for a hash index is defined:

Hash Index Primary Index for the Hash Index Uses this Column Set
Does not define a BY clause Primary index of the base table to which the hash index refers.
Specifies a BY clause and an ORDER BY clause Column set specified in the column_name_2 set in the BY clause.

These columns must also be defined in the column_name_1 set.

Rows in a hash index defined with this type of primary index are ordered either by row hash or by numeric value, depending on what you specify in the ORDER BY clause.