Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EE8CD2E0060 for ; Tue, 25 Mar 2008 06:08:31 -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 66919-07 for ; Tue, 25 Mar 2008 06:08:26 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from depesz.com (depesz.com [88.198.37.40]) by postgresql.org (Postfix) with ESMTP id 324192E007E for ; Tue, 25 Mar 2008 06:08:26 -0300 (ADT) Received: from depesz by depesz.com with local (Exim 4.63) (envelope-from ) id 1Je58p-0001e3-5f; Tue, 25 Mar 2008 10:08:23 +0100 Date: Tue, 25 Mar 2008 10:08:23 +0100 From: hubert depesz lubaczewski To: sathiya psql Cc: pgsql-performance@postgresql.org Subject: Re: postgresql is slow with larger table even it is in RAM Message-ID: <20080325090823.GA5431@depesz.com> Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/460 X-Sequence-Number: 29414 On Tue, Mar 25, 2008 at 02:05:20PM +0530, sathiya psql wrote: > Any Idea on this ??? yes. dont use count(*). if you want whole-table row count, use triggers to store the count. it will be slow. regeardless of whether it's in ram or on hdd. depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV!" :) http://www.depesz.com/ - blog dla ciebie (i moje CV)