Home Forums Database Design Relational Theory Defining keys as sets that must not intersect instead of scalar values that must not be equal RE: Defining keys as sets that must not intersect instead of scalar values that must not be equal

  • Could you elaborate on the "disallows using columns in keys to specify overlapping sets" problem? Maybe an example will help.

    I would want my keys to be able to specify overlapping data. For instance, I'd like to be able to specify overlapping time ranges without any analysis applied beyond whether the combination of column values would be unique.

    Like:
    day shift, 8 am to 5 pm
    swing shift, 12 noon to 9 pm
    and those both be unique keys.

    How about:
    regions:
    we could declare these with an ordered list of coordinates, and lets just say that we can and do specify regions like this routinely, and we use these specifications for things we do for regions like political boundaries. So one political boundary could CONTAIN multiple sub boundaries.

    manufacturing assemblies.
    obviously the "assembly id" would not overlap, but a sub assembly could belong to multiple assemblies. Does the intersection function apply here? Sure we only key on the assembly id for the assembly header, but for the assembly detail, if we read semantically into this to determine intersection, does your theory apply or not?

    edit: in other words, whats so bad about overlapping sets, because as long as the intersection does not equal both sets (ie., the keys aren't equal), the keys specify unique and unequal things. What does the empty intersection buy us?

    So intuitively I'm concerned at what problems this modeling of yours introduces (and obviously my analysis could be mistaken!), without any understanding of any solutions that your modeling assists in achieving or what advantages this modeling technique might facilitate. Is there any way you could distill the advantages of your intersection function would give? I understand this is to assist in evaluating candidate keys, but what advantages does the intersection offer versus simple equality, or alternatively what disadvantages does equality without the intersection test imply?

    Heck maybe I'm just not understanding whats up, especially in this age of surrogate keys based on arbitrary integers 🙂