Re: a union is always a join!

From: paul c <toledobythesea_at_oohay.ac>
Date: Sun, 01 Mar 2009 01:27:00 GMT
Message-ID: <Evlql.14337$Db2.10147_at_edtnps83>


rpost wrote:
> ...
> As I already said in my previous message, I see the elegance,
> but at the same time I find elegance in Codd's use of two kinds
> of operations. Obviously if you rewrite to Codd's algebra (or do
> something equivalent to that) you're not going to lose efficiency
> on the cases where this is possible. But just rejecting the rest
> is only going to confuse the user. Why not be honest and admit
> that we really expect, in our implementations, relational queries
> to work on finite, typically small relations, that WORKS_IN is one
> and PLUS is not, and that NOT doesn't do so?
> ...

In the interest of keeping the pot stirred, here are some other provocations (basically one of my same old tired recurring themes) .

As Fabian P and others have pointed out, a table (or should that be R-table?) that involves nulls obviously involves more than one of Codd's original relations. Given a smart enough implementation a relation that is defined using <OR> could be replaced by two or more relations (I seem to remember McGoveran stating similar somewhere or other. I'm guessing that Codd wouldn't have agreed but my hunch is that his objection would have been on practical, not theoretical grounds, so perhaps he would not have objected if somebody had made a practical implementation). As long as the closed-world-assumption is followed, a relation that is produced using the <NOT> operator doesn't generally need to be materialized because queries against it can be transformed as queries against its own negation. I'd say the importance of <NOT> has nothing to do with finiteness, rather that it parallels boolean algebra's NOT and thus allows a algebra to define retraction, aka 'deletion'.

<OR> is more interesting (to me) than <NOT>. Without <OR>, RT has no way to 'add' a tuple to a relation variable. When one uses a language's "INSERT" verb, it must effect the logical equivalent of <OR>. Codd's unadorned relation is a conjunction of simple propositions (by simple I mean each proposition contains no logical connectors). If a relation variable has the 'quality' of being a 'view' (or 'green' as I like to joke), some people say to the effect that the view is a conjunction of disjunctions (propositions involving the logical connector 'OR'). Whereas if the relation variable is 'base', they say it is just a conjunction of simple propositions. For years, I've been trying to understand how they can say this at the same time as they say that users should preferably see no difference between base and virtual/view relation variables (which I agree with, just as I would agree that there should be no appreciable difference between 'red' and 'green' relvars. Their argument then proceeds to claim that 'inserts' to some union views are indeterminate while 'inserts' to an equal 'base' view aren't. I'd say that if they are right, then we shouldn't be able to 'insert' to any variable unless it   points to an empty relation which would mean that no relation could   have more than one tuple - that bizarre situation would have exactly one advantage - no questions about finiteness! Received on Sun Mar 01 2009 - 02:27:00 CET

Original text of this message