If I understand you correctly, you have two tables, 'A' and 'B', with a
many-to-many relationship, with private keys 'ida' and 'idb', respectively.,
You want to know if the relations table 'R' should (or must) have a key
If I understand your question correctly, then yes, I generally create a
primary key on 'ida,idb' for two reasons. The first it to ensure the
combination is unique (I don't need the same relationship entered
twice). The second is for speed - it makes searches on 'ida' or
'ida,idb' faster. And depending on what I need, I may make another
index on 'idb,ida' to speed up searches where idb is required first.
Remove the "x" from my email address
JDS Computer Training Corp.