General discussion
July 4, 2002 at 09:27 PM
burzinmk

Disadvantage of surrogate key

by burzinmk . Updated 24 years, 2 months ago

Suppose a surrogate key (which is also the primary key) is used in one of the entity sets. Later, due to some changes it is found that two other entity sets are specializations of this entity set. Now, it is necessary for the primary key to be present in the two specialized entity sets. Now, to autogenerate this key one has to look up two entity sets (tables), find maximum of the key (surrogate key) from the two tables and then increment it using some logic. I think this is quite a bit of an overhead and a bigger problem as the tables grow in size. I have learnt this just by experience. Can this be called as a disadvantage of using a surrogate key?

This discussion is locked

All Comments