Re: SORT performance - slow?
От | Tomas Vondra |
---|---|
Тема | Re: SORT performance - slow? |
Дата | |
Msg-id | 4DDA9FEB.7020001@fuzzy.cz обсуждение исходный текст |
Ответ на | Re: SORT performance - slow? (Maciek Sakrejda <msakrejda@truviso.com>) |
Список | pgsql-performance |
Dne 23.5.2011 19:01, Maciek Sakrejda napsal(a): >> You're probably reading it wrong. The sort itself takes about 1 ms (just >> subtract the numbers in "actual="). > > I thought it was cost=startup_cost..total_cost. That is not quite the > same thing, since startup_cost is effectively "cost to produce first > row", and Sort can't really operate in a "streaming" fashion (well, > theoretically, something like selection sort could, but that's beside > the point) so it needs to do all the work up front. I'm no explain > expert, so someone please correct me if I'm wrong. Good point, thanks. In that case the second number (2.3 sec) is correct. I still think the problem is not the sorting but the inaccurate estimates - fixing this might yield a much better / faster plan. But the OP posted just a small part of the plan, so it's hard to guess. regards Tomas
В списке pgsql-performance по дате отправления: