|Re: Surrogate auto-generated VS natural primary keys with JPA [message #661977 is a reply to message #661628]
||Mon, 28 March 2011 17:34
| James Sutherland
Registered: July 2009
Location: Ottawa, Canada
If your natural Id is complex, then using a generated Id may provide some performance benefit.|
If both are simple data-types, then I cannot see any benefit. Using the natural Id is probably more performant as people are more likely to query on it.
Generated Ids do have the benefit of always being unique, and never changing. Sometimes natural ids seemed to be unique or not change, but actually can change (such as ssn, name, phone number, email, etc.).
James : Wiki : Book : Blog : Twitter
Powered by FUDForum
. Page generated in 0.15116 seconds