Arbitrary Constraints

From: Kenneth Downs <firstinit.lastname_at_lastnameplusfam.net>
Date: Tue, 26 Oct 2004 07:27:44 -0400
Message-ID: <hbcllc.lf2.ln_at_mercury.downsfam.net>



Last week I mentioned that I believed unique and referential constraints are not used to their full potential, and that they could be used instead of some of the constraints we see today. Several kind souls argued the other side of this and helped me to solidify my thoughts. Thanks.

Now I have arrived in this particular project where it is time to systematically deal with non-structural constraints. I use the word
"arbitrary" to describe them to emphasize their volatility.

An arbitrary constraint is one that appears, from the point of view of normal forms, to pop up out of nowhere after the fact. Consider that you put all of this time into normalizing tables, and then somebody says, "Oh yes, each customer has a credit limit, and open orders cannot exceed the credit limit." This appears as an arbitrary relationship between columns that cannot be dealt with in normalizing them. A filter comes into play one way or another.

What I would like to do now is determine if the most commonly encountered
"must have" constraints out there in fact have commonalities to them so
that they can be handled with a finite number of types, macros, or
utilities, and so their apparent arbitrariness can be categorized and
"normalized" as it were.

For instance, last week's example of the salary cap can in fact be dealt with with a salary lookup table. Some did not like this solution but in the first pass we are dealing with technical possibilities and impossibilities. We have to gather them altogether before making a judgement.

The next category I saw was the two-column relationships. Open Orders <= Credit Limit, Qty_Shipped <= Qty_ordered, things like that.

This may be a can of worms in asking for more constraint examples, because I may have to fend off a lot of constraints that could be dealt with with RI, but what I think I'm looking for are the very simple cases that are not obviously structural, like simple credit limits, inventory >= 0 and so forth.

-- 
Kenneth Downs
Use first initial plus last name at last name plus literal "fam.net" to
email me
Received on Tue Oct 26 2004 - 13:27:44 CEST

Original text of this message