Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 017582E005A for ; Tue, 25 Mar 2008 14:55:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 14633-02 for ; Tue, 25 Mar 2008 14:55:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from bunspace.com (mail.oss4u.com [64.142.76.151]) by postgresql.org (Postfix) with SMTP id CAF272E0042 for ; Tue, 25 Mar 2008 14:55:30 -0300 (ADT) Received: (qmail 15706 invoked by uid 453); 25 Mar 2008 17:55:29 -0000 X-Virus-Checked: Checked by ClamAV on bunspace.com Received: from tiburon.bunspace.com (HELO tiburon) (192.168.1.4) by bunspace.com (qpsmtpd/0.40) with ESMTP; Tue, 25 Mar 2008 10:55:29 -0700 From: "Uwe C. Schroeder" To: pgsql-admin@postgresql.org Subject: Re: postgresql is slow with larger table even it is in RAM Date: Tue, 25 Mar 2008 09:55:28 -0800 User-Agent: KMail/1.9.6 Cc: "sathiya psql" References: <20080325094147.40317ea2@twoflower.in.publishing.hu> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803251055.28593.uwe@oss4u.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/215 X-Sequence-Number: 28698 Can you provide the output of explain analyze select count(id) from table; ? Uwe On Tuesday 25 March 2008, sathiya psql wrote: > On Tue, Mar 25, 2008 at 2:11 PM, CZUCZY Gergely > > > wrote: > > May I ask, do you have any indeces or a primary key on that table? > > yes, i have both the index and primary key on a column "id", > and am doing the > > SELECT count(id) from TABLE; > > this is taking 3 seconds