Re: Slow query with join

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow query with join
Дата
Msg-id 8884.1426539996@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Slow query with join  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Slow query with join  (Marc Watson <mark.watson@jurisconcept.ca>)
Список pgsql-general
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> On 16.3.2015 19:50, Marc Watson wrote:
>> I hope someone can help me with a problem I'm having when joining a
>> view with a table. The view is somewhat involved, but I can provide the
>> details if necessary

> First, get rid of the ORDER BY clauses in the subselects - it's
> completely pointless, and might prevent proper optimization (e.g.
> replacing the IN() with optimized joins.

I'm suspicious that the cause may be an ORDER BY in the view.  It's
hard to tell when we've not seen the view definition, but I see that both
plans we've been shown are going to produce output sorted by actor.id.
Maybe that's happenstance, or maybe not.

            regards, tom lane


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Slow query with join
Следующее
От: "David G. Johnston"
Дата:
Сообщение: How does one make the following psql statement sql-injection resilient?