Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 66FE61337B60 for ; Tue, 21 Sep 2010 11:35:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 56066-03 for ; Tue, 21 Sep 2010 14:35:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.ringways.co.uk (hub.ringways.co.uk [77.86.27.30]) by mail.postgresql.org (Postfix) with ESMTP id 17E5F1337B63 for ; Tue, 21 Sep 2010 11:35:26 -0300 (ADT) Received: from eddie.ringways.co.uk ([10.1.1.115]) by mail.ringways.co.uk with esmtp (Exim 4.69) (envelope-from ) id 1Oy3wH-00026g-Nf for pgsql-sql@postgresql.org; Tue, 21 Sep 2010 15:35:23 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: postgres list Subject: Re: Slow response in select Date: Tue, 21 Sep 2010 15:35:24 +0100 User-Agent: KMail/1.9.10 References: <201009211325.55493.gary.stainburn@ringways.co.uk> <4C98BCFD.10202@postnewspapers.com.au> <201009211520.15903.gary.stainburn@ringways.co.uk> In-Reply-To: <201009211520.15903.gary.stainburn@ringways.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201009211535.24925.gary.stainburn@ringways.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-5 required=5 tests=BAYES_40=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/66 X-Sequence-Number: 34597 On Tuesday 21 September 2010 15:20:15 Gary Stainburn wrote: > > I've posted th explain analyze at > > http://www1.ringways.co.uk/explain_analyse.txt > > I've marked a line with a sort in that appears to be the bit that's taking > the time. Am I right? > I've had a look at this, and I can't even see why the sort is happeing. There are no order by clauses and only one group by clause in the sub-select. This group by only works on a very small dataset though. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000