Re: Thinking about MINUS

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Sun, 07 Jan 2007 20:57:33 GMT
Message-ID: <19doh.41876$cz.614416_at_ursa-nb00s0.nbnet.nb.ca>


Marshall wrote:

> On Jan 7, 8:48 am, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
>

>>paul c wrote:
>>
>>
>>>One of a couple of reasons this topic intrigues me is that certain
>>>scenarios aren't closed for operations in Codd's framework, eg., the
>>>case when two operands share an attribute name that has different types.
>>> I realize that a whole sub-industry has been built to deal with
>>>problems like this (based on various design disciplines, knowingly or
>>>unknowingly, I don't know), so many people would say I'm silly to
>>>wonder, but I can't help it.
>>
>>Wouldn't one end up with a resulting attribute defined as a union-type
>>in a relation with no rows?

>
> That's certainly one way to handle it. However I would be more inclined
> to think of it as a type error. Considering the relational operations
> as
> logic operations, if we use a variable to mean one thing (or kind of
> thing)
> in one equation, and another thing in another equation, we can't
> validly
> proceed using both at once.

That all depends on the data type system. A system that supports supertype and subtype could treat the resulting attribute as having the universal supertype. If the values have different MST's, the equality operation will evaluate to false yielding an empty relation regardless.

Again, I think context is important. In many cases, such a join will result from user error of some kind in which case one would like at least a warning or hint to the user. It is at least conceivable that it could also result from the optimizer manipulating some other expression or as part of some generic operation. In the last case, I suggest leaving it up to the generic operation to assert whether such a situation is an error. Received on Sun Jan 07 2007 - 21:57:33 CET

Original text of this message