Re: SORT performance - slow?

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: SORT performance - slow?
Date: 2011-05-22 23:11:40
Message-ID: 4DD9982C.6000807@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dne 19.5.2011 23:13, Strange, John W napsal(a):
> Am I reading this right in that the sort is taking almost 8 seconds?

You're probably reading it wrong. The sort itself takes about 1 ms (just
subtract the numbers in "actual="). If you include all the overhead it
takes about 2.3 seconds (the hash join ends at 12 sec, the sort at 14.3).

Anyway, your real problem is probably stale stats. Run ANALYZE on the
tables referenced in the query, the estimates are very off. All the rows
expect 1 row but are getting 315k of them.

regards
Tomas

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Aren Cambre 2011-05-23 04:09:49 Re: Postgres refusing to use >1 core
Previous Message Robert Klemme 2011-05-22 17:34:23 Re: Pushing LIMIT into sub-queries of a UNION ALL?