Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 77682133616B for ; Tue, 21 Sep 2010 11:11:45 -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 00139-09 for ; Tue, 21 Sep 2010 14:11:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.4.227.11]) by mail.postgresql.org (Postfix) with ESMTP id 244871337B48 for ; Tue, 21 Sep 2010 11:11:31 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id DB8497D0A0; Tue, 21 Sep 2010 22:11:28 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id DE055AE886; Tue, 21 Sep 2010 22:11:28 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZYrnlDQdXn80; Tue, 21 Sep 2010 22:11:23 +0800 (WST) Received: from [10.1.1.2] (124-148-245-78.dyn.iinet.net.au [124.148.245.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 91719AE87B; Tue, 21 Sep 2010 22:11:10 +0800 (WST) Message-ID: <4C98BCFD.10202@postnewspapers.com.au> Date: Tue, 21 Sep 2010 22:11:09 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Thunderbird/3.1.3 MIME-Version: 1.0 To: Gary Stainburn CC: postgres list Subject: Re: Slow response in select References: <201009211325.55493.gary.stainburn@ringways.co.uk> In-Reply-To: <201009211325.55493.gary.stainburn@ringways.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/64 X-Sequence-Number: 34595 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