Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Primary Key Index

Status
Not open for further replies.

skydesigns

Technical User
Oct 22, 2001
4
0
0
US
I guess this will sound like a very silly question, but here goes:

If I understand correctly, a Primary Key is an "index". So, is there ever any reason to add another index to the primary key field? Exprimenting with mySQL I found that it was possible to do it, but does it serve any purpose?

Thank you for your help!

Matt
 
If the index is precisely the same as the key, it serves no purpose at all. If, however, you were to index on the key in combination with another field(s) upon which you frequently search your table then it is certainly a good idea.

Jim
 
Primary Key is for Refernecing a specific record

Index keys are for outright query speed!
I have never seen:

select * from table name where INDEXED_TABLE='data';

as opposed to

select * from table name where PRIMARY_KEY='data';


NixerX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top