Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Extending my question. Was: The relational model and relational algebra - why did SQL become the industry standard?
>
>
> SET(SET(A) INTERSECT(SET(B UNION C))) =
> SET(SET((A) INTERSECT SET(B)) UNION (SET(A) INTERSECT SET(C)))
>
>So, although things get a bit more complicated, there is absolutely no
>reason why a query optimizer that is based on a bag algebra would
>perform worse than one that is based on a set algebra.
>
So the point here seems to be that in SQL we can always use 'DISTINCT' anyway and the optimizer will be able to take that into account and optimize accordingly?
e.g.
select distinct s.s#
from s, sp
where s.s# = sp.s#
could be converted into
select s.s#
from s
where exists
( select * from sp where s.s# = sp.s# ) ?
In principle this is correct, but:
I would draw a parallel with using GOTO's in programming languages:
By point here being that by providing users with both tuple bags and relations (by use of distinct) we are actually causing more confusion for all!
regards,
Lauri Pietarinen
Received on Sat Feb 15 2003 - 05:19:00 CST