Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 12F6E9FBA2F for ; Thu, 7 Jun 2007 12:46:09 -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 26498-02 for ; Thu, 7 Jun 2007 12:46:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 4D3D69FB546 for ; Thu, 7 Jun 2007 12:46:01 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1HwKBP-0001ua-Um for pgsql-performance@postgresql.org; Thu, 07 Jun 2007 11:45:56 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 9A974404E; Thu, 7 Jun 2007 11:45:50 -0400 (EDT) Date: Thu, 7 Jun 2007 11:45:50 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: VERY slow queries at random Message-ID: <20070607154550.GF14087@phlogiston.dyndns.org> References: <46670916.9090505@gmail.com> <20070606195649.GG11545@phlogiston.dyndns.org> <466814B7.6000606@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <466814B7.6000606@gmail.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/132 X-Sequence-Number: 25165 On Thu, Jun 07, 2007 at 04:22:47PM +0200, Gunther Mayer wrote: > There are a whole bunch of update queries that fire all the time but > afaik none of them ever lock the entire table. To the best of my > knowledge UPDATE ... WHERE ... only locks those rows that it actually > operates on, in my case this is always a single row. Well that shouldn't be biting you, then (you're not in SERIALIZABLE mode, right?). The other obvious bit would be checkpoint storms. What's your bgwriter config like? > Question is, how do I find out about locks at the time when I only get > told about the slow query *after* it has completed and postgres has told > me so by logging a slow query entry in my logs? You can't :( A -- Andrew Sullivan | ajs@crankycanuck.ca This work was visionary and imaginative, and goes to show that visionary and imaginative work need not end up well. --Dennis Ritchie