DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

Database
Enthusiast

DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

hI,

iam new to teradata . So please tell me the diff between primary key and primary index.

Regards,
Sai
7 REPLIES
Enthusiast

Re: DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

Using Primary Index Teradata distributes the data in it's AMP's.
Primary Key is an logical concept used by all the RDBMS, and it helps to uniquely identify each record in a Table.
Enthusiast

Re: DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

If you are absolutely looking for the differences then below are few -

PRIMARY KEY PRIMARY INDEX

1 It cannot be NULL It can be NULL
2 It is not mandatory in Teradata It is mandatory in Teradata
3 It does not help in data distribution It helps in data distribution
4 It has to be unique It can be unique or non-unique
5 It is logical implementation It is physical implementation
6 It cannot be changed It can be changed.
Enthusiast

Re: DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

Sorry about the formatting, but not sure, why teradata forum is removing all the lines and spaces today.
Teradata Employee

Re: DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

@KS42982,

The formatting glitch has been repaired.

Enthusiast

Re: DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

That's a good news. I am trying again here.

PRIMARY KEY PRIMARY INDEX

1 It cannot be NULL It can be NULL
2 It is not mandatory in Teradata It is mandatory in Teradata
3 It does not help in data distribution It helps in data distribution
4 It has to be unique It can be unique or non-unique
5 It is logical implementation It is physical implementation
6 It cannot be changed It can be changed.
Enthusiast

Re: DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

thanx @KS42982 for your post on the diff between primary key and primary index

Enthusiast

Re: DIFF BETWEEN PRIMARY KEY AND PRIMARY INDEX

Just a bit more info in case someone searches for this. So a PK can create a physical index, in order to force uniqueness

"When a non-primary index uniqueness constraint is created, whether it is a PRIMARY KEY or UNIQUE constraint, Teradata Database implements it as a USI."