Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> comp.databases.theory -> Re: What databases have taught me
Bob Badour 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!
>From application programer perspective whenever I rewrite SQL by
copying/pasting and rearranging predicates the "WHERE" keyword is
always a source of bugs (those are admittedly minor problems easily
spotted, but still).
Received on Fri Jun 23 2006 - 20:06:50 CDT