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

From Alessandro Baretta
Subject Re: Throwing unnecessary joins away
Date
Msg-id 43C64CFB.9030504@barettadeit.com
Whole thread Raw
In response to Throwing unnecessary joins away  (Ottó Havasvölgyi <havasvolgyi.otto@gmail.com>)
Responses Re: Throwing unnecessary joins away  (Ottó Havasvölgyi <havasvolgyi.otto@gmail.com>)
Re: Throwing unnecessary joins away  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-performance
Ottó Havasvölgyi wrote:
> Hi all,
>
> Is PostgreSQL able to throw unnecessary joins?
> For example I have two tables, and I join then with their primary keys,
> say type of bigint . In this case if I don't reference to one of the
> tables anywhere except the join condition, then the join can be eliminated.
> Or if I do a "table1 left join table2 (table1.referer=table2.id)"  (N :
> 1 relationship), and I don't reference table2 anywhere else, then it is
> unnecessary.

It cannot possibly remove "unnecessary joins", simply because the join
influences whether a tuple in the referenced table gets selected and how many times.

Alex


--
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>

pgsql-performance by date:

Previous
From: Ottó Havasvölgyi
Date:
Subject: Throwing unnecessary joins away
Next
From: Ottó Havasvölgyi
Date:
Subject: Re: Throwing unnecessary joins away