I have two tables A,B. Both tables will have more than 1 million records.
A has two columns - id, photo_id. id is the primary key and photo_id is unique.
A needs to be referenced in B.
3 questions:
- Can I ignore
A'sidand usephoto_idto link the two tables? - Is there any benefit of using the primary column as opposed to using a unique column in B?
- What difference will it make to have a foreign key? I probably won't use foreign key since it's not supported on the server I'm using. Will this make a significant difference when there are 1+ mil records?