Question re: MySQL and PRIMARY versus UNIQUE indexes
Any MySQL gurus in the house? I need your help. I’ve got a question: If I have an auto_incrementing id field that is a primary key, and I plan to use that key in a related table, is the primary key enough, should I make it a primary key and a unique key (thereby creating a larger index size and a larger overall DB), or should I just make it a unique key? I’m using InnoDB tables.
What I’ve done in the past is make the id field a PRIMARY key and didn’t bother with a unique key. Now I’m wondering if making the ID a unique key makes more sense because I’ll be using it as a key in another table.
Thoughts? Help?