Re: Throwing unnecessary joins away

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Ottó Havasvölgyi <havasvolgyi(dot)otto(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Throwing unnecessary joins away
Date: 2006-01-12 17:03:02
Message-ID: 1137085382.3959.16.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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...

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Lazarus 2006-01-12 18:42:39 Re: Please Help: PostgreSQL performance Optimization
Previous Message Ottó Havasvölgyi 2006-01-12 17:00:07 Re: Throwing unnecessary joins away