Professional Documents
Culture Documents
Database Design > Primary Indexes > Summary of Primary Index Selection Criteria
Guideline
Com m ents
Equality conditions permit the system to hash directly to the row having the conditional
value. When the primary index is unique, the response is never more than one row .
Inequality conditions require additional processing.
Distinct values distribute evenly across all AMPs in the configuration. This maximizes
parallel processing; how ever, temporal tables cannot have a unique primary index.
Row s having duplicate NUPI values hash to the same AMP and are stored in the same
data block w henever possible. This is good w hen row s are only moderately nonunique.
Row s having NUPI columns that are highly nonunique distribute unevenly, use multiple
data blocks, and incur multiple I/Os.
Extremely nonunique primary index values can skew space usage so markedly that the
system returns a message indicating that the database is full even w hen it is not.
This occurs w hen an AMP exceeds the maximum bytes threshold for a user or database
calculated by dividing the PERMANENT = n BYTES specification by the number of AMPs in
the configuration, causing the system to incorrectly perceive the database to be full.
If this guideline is not follow ed, row distribution skew s heavily, not only w asting disk
space, but also devastating system performance.
You cannot specify columns that have BLOB, CLOB, BLOBbased UDT, CLOBbased
UDT, Period, ARRAY, VARRAY, or Geospatial data types in a primary index definition. If
you attempt to do so, the CREATE request aborts.
When defining the primary index for a join index, you cannot specify any aggregated
columns.
You can, how ever, specify Period columns in the partitioning expression of a partitioned
table.
http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/Database_Management/B035_1094_111A/ch09.050.166.html
1/2
8/7/2014
http://www.info.teradata.com/HTMLPubs/DB_TTU_14_00/index.html#page/Database_Management/B035_1094_111A/ch09.050.166.html
2/2