pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tv@fuzzy.cz>
To: pgsql-performance@postgresql.org
Subject: Re: SORT performance - slow?
Date: Mon, 23 May 2011 01:11:40 +0200
Message-ID: <4DD9982C.6000807@fuzzy.cz> (raw)
In-Reply-To: <EF37296944B47C40ADDCCB7BFD6289FE04ECC9CA3F@EMASC201VS01.exchad.jpmchase.net>
References: <EF37296944B47C40ADDCCB7BFD6289FE04ECC9CA3F@EMASC201VS01.exchad.jpmchase.net>

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



view thread (7+ messages)  latest in thread

Message-ID: <4DD9982C.6000807@fuzzy.cz>
Permalink:  ../4DD9982C.6000807@fuzzy.cz/
Also on:    postgresql.org/message-id/4DD9982C.6000807@fuzzy.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz
  Subject: Re: SORT performance - slow?
  In-Reply-To: <4DD9982C.6000807@fuzzy.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox