Re: thinking about UPDATE

From: Marshall Spight <mspight_at_dnai.com>
Date: Thu, 22 Jul 2004 15:05:20 GMT
Message-ID: <QIQLc.139454$a24.125173_at_attbi_s03>


"x" <x-false_at_yahoo.com> wrote in message news:40feafc9_at_post.usenet.com...
> **** Post for FREE via your newsreader at post.usenet.com ****
>
> "Marshall Spight" <mspight_at_dnai.com> wrote in message
> news:YhxLc.4607$8_6.1154_at_attbi_s04...
>
> > Presumably one could infer the keys on the results of a relational
> > operator.
>
> Try it. For project operator for example.

[I'm just going to consider tables with a single key for now.]

Projecting where we maintain the key attribute is trivial; the key remains intact and nothing needs to be done. So I'll speak only of cases where projection leaves us without part or all of the key.

First, the case where the key is zero attributes. In this case, there is no project operation that can reduce the number of attributes in the key, so again nothing to do.

Next the case where the key is one attribute. If we project such that this attribute does not remain, then we must synthesize a key. We have no logical basis for choosing some proper subset of the remaining attributes, so we must choose all remaining attributes.

Next the case where the key is multiple attributes. If we project such that the entire key has been eliminated, then proceed as above. Even if some prime attributes remain, this doesn't help. So if the single key is "damaged" at all, we expand the key to include all attributes.

If we have multiple keys, we again divide up the cases such that we consider keys that have lost attributes or not.

If we have multiple keys and one has lost attributes and one hasn't, then we still have an intact key, so we don't need to do anything. The partial-key information is discarded, and the intact key is still a key.

If we have multiple keys and they have all lost attributes, then we again create a key that is all attributes, and discard the partial-key information.

I think that covers all cases. How did I do?

Also I note that my post here is simply thinking out the cases, and I have no formalism to back this up. Does anyone have any suggestions as to a formalism to apply to either prove or disprove the above? I have no obvious candidates. Any help in this area is appreciated.

Marshall Received on Thu Jul 22 2004 - 17:05:20 CEST

Original text of this message