I am not sure if this question has been asked or not. At least I couldn't find it.
I am curious about a primary key in terms of efficiency with data searching and retrieval.
This is a hypothetical example...
I have a list of students with unique StudentID (say 10 digits long, given that the school will never have that many students) and StudentName (which is unique too).
Would it be better to use StudentID as primary key or create a new field for primary key (may be 6 - 8 digits or composite of characters and numbers. i.e. ATC1002)?
If I use StudentName as the primary key, will I see any retrieval performance degradation? If so, approximately how much in general? Are there any other factors which will have an impact on the selection of the primary field?
Studentstable? The average school has less than 10,000 students which is a trivial amount of records for any modern DBMS. However, if you are talking about hundreds of millions of students, then choosing the correct key is extremely important, and I would certainly not useStudentNameas the key field, not least because it will certainly not be unique! – Max Vernon Sep 10 '12 at 18:27