ArtistFans
ArtistID (PK)
UserID (PK)
The use of an auto incremental PK has no advantages here, even if the parent tables have them.
I'd also create a "reverse PK" index automatically on (UserID, ArtistID)
too: you will need it because you'll query the table by both columns.
Autonumber/ID columns have their place. You'd choose them to improve certain things after the normalisation process based on the physical platform. But not for link tables: if your braindead ORM insists, then change ORMs...
Edit, Oct 2012
It's important to note that you'd still need unique (UserID, ArtistID)
and (ArtistID, UserID)
indexes. Adding an auto increments just uses more space (in memory, not just on disk) that shouldn't be used
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…