Re: Extending my question. Was: The relational model and relational algebra - why did SQL become the industry standard?
Date: Sat, 15 Feb 2003 13:19:00 +0200
> 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?
select distinct s.s#
from s, sp
where s.s# = sp.s#
could be converted into
( select * from sp where s.s# = sp.s# ) ?
- more work for the optimizer groops
because it has to support two "modes";
hence bigger and buggier products.
- optimizing efforts will be concentrated on the most used features, that being querieswithout disticnt.
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!
Lauri Pietarinen Received on Sat Feb 15 2003 - 12:19:00 CET