Can you explain the difference between Primary Key and Primary Index in Teradata?

1 Answers
Answered by suresh

Understanding the Difference Between Primary Key and Primary Index in Teradata

In Teradata, the terms Primary Key and Primary Index are commonly used but they serve different purposes. Let's explore the difference between the two:

Primary Key:

A Primary Key in Teradata is a constraint defined on one or more columns in a table to uniquely identify each row. It enforces the uniqueness of these columns and ensures that no duplicate values are allowed. Only one Primary Key can be defined for a table.

Primary Index:

In contrast, a Primary Index in Teradata is defined on a table to specify the column that is used to distribute the rows across the AMPs (Access Module Processors) in the system. It helps in evenly distributing data for better performance in parallel processing. Multiple columns can be defined as the Primary Index for a table.

In summary, while a Primary Key enforces uniqueness of rows, a Primary Index determines how data is distributed across the system for optimized performance in Teradata.

Answer for Question: Can you explain the difference between Primary Key and Primary Index in Teradata?