X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D41C6D1B4E5 for ; Tue, 16 Sep 2003 02:39:37 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 87640-05 for ; Mon, 15 Sep 2003 23:39:09 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id C927DD1B526 for ; Mon, 15 Sep 2003 23:39:05 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h8G2d5sn072901 for ; Tue, 16 Sep 2003 02:39:05 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h8G2SHnv071555 for pgsql-performance@postgresql.org; Tue, 16 Sep 2003 02:28:17 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: Inconsistent performance Date: Mon, 15 Sep 2003 22:26:45 -0400 Organization: cbbrowne Computing Inc Lines: 26 Message-ID: References: <5.1.0.14.2.20030915182422.00a8a2d8@mail.vetstar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org X-message-flag: Outlook is rather hackable, isn't it? X-Home-Page: http://www.cbbrowne.com/info/ X-Affero: http://svcs.affero.net/rm.php?r=cbbrowne User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:xSM3pT2iRyjRx5hC07zUdxr/GuM= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/230 X-Sequence-Number: 3596 The world rejoiced as jbove@vetstar.com (Joseph Bove) wrote: > Actually, it's inconsistent with the exact same command. I've now > replicated the problem by doing the following command: > > select count (*) from table; > > The table in question has 88899 rows. > > The response time is anywhere from 1 second to 12 seconds. Different > response times can occur in the same minute of testing! The only possible plan for THAT query will involve a seq scan of the whole table. If the postmaster already has the data in cache, it makes sense for it to run in 1 second. If it has to read it from disk, 12 seconds makes a lot of sense. You might want to increase the "shared_buffers" parameter in postgresql.conf; that should lead to increased stability of times as it should be more likely that the data in "table" will remain in cache. -- (reverse (concatenate 'string "gro.gultn" "@" "enworbbc")) http://www3.sympatico.ca/cbbrowne/x.html Signs of a Klingon Programmer - 8. "Debugging? Klingons do not debug. Our software does not coddle the weak. Bugs are good for building character in the user."