Re: Optimizing Outer Joins

Поиск
Список
Период
Сортировка
От Sebastian Böck
Тема Re: Optimizing Outer Joins
Дата
Msg-id 41FA3065.70003@freenet.de
обсуждение исходный текст
Ответ на Re: Optimizing Outer Joins  (Richard Huxton <dev@archonet.com>)
Список 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 по дате отправления:

Предыдущее
От: William Yu
Дата:
Сообщение: Re: PostgreSQL clustering VS MySQL clustering
Следующее
От: "Narayanan Subramaniam Iyer"
Дата:
Сообщение: Postgres server getting slow!!