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?
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With