On Thu, 2006-01-12 at 11:00, Ottó Havasvölgyi wrote:
> Hi,
>
> I think it would be sufficient only for views. In other cases the
> programmer can optimize himself. But a view can be a join of other
> tables, and it is not sure that all of them are always needed. It all
> depends on what I select from the view.
The idea that you could throw away joins only works for outer joins.
I.e. if you did:
select a.x, a.y, a.z from a left join b (on a.id=b.aid)
then you could throw away the join to b. But if it was a regular inner
join then you couldn't know whether or not you needed to join to b
without actually joining to b...