Subject Re: [ib-support] OT? Surrogate Keys
Author Paul Schmidt
On 4 Jan 2002, at 5:39, sugi wrote:

> The most notable change is that ORDER_ID column is not part of the
> primary key anymore, but just a 'reference' (what's the correct term
> for this??? :D). Aside from that, ORDER_DETAIL_ID now can also be
> generator-based, not generated from the client side, which is mostly a
> good thing (I think).
>
> At this point I cannot decide which approach is 'better'. The major
> complaints people are having with the surrogate model is that it's
> 'unusual'. Opinions/suggestions/tips or even links to appropriate
> 'reading materials' will be greatly appreciated. Many thanks in
> advance.

I don't know how the surrogate key is unusual, probably well over
90% of all databases have at least one table with a surrogate key.
Typically you will see multi-field keys used in materials teaching
database theory. The problem is that multi-field keys can be
expensive, because all of the key fields need to be delt with,
wherever they are used. For an example, I use VisualC++ for my
development and the ComboBox control has a SetDataItem field,
this accepts a long int. So the generator key works perfectly for
positioning records, where as using a multibyte key, I need to use
arrays and other crap to do the same thing....

I use surogate keys where ever I can....


Paul
Paul Schmidt
Tricat Technologies
paul@...
www.tricattechnologies.com