| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Clean Object Class Design -- What is it?
> To be honest, I cannot see that. For example, the value-returning
> set expression
>
> S = S difference {x}
>
> could be enormously inefficient. Suppose the set contains 20,000
> elements, none of which is x?
What you think the optimizer is for? These are logical operations not physical operations; the optimizer translates them into physical operations. The DBMS does not need to perform a copy in this case at all.
Even when the user actually wants a copy of the entire relation, the DBMS does not have to perform the copy immediately and may never need to.
y = restrict(x,name != "Bob")
z = project(y, {name})
t = restrict(z, name = "Doug")
display t
The DBMS does not need to realize any result until the user requests that it display t. At that point, the DBMS only needs to determine whether any row in x exists where the name is "Doug". It either displays one row with name="Doug" or it displays zero rows.
name
or
name
![]() |
![]() |