Re: SORT performance - slow?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Maciek Sakrejda <msakrejda(at)truviso(dot)com>
Cc: Tomas Vondra <tv(at)fuzzy(dot)cz>, pgsql-performance(at)postgresql(dot)org
Subject: Re: SORT performance - slow?
Date: 2011-05-23 17:27:13
Message-ID: BANLkTi=GYb1adpUyoGSJVKj13dmEw9wz1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, May 23, 2011 at 1:01 PM, Maciek Sakrejda <msakrejda(at)truviso(dot)com> wrote:
>> 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.

You are right.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tomas Vondra 2011-05-23 17:56:59 Re: SORT performance - slow?
Previous Message Robert Haas 2011-05-23 17:21:17 Re: Pushing LIMIT into sub-queries of a UNION ALL