Thoughts on Primary keys
Hi all,
Usually whenever I design any tables I use Autonumbers as the primary keys. And this works fine for me.
However, in designing this current table, I have the option of using an autonumber field again, or I can use a text field. This text field will probably be no more than 10-15 characters long and this entry is going to be unique.
So my question for all the guru's out there is :
Is it better to use autonumber fields as the primary key, even if there is another field that can serve as the primary key, but it happens to be a text field? (With the aforementioned table design, I'm going to have two indexes and they are both going to be unique)
Just wondering what the impact will be on database performance when joining on text fields instead of numbers?
Also, under what circumstances will it be okay to use a text field as the primary key? Size of the field perhaps??
Cheers
Rohan
__________________
Cheers
Rohan
|