Re: left join query does not perform well

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: left join query does not perform well
Дата
Msg-id 5882.1030288343@sss.pgh.pa.us
обсуждение исходный текст
Ответ на left join query does not perform well  (Manuel Sugawara <masm@fciencias.unam.mx>)
Список pgsql-sql
Manuel Sugawara <masm@fciencias.unam.mx> writes:
> Ouch, 3117.48 msec vs. 1.15 msec is a huge difference. I need
> something else? or may be postgres optimizer can't cope with
> left/right joins?

I think the problem is you're constraining the join order into a very
inefficient one.  See

http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/explicit-joins.html

But it's difficult to be sure, when you are showing us EXPLAIN output
that manifestly doesn't correspond to what you say the queries are.
For instance the nearest match to "epr_vord_grupo AS grupo" in the
explain output is "epr_ord_grupo g" ... I'm also wondering if any of
the tables used in the queries are really views, and if so what the
view definitions are.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Michael Paesold"
Дата:
Сообщение: Re: weird situation, BUG or I'm not doing it right
Следующее
От: Tom Lane
Дата:
Сообщение: Re: weird situation, BUG or I'm not doing it right