PK over three columns, or new column for PK?
I have a table of 5 columns. The first three are together unique, so they could be the primary key. Or, I could create an auto incrementing id column as the PK.
My question is - would it be faster to make a query on the three column PK, or on the single ID column PK? And how would that 3 column query look - like this...?
I ask, as I see a lot of posts around saying 'why'd you make a new id column when you could use the unique columns as the PK?'
SELECT * FROM mytable WHERE col1 = 'blah' AND col2 = 'blahblah' AND col3 = 'blahblahblah'
The other thing is, I'll be referencing rows in this table from other tables, so I'm thinking it's better so have an id column that I can refer to in the other tables.