Vous êtes sur la page 1sur 4

Indexes in the Teradata Database

Indexes are used to access rows from a table without having to


search the whole table.
In the Teradata Database, an index is made up of one or more
columns in a table. Once Teradata Database indexes are selected,
they are maintained by the system.

In the Teradata Database, there are two types of indexes:
Primary Indexes define the way the data is distributed
Secondary Indexes are used to locate the data rows more efficiently
than scanning the whole table.
Column or columns are used as the Primary Index when we create a
table. Secondary Index columns can be specified when we create a table
or at any time during the life of the table.











Data Distribution
When data is loaded into the Teradata Database:
The system automatically distributes the data across the AMPs based on row
content (the Primary Index values).
The distribution is the same regardless of the data volume being loaded. In other
words, large tables are distributed the same way as small tables.
Teradata Database Manageability
A key benefit of the Teradata Database is its manageability.
Why the Teradata Database system is so easy to manage and maintain compared to
other databases?
With the Teradata Database, the workload for creating a table of 100 rows is the
same as creating a table with 1,000,000,000 rows.
Teradata Database Administrator know that if data doubles, the system can expand
easily to accommodate it.
Primary Index
A Primary Index (PI) is the physical mechanism for assigning a data row to an
AMP and a location on the AMPs disks. It is also used to access rows without
having to search the entire table. A Primary Index operation is always a one-AMP
operation. You specify the column(s) that comprise the Primary Index for a table
when the table is created. For a given row, the Primary Index value is the
combination of the data values in the Primary Index columns.
Choosing a Primary Index for a table is perhaps the most critical decision a
database designer makes, because this choice affects both data distribution and
access.


Primary Index Rules
The following rules govern how Primary Indexes in a Teradata Database must be
defined as well as how they function:
Rule 1: One Primary Index per table.
Rule 2: A Primary Index value can be unique or non-unique.
Rule 3: The Primary Index value can be NULL.
Rule 4: The Primary Index value can be modified.
Rule 5: The Primary Index of a populated table cannot be modified.
Rule 6: A Primary Index has a limit of 64 columns.

Vous aimerez peut-être aussi