Re: What should be my PK?
PK(URI_CM1, URI_CM2) says that the combination of those two columns is "unique".
PK(URI_CM1, URI_CM2, anything_else) says that the two columns may not be unique, but the combination of three columns is unique. Do you want/need that?
As long as you are using MyISAM, there is (I think) nothing more to say.
If you were using InnoDB, then certain performance issues can benefit from picking the PRIMARY KEY column(s), even if it is somewhat ignoring the 'unique' quality of the PK. This deals with the PK being "clustered" with the data.
"Would it help, if I include URI as part of my PK?" -- That question is answerable after seeing the main queries used on the table. I have already said "no" for the few queries you have provided.
Subject
Written By
Posted
Re: What should be my PK?
June 13, 2016 01:51AM
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.