Re: Optimizing Outer Joins - Mailing list pgsql-performance

From Sebastian Böck
Subject Re: Optimizing Outer Joins
Date
Msg-id 41FA3065.70003@freenet.de
Whole thread Raw
In response to Re: Optimizing Outer Joins  (Richard Huxton <dev@archonet.com>)
List pgsql-performance
Richard Huxton wrote:
> Sebastian Böck wrote:
>> But why is the scan on table b performed?
>> If i understand it correctly this is unnecessary because the
>> result contains only rows from table a.
>
>
> It's only unnecessary in the case where there is a 1:1 correspondence
> between a.id and b.id - if you had more than one matching row in "b"
> then there'd be repeated rows from "a" in the result. Not sure if PG can
>  tell what the situation is regarding references and pkeys, but in your
> example you don't have one anyway.

Ok, is there a way to avoid the extra scan if only one row is
returned (distinc on for example)?

What would be great is if a subselect could work with more than
one column returning. Is there a way to achieve this?

Thanks Sebastian


pgsql-performance by date:

Previous
From: William Yu
Date:
Subject: Re: PostgreSQL clustering VS MySQL clustering
Next
From: "Narayanan Subramaniam Iyer"
Date:
Subject: Postgres server getting slow!!