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 8FD96D1B8A4 for ; Thu, 28 Aug 2003 18:23:57 +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 69730-03 for ; Thu, 28 Aug 2003 15:23:48 -0300 (ADT) Received: from harrier.cohaesio.com (harrier.cohaesio.com [212.97.128.50]) by svr1.postgresql.org (Postfix) with ESMTP id C9758D1B8C5 for ; Thu, 28 Aug 2003 15:23:46 -0300 (ADT) Received: by harrier.cohaesio.com (Postfix, from userid 88) id 5224286; Thu, 28 Aug 2003 20:23:47 +0200 (CEST) X-Original-To: news2mail@news.cohaesio.com From: "Anders K. Pedersen" Subject: Re: Queries sometimes take 1000 times the normal time Date: Thu, 28 Aug 2003 20:23:46 +0200 Organization: Cohaesio A/S Lines: 36 Message-ID: References: <28672.1062027548@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: harrier.cohaesio.com 1062095026 10096 212.97.128.160 (28 Aug 2003 18:23:46 GMT) X-Complaints-To: newsmaster@news.cohaesio.com X-Accept-Language: da, en-us, en To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/432 X-Sequence-Number: 3248 Tom Lane wrote: > "Anders K. Pedersen" writes: > >>Currently there's only a few users in the database for testing purposes, >>and most of the time the user lookup's take 2-3 ms (I have syslog'ing of >>queries and duration turned on), but several times per hour the duration >>for one of the queries is 2-3 seconds (1000 times larger), while the >>surrounding lookups take the usual 2-3 ms. > > > One thing that comes to mind is that the slow query could be occurring > at the same time as a checkpoint, or some other cycle-chewing background > operation. It's not clear why a checkpoint would slow things down that > much, though. Anyway I'd suggest looking for such activities; once we > know if that's the issue or not, we can make some progress. One of my colleagues suggested looking for checkpoints as well; I searched the log, but only the following messages turned up: Aug 11 15:21:04 gs1 postgres[5447]: [2] LOG: checkpoint record is at 0/80193C Aug 23 13:59:51 gs1 postgres[16451]: [2] LOG: checkpoint record is at 0/201EB74 Aug 25 02:48:17 gs1 postgres[1059]: [2] LOG: checkpoint record is at 0/2B787D0 Currently there are only relatively few changes to the database - one INSERT everytime one of our game admins executes an administrative command (like ban or kick), and this happens at most 10 times per hour. As I understand checkpoints, this should mean, that they aren't happening very often, and when they do, should be able to finish almost immediately. Regards, Anders K. Pedersen