If a database has attributes A1, A2, A3...An and A1, A2 & A3 can form composite key together, is it better to use a surrogate key instead of a composite key?
Using a surrogate key will improve the Insertion execution speed of records (this supports surrogate over composite key) But the SELECT, UPDATE and DELETE queries based on the attributes A1, A2 & A3 will be tremendously slowed down if we use surrogate key(this supports composite key over surrogate key).
Which is better in terms of performance given such conditions? Surrogate key or composite key?
In nearly all tests, there was little to no performance advantage of surrogate keys over natural keys. Natural keys also have the advantage of being much easier to work with. A better write-up is available here.