Re: database design method

From: Lauri Pietarinen <lauri.pietarinen_at_atbusiness.com>
Date: Sun, 17 Nov 2002 16:13:49 +0200
Message-ID: <3DD7A41D.2463F86_at_atbusiness.com>


Jan Hidders wrote:

> >So is the function of these identifiers to act as an "internal glue"?
>
> In a sense, yes. Suppose you want to represent a nested relation R(a,B) (B
> is the nested column) with the flat relations R1(a,c) and R2(c,b) where in
> R1.c you use an identifier to replace the set in R.B, and in R2 you record
> what the elements of the sets. You could indeed say that the identifiers in
> colomns c is what allows us to glue the two relations together and
> reconstruct the nested relation R.

OK. Why do they have to be abstract?

> >What is the problem with generating such values? If they are just integer
> >values (say) and there is a process inside the engine that gives the system
> >the next integer? Or maybe generates a random value within a large space
> >and just quickly checks if it is reserved?
>
> For surrogate identifers the DBMS must somehow remember all identifiers
> that have ever been used, also those that are no longer used in any
> relation. It could do this by either storing the set of all identifiers that
> were ever used (could be big) or remembering the highest integer that it has
> every generated, but then it cannot reuse identifiers that are no longer
> used.

Why does it have to remember all identifiers ever been used if it want's to reuse them anyway? On the other hand if it does not reuse the identifiers what's wrong with an integer counter (say 2**64). And still: why do the identifiers have to be globally unique? Surely it suffices to have them unique within each relation?

And how do "abstract identifiers" come to the resque? Surely the same pertains to them?

> Another problem is if you define views with new identifiers in them. Should
> these be regenerated every time the view is accessed? What would these
> identifiers then mean?

Why not? What are they used for if they mean nothing?

> >And one more question: what would be a practical query in which
> >these abstract identifiers would be needed.
>
> Suppose I have a relation
>
> Bought(customer, product)
>
> and I want as the result a relation
>
> Cust_class(class_id, customer)
>
> that groups the customers into classes that have bought the same set of
> prodcucts and gives them a new identifier.

OK, but

regards,
Lauri Pietarinen Received on Sun Nov 17 2002 - 15:13:49 CET

Original text of this message