Re: Very slow query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Very slow query
Дата
Msg-id 29792.1084276474@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Very slow query  (Rory Campbell-Lange <rory@campbell-lange.net>)
Список pgsql-general
Rory Campbell-Lange <rory@campbell-lange.net> writes:
> The following query on some small datasets takes over a second to run.
> I'd be grateful for some help in understanding the explain output, and
> to remake the code.

I think the problem is you have an unconstrained join against "people
p", which is wasting a bunch of time generating duplicate records
(and then sorting them, and then discarding them in the DISTINCT step...)

            regards, tom lane

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

Предыдущее
От: Reynir Þór Hübner
Дата:
Сообщение: JDBC problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Trying to compute the median