Re: Functions and Relations

From: NENASHI, Tegiri <tnmail42_at_gmail.com>
Date: Tue, 21 Nov 2006 05:16:12 +0100 (CET)
Message-ID: <Xns9881ECB80CD1Easdgba_at_194.177.96.26>


"Aloha Kakuikanu" <aloha.kakuikanu_at_yahoo.com> wrote in news:1164073723.190203.250710_at_k70g2000cwa.googlegroups.com:

>
> NENASHI, Tegiri wrote:

>> "Aloha Kakuikanu" <aloha.kakuikanu_at_yahoo.com> wrote in
>> news:1164051960.913651.234880_at_m73g2000cwd.googlegroups.com:
>> > But then, both composition and join are
>> > associative. Is it merely a coincidence?
>>
>> There are relation compositions that are not associative:
>>
>> 3 -2 - 1: let const3 = 3; m2:x ->x-2; m1:x->x-1;
>>
>> 'const3 o m2 o m1'  is not associative.

>
> Relation composition or function composition?

What is the difference ? pretend that the composition of relations is followed by a projection.

> In your example, both
> ways seems to produce const3.

Please read it from left to right like lambda application ';'. I had to have it written with ';'' not with 'o': const3 ; m2; m1. The correct way:

m1 o m2 o const3

But I think that you understood ;)

>
> Proof by googling: "function composition associative"

Google is wrong: now you know that not all the time ;) The division is another example, Lie groups, et cetera.

>

>> > it is merely an expression, then what about corellated scalar
>> > subquery:
>> >
>> > select (select dname from dept d where d.deptno=e.deptno)
>> > from emp e
>> >
>> > How does one show scalar subquery on the expalin plan?
>>
>> Why it can not be shown like a nested loop:  'for each row-> select
>> ....' 

>
> So it's a join of a function with relation?
>
>> >How about
>> > functon call
>> >
>> > select raise(sal) from emp
>>
>> I think it is more efficient to compute a function in comparaison of
>> insert a formula in the tuple and then interpret the partially
>> evaluated formula:  it is how you are going to implement a function
>> join in theory, no ?

>
> I think so.
>
>
Received on Tue Nov 21 2006 - 05:16:12 CET

Original text of this message