Re: What databases have taught me
From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Sat, 24 Jun 2006 01:36:07 GMT
Message-ID: <bG0ng.1350$pu3.36337_at_ursa-nb00s0.nbnet.nb.ca>
>
>
> Yes
>
>
>
>
> I'm not clear what do you mean by name resolution. The expression
> appeals from sql optimization perspective: it's a join of 3 finite
> relations. There are 6 join order permutations possible:
>
> i). x = 1 join y = 2 join R
> ii). x = 1 join R join y = 2
> iii). x = 2 join R join y = 1
> iv). x = 2 join y = 1 join R
> v). R join y = 2 join x = 1
> vi). R join y = 1 join x = 2
>
> Evaluate cost of each and execute the one with lowest cost!
Date: Sat, 24 Jun 2006 01:36:07 GMT
Message-ID: <bG0ng.1350$pu3.36337_at_ursa-nb00s0.nbnet.nb.ca>
Aloha Kakuikanu wrote:
>>Aloha Kakuikanu wrote: >> >> >>>Keith H Duggar wrote: >>> >>> >>>>http://dbappbuilder.sourceforge.net/Rel.html >>> >>> >>>Speaking of clumsy syntax, why >>> >>>R WHERE x = 1 AND y = 2 >>> >>>and not >>> >>>R AND x = 1 AND y = 2 >>> >>>? >> >>Would (R AND x = 1 AND y = 2) = (x = 1 AND y = 2 AND R) ?
>
>
> Yes
>
>
>>If so, wouldn't that make name resolution kinda complicated and perhaps >>error-prone?
>
>
> I'm not clear what do you mean by name resolution. The expression
> appeals from sql optimization perspective: it's a join of 3 finite
> relations. There are 6 join order permutations possible:
>
> i). x = 1 join y = 2 join R
> ii). x = 1 join R join y = 2
> iii). x = 2 join R join y = 1
> iv). x = 2 join y = 1 join R
> v). R join y = 2 join x = 1
> vi). R join y = 1 join x = 2
>
> Evaluate cost of each and execute the one with lowest cost!
Consider:
Ra = Rb AND x = 1 AND y = 1
Where Ra and Rb are two relvars. Is that still a join? To what do x and
y refer?
Consider:
R AND x = 1 AND y = 1
where R has no x attribute. Will that cause a compile-time error? Why or why not? Received on Sat Jun 24 2006 - 03:36:07 CEST