Primary Index

shank_Blr

New Member
what is the importence & use of primary index?
I.e if I define one primary index what benifits I will be getting which I wont get with other indexes.
except only one primary index will be there in a table.

When we refer the cross referencing of tables only UNIQUE index play its role.
 

TomBascom

Curmudgeon
The "primary" index has two important roles:

1) It is the default ordering used when dumping & reloading data.

2) It is a tie breaker when the optimizer is selecting indexes. If two indexes have otherwise equal weight as the criteria are evaluated and one of them is the primary then the primary index will be selected. If two indexes are equal and neither is the primary then the one whose name comes first in alphabetical order will be selected.
 
Top