MySQL Forums
Forum List  »  Performance

Re: Superkey vs Primary Key
Posted by: Peter Brawley
Date: June 16, 2014 10:42AM

In general, primary keys should not depend on the external world, ie they should not require edits, so phone is not a good prospect as a primary key component. For the half of the population whose names often change with marriage & divorce, ditto for name. So this may be a good candidate for a surrogate primary key.

A query that joins or filters or orders by name & phone will perform better if there is a (name,phone) covering index.

So consider a primary surrogate key and a covering index on name & phone.



Edited 1 time(s). Last edit at 06/17/2014 03:40AM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
5046
June 16, 2014 04:13AM
Re: Superkey vs Primary Key
1467
June 16, 2014 10:42AM
1034
June 17, 2014 12:57AM
1061
June 17, 2014 03:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.