X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 654629DCCF4 for ; Thu, 22 Dec 2005 23:53:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28509-06 for ; Thu, 22 Dec 2005 23:53:04 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from stark.xeocode.com (stark.xeocode.com [216.58.44.227]) by postgresql.org (Postfix) with ESMTP id 5BC239DCCBB for ; Thu, 22 Dec 2005 23:52:58 -0400 (AST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1EpdzD-0001fh-00; Thu, 22 Dec 2005 22:52:55 -0500 To: Harry Jackson Cc: pgsql-performance@postgresql.org Subject: Re: CPU and RAM References: <45b42ce40512211720t164ea389wa5bfd0cbae6c80e2@mail.gmail.com> In-Reply-To: <45b42ce40512211720t164ea389wa5bfd0cbae6c80e2@mail.gmail.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 22 Dec 2005 22:52:54 -0500 Message-ID: <878xuc8o6h.fsf@stark.xeocode.com> Lines: 26 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.11 required=5 tests=[AWL=0.110] X-Spam-Score: 0.11 X-Spam-Level: X-Archive-Number: 200512/576 X-Sequence-Number: 16397 Harry Jackson writes: > At the moment everything is working OK but I am noticing an almost > linear increase in time to retrieve data from the database as the data > set increases in size. Clustering knocks the access times down by 25% > but it also knocks users off the website and can take up to 30 minutes > which is hardly an ideal scenario. If the whole database is in RAM I wouldn't expect clustering to have any effect. Either you're doing a lot of merge joins or a few other cases where clustering might be helping you, or the cluster is helping you keep more of the database in ram avoiding the occasional disk i/o. That said, I would agree with the others to not assume the plans for every query is ok. It's easy when the entire database fits in RAM to be fooled into thinking plans are ok because they're running quite fast but in fact have problems. In particular, if you have a query doing a sequential scan of some moderately large table (say a few thousand rows) then you may find the query executes reasonably fast when tested on its own but consumes enough cpu and memory bandwidth that when it's executed frequently in an OLTP setting it pegs the cpu at 100%. -- greg