Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8CAD06327BF for ; Mon, 26 Jul 2010 06:57:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 62569-10 for ; Mon, 26 Jul 2010 09:57:05 +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 1E18263239C for ; Mon, 26 Jul 2010 06:57:06 -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 5E4369F81; Mon, 26 Jul 2010 17:57:02 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 16662AE819; Mon, 26 Jul 2010 17:56:57 +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 mhVFQ2nBlozP; Mon, 26 Jul 2010 17:56:51 +0800 (WST) Received: from [10.1.1.6] (124-168-255-56.dyn.iinet.net.au [124.168.255.56]) (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 B3D90AE72A; Mon, 26 Jul 2010 17:56:51 +0800 (WST) Message-ID: <4C4D5BE9.6040808@postnewspapers.com.au> Date: Mon, 26 Jul 2010 17:56:57 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Vitalii Tymchyshyn CC: pgsql-performance@postgresql.org Subject: Re: Big difference in time returned by EXPLAIN ANALYZE SELECT ... AND SELECT ... References: <4C4D5220.9010101@postnewspapers.com.au> <4C4D547E.50905@gmail.com> In-Reply-To: <4C4D547E.50905@gmail.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/376 X-Sequence-Number: 39765 On 26/07/10 17:25, Vitalii Tymchyshyn wrote: > 26.07.10 12:15, Craig Ringer написав(ла): >> On 26/07/10 16:35, Piotr Gasidło wrote: >> >>> Hello, >>> >>> I've found strange problem in my database (8.4.4, but also 9.0beta3, >>> default postgresql.conf, shared_buffers raised to 256MB). >>> >>> EXPLAIN ANALYZE SELECT ... >>> Total runtime: 4.782 ms >>> Time: 25,970 ms >> Given that, I'm wondering if the difference in this case is planning >> time. I can't really imagine the query planner taking 20 seconds (!!) to >> run, though, no matter how horrifyingly complicated the query and table >> structure were, unless there was something going wrong. >> > Actually it's 20ms, so I suspect your point about planning time is correct. Oh, a commas-as-fraction-separator locale. That makes sense. Thanks for the catch. -- Craig Ringer