Re: suggestions on improving a query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: suggestions on improving a query
Дата
Msg-id 23874.1171468548@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: suggestions on improving a query  (Rajarshi Guha <rguha@indiana.edu>)
Ответы Re: suggestions on improving a query  (Rajarshi Guha <rguha@indiana.edu>)
Список pgsql-general
Rajarshi Guha <rguha@indiana.edu> writes:
> Clearly a big improvement in performance.

Huh?  It looks like exactly the same plan as before.  Any improvement
you're seeing must be coming from cache effects.

> It looks like theres a big mismatch on the expected and observed costs and times.

Well, in the first place the estimated costs are not measured in
milliseconds, and in the second place the estimated cost and rowcount
are for execution of the plan node to completion, which is not happening
here because of the Limit --- we'll stop the plan as soon as the top
join node has produced 10 rows.  In fact I'd say the whole problem here
is that the planner is being too optimistic about the benefits of a
fast-start plan.  For whatever reason (most likely, an unfavorable
correlation between dock.target and dockscore_plp.total), the desired
rows aren't uniformly scattered in the output of the join, and so it's
taking longer than expected to find 10 of them.

            regards, tom lane

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

Предыдущее
От: Laura McCord
Дата:
Сообщение: Re: Having a problem with my stored procedure
Следующее
От: Tom Lane
Дата:
Сообщение: Re: suggestions on improving a query