Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 387431337B64 for ; Tue, 4 Jan 2011 21:52:03 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 13777-08 for ; Wed, 5 Jan 2011 01:51:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.postgresql.org (Postfix) with ESMTP id CE2341337B4A for ; Tue, 4 Jan 2011 21:51:55 -0400 (AST) Received: from [192.168.1.6] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MaDyS-1Pu1Hj1ihs-00Jvgi; Wed, 05 Jan 2011 02:51:52 +0100 Message-ID: <4D23CEB5.2090406@2ndquadrant.com> Date: Tue, 04 Jan 2011 20:51:49 -0500 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Kevin Grittner CC: fernando.mertins@gmail.com, pgsql-performance@postgresql.org Subject: Re: Same stament sometime fast, something slow References: <4D230EBD0200002500038FBB@gw.wicourts.gov> In-Reply-To: <4D230EBD0200002500038FBB@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:I7HSeH2X58xa5Xf+riPj5lLI1LHcaOvxlmch0utM7U8 fx2BZEnGZAncpWBW5WxpvypkaIxOYfJYKgsD+lQDvH3k9ySVG2 NbT4k1/thMvD6Ikp/u9QuQnTj9TVdbuWn7BDZ06mWR8EtnrgQb +5KrkC1VuGjusJlpLVyh58k7ki0oN+xK1zQEz02YHQdsc1vZnW xISloLFU8C69VVSJHgaDV0ajSULJw81l9nb7Dj+J4Q= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201101/19 X-Sequence-Number: 41806 Kevin Grittner wrote: > Two common causes for this are blocking and overloading the I/O > system at checkpoint. You might want to turn on logging of > checkpoints to see if this happens only during checkpoints. See this > page for techniques to look at blocking: > > http://wiki.postgresql.org/wiki/Lock_Monitoring > I just updated this to mention use of log_lock_waits to help here. Looking for patterns in log_min_duration_statement, log_checkpoints, and log_lock_waits entries, seeing which tend to happen at the same time, is the usual helpful trio to investigate when having intermittent slow queries. Of course, with Windows running on a VM, there's a hundred other things that could be causing this completely unrelated to the database. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services and Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books