I’m just wondering that, if I implemented a tags system, should I use a primary key on the tag name, or just have the usual primary key with a unique index on the tag name column?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming the tag entity will be used in millions of rows, a numeric column will perform better than a string as a foreign key column. This is why you use surrogate keys
So “just have the usual primary key with a unique index on the tag name column”