I have been reading the heated debates on composite vs surrogate keys on Stack Overflow and other websites, and even though puzzled about some of the arguments given, I feel I am aware of the pros and cons of each.
I feel tempted to go for surrogate keys, but now I have another question. Let me explain my situation. I have a table consisting of 5 integers that make up a unique combination, and I have several tables referencing this entity. Right now all tables include the full 5 fields and all JOIN operations have to mention all 5 fields as a join criterium. Now I have added a surrogate key. But should I remove all 5 fields from all tables in favour of a surrogate foreign key that references the 'main' table?
I feel unsure about doing this, since each of the 5 fields separately is frequently used as a selection criterium in the other tables. I have indexes defined on them, in a certain natural order, so that the selection operations perform fast. If I migrate all 5 fields to a separate table, I'm afraid that when I want to select on let's say the first three of them, I'll have to define a JOIN and select from that, but no indexes will have been defined on that JOIN since it has just been generated, and I will suffer a performance loss.
Or should I somehow define a VIEW for each table, including the 5 keys, and index on that?
I feel confused, and after typing all this, inclined to stick with natural keys again. Help?