Re: SORT performance - slow? - Mailing list pgsql-performance

From Tomas Vondra
Subject Re: SORT performance - slow?
Date
Msg-id 4DD9982C.6000807@fuzzy.cz
Whole thread Raw
In response to SORT performance - slow?  ("Strange, John W" <john.w.strange@jpmchase.com>)
Responses Re: SORT performance - slow?  (Maciek Sakrejda <msakrejda@truviso.com>)
List 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

pgsql-performance by date:

Previous
From: Robert Klemme
Date:
Subject: Re: Pushing LIMIT into sub-queries of a UNION ALL?
Next
From: Aren Cambre
Date:
Subject: Re: Postgres refusing to use >1 core