Re: Transitive Closure

From: Mikito Harakiri <mikharakiri_nospaum_at_yahoo.com>
Date: 16 May 2004 10:19:44 -0700
Message-ID: <8a529bb.0405160919.73cf214b_at_posting.google.com>


alfredo_at_ncs.es (Alfredo Novoa) wrote in message news:<e4330f45.0405160457.37da2e49_at_posting.google.com>...
> "Mikito Harakiri" <mikharakiri_at_iahu.com> wrote in message news:<l%bpc.34$7Q3.118_at_news.oracle.com>...
>
> > How about TC not commuting with selection?
> >
> > TC( select x,y from {(x=1,y=2),(x=2,y=3)} where x=1 and y=3)
> >
> > is not the same as
> >
> > select x,y from TC( {(x=1,y=2),(x=2,y=3)}) where x=1 and y=3
>
> TC(A where b) <> TC(A) where b
>
> TC is not associative in respect to restriction.
>
> There are many non associative operators in respect to others.
>
> (2 * 0) + 1 <> (2 + 1) * 0

Both TC and selection (I prefer that name that pops up on the first page when googling "Relational Algebra") are unary relational operators. So we are talking about composition operation applied to operators and commutativity of this operation.

In relational world operator commutativity is very important. Although Relational Algebra appears to be more procedural than relational calculus (apply this selection, then, apply this projection, and so on), this syntactic order doesn't really matter as selection and projection commute to about every other operator. This is why select-project-join is expressed in good old SQL as:

select ... from A,B,C where ...

without any emphasis into the order of those operations.

Relational implementation terminology coined this phenomenon as "move around predicates". Received on Sun May 16 2004 - 19:19:44 CEST

Original text of this message