Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9F3A26356CA for ; Tue, 13 Apr 2010 15:09:42 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 21392-02 for ; Tue, 13 Apr 2010 18:09:32 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 27.mail-out.ovh.net (27.mail-out.ovh.net [91.121.30.210]) by mail.postgresql.org (Postfix) with SMTP id B4E4463333A for ; Tue, 13 Apr 2010 15:09:31 -0300 (ADT) Received: (qmail 8518 invoked by uid 503); 13 Apr 2010 18:14:12 -0000 Received: from b9.ovh.net (HELO mail629.ha.ovh.net) (213.186.33.59) by 27.mail-out.ovh.net with SMTP; 13 Apr 2010 18:14:12 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 13 Apr 2010 18:09:32 -0000 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO immo.peufeu.com) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 13 Apr 2010 18:09:32 -0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Sabin Coanda" , pgsql-performance@postgresql.org Subject: Re: count is ten times faster References: Date: Tue, 13 Apr 2010 20:09:27 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.10 (Linux) X-Ovh-Tracer-Id: 12924205032567080558 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-10 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201004/167 X-Sequence-Number: 38417 > How do you explain the cost is about ten times lower in the 2nd query > than the first ? Function call cost ? Can you EXPLAIN ANALYZE ?