Re: Throwing unnecessary joins away - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: Throwing unnecessary joins away
Date
Msg-id 1137085382.3959.16.camel@state.g2switchworks.com
Whole thread Raw
In response to Re: Throwing unnecessary joins away  (Ottó Havasvölgyi <havasvolgyi.otto@gmail.com>)
Responses Re: Throwing unnecessary joins away  (Ottó Havasvölgyi <havasvolgyi.otto@gmail.com>)
List pgsql-performance
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...

pgsql-performance by date:

Previous
From: Ottó Havasvölgyi
Date:
Subject: Re: Throwing unnecessary joins away
Next
From: Andrew Lazarus
Date:
Subject: Re: Please Help: PostgreSQL performance Optimization