Re: Bill of materials / Groups in Groups

From: <joe_celko_at_my-deja.com>
Date: 2000/01/26
Message-ID: <86nt0i$27i$1_at_nnrp1.deja.com>#1/1


>> According to Atzeni & DeAntonellis, a domain constraint simply
expresses the fact that the values of a certain attribute must always come from a certain set (the "domain" of the attribute). For instance, the requirement that lft is an integer and must be greater than zero is a domain constraint: it declares that values of lft come from the set of positive integers. But a constraint like "subset_definition" is not a domain constraint. It enforces a relationship that must hold between two attributes of each tuple (lft < rgt), which is much stronger than simply requiring an attribute to take on values from a pre-specified set. The constraint "subordination" is even more complicated, eferring to several attributes of a tuple and also to the other tuples in the relation. It is certainly not a domain constraint. Since you've specified two complex constraints that are neither key constraints nor domain constraints, I have to conclude once again that the relation is not in DKNF. <<

Why do compound domains bother you? Nobody has any trouble with a compound key. Would you think that (x,y) and (x,y,z) co-ordinates are not a domain? Longtitude and latitude? Polar co-ordinates? (lft, rgt) are not scalar attributes -- one without the other is meaningless, just like (x,y) co-ordinates.

The set for a domain does not have to be pre-specified. It can be defined by extension (i.e. by examples: sex = {0,1,2,9} in the ISO Standard, with the meanings 'Unknown', 'male', 'female' and "Not Applicable - lawful person'). But it scan be deined by intention as well (i.e. by a rule: odd = {i : i is an INTEGER AND MOD(i, 2) = 1}.

The placs where you get into a argument are:

  1. When the extensional set changes -- state_code = {'AL', 'AK', ...} and then Puerto Rico enters the Union. New Domain or not?
  2. When the extensional set has a self-reference. In order to be member of our club, you have to know someone who is already a member. This sort of thing leads to fractals.
  3. When the intentional rule is not computable. We vote on members in our club by tossing dice.
  4. When the intentional rule is not computable in a finite amount of time. A digit is a member of my domain set if that digit appears seven times in row in the decimal expansion of pi.

What you have with (lft,rgt) is a self-reference. Given (a,b) I can determine if it is in the domain of ordered pairs of integers for my tree by a few tests:

  1. (a < b)
  2. (a > 0)
  3. (b > 1)
  4. UNIQUE(a,b) -- which is just part of being a set
  5. UNIQUE(a)
  6. UNIQUE(b)
  7. Does the range of (a,b) overlap the range of an existing pair?

The last one is the self-reference. I suppose if you wanted to consider the structure of every possible tree as a nested set model to be a domain set, you could.

--CELKO-- Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Jan 26 2000 - 00:00:00 CET

Original text of this message