Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4CBFA133616B for ; Tue, 21 Sep 2010 11:21:26 -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 33415-01 for ; Tue, 21 Sep 2010 14:21:18 +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 B9B62133729E for ; Tue, 21 Sep 2010 11:21:17 -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 1Oy3ia-0001sK-UJ for pgsql-sql@postgresql.org; Tue, 21 Sep 2010 15:21:14 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: postgres list Subject: Re: Slow response in select Date: Tue, 21 Sep 2010 15:20:15 +0100 User-Agent: KMail/1.9.10 References: <201009211325.55493.gary.stainburn@ringways.co.uk> <4C98BCFD.10202@postnewspapers.com.au> In-Reply-To: <4C98BCFD.10202@postnewspapers.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201009211520.15903.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_20=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/65 X-Sequence-Number: 34596 On Tuesday 21 September 2010 15:11:09 Craig Ringer wrote: > On 09/21/2010 08:25 PM, Gary Stainburn wrote: > > Hi folks,I have a view that seems to be very slow compared to similar > > views on the same server. > > > > I've had a look at running explain but I don't really understand it. > > > > I've posted the view and the output from explain at > > > > http://www1.ringways.co.uk/explain.txt > > Woah. That's an interesting plan. > > When concerned about execution time, it's probably best to post EXPLAIN > ANALYZE rather than plain EXPLAIN results. EXPLAIN ANALYZE provides more > timing information and information about how rowcount estimates differed > from reality. > > -- > Craig Ringer 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? Gary -- 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