Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 051B42E0069 for ; Tue, 25 Mar 2008 12:21:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 84237-03 for ; Tue, 25 Mar 2008 12:21:53 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by postgresql.org (Postfix) with ESMTP id 8D99C2E003B for ; Tue, 25 Mar 2008 12:21:53 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.1/8.14.1) with ESMTP id m2PFLrlp015110 for ; Tue, 25 Mar 2008 12:21:53 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.1/8.14.1/Submit) id m2PF44HV009413 for pgsql-performance@postgresql.org; Tue, 25 Mar 2008 12:04:04 -0300 (ADT) (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.performance Subject: Re: postgresql is slow with larger table even it is in RAM Date: Tue, 25 Mar 2008 11:02:22 -0400 Organization: cbbrowne Computing Inc Lines: 29 Message-ID: <603aqe979d.fsf@dba2.int.libertyrms.com> References: <99f1636c0803250139g321329dbr7c640213e9132583@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.21 (linux) Cancel-Lock: sha1:64YKuoY7MbA7Xg9oveL6aI+prJE= To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/480 X-Sequence-Number: 29434 sathiya.psql@gmail.com ("sathiya psql") writes: > On Tue, Mar 25, 2008 at 2:09 PM, jose javier parra sanchez wrote: > > > It's been said zillions of times on the maillist. Using a select > count(*) in postgres is slow, and probably will be slow for a long > time. So that function is not a good way to measure perfomance. > > > > Yes, but if the data is in HDD then we can say this... > but now the data is in RAM Even if the data all is in RAM, it will still take some definitely non-zero time to examine all of the pages, looking for tuples, and then to determine which of those tuples are visible from the perspective of your DB connection. If 500MB of relevant data is sitting on disk, then it will take whatever time it takes to pull it from disk; if it is in memory, there is still work to be done... -- select 'cbbrowne' || '@' || 'cbbrowne.com'; http://linuxdatabases.info/info/finances.html Rules of the Evil Overlord #76. "If the hero runs up to my roof, I will not run up after him and struggle with him in an attempt to push him over the edge. I will also not engage him at the edge of a cliff. (In the middle of a rope-bridge over a river of molten lava is not even worth considering.)"