Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 6754D9FB7A6 for ; Thu, 7 Jun 2007 11:23:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 69230-03 for ; Thu, 7 Jun 2007 11:22:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 2FB6E9FB58C for ; Thu, 7 Jun 2007 11:22:59 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id u2so760483uge for ; Thu, 07 Jun 2007 07:22:58 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=mM5zx0yYWdNy4Vn2SPT2Q+8IWz8s1LU4y8pMYEvyZy/JyiYTjkC5r5iHumJ2891pvhXdEZjNYr/o57V/MYnp9VqbuQbhnXOJe+KIkzlyrjn7Nptcrhicijg+qot92Zaq2ITjSztQW+5LOA64d9elt9rzgp+vgB96rPdL+cmdPgE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:from; b=IsPDJOY+ryzPHRAIoyOWzS3ADPGu2QNYRRlIYhKyNB1xiGmg6LNc/WBrYR0nGHDEa7JSeyEdJdIijgQGzvKZpPxsmWQJYLOgYrHCsV5EVMA3iazBSwSd/pwf+MTPz+wNyPsRtdVvDDVJIBOYoXcPpR06A4cdXV5HJ850MKIpU0A= Received: by 10.66.225.1 with SMTP id x1mr2081347ugg.1181226178142; Thu, 07 Jun 2007 07:22:58 -0700 (PDT) Received: from ?172.25.0.43? ( [196.7.14.186]) by mx.google.com with ESMTP id j1sm3225131ugf.2007.06.07.07.22.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 07 Jun 2007 07:22:57 -0700 (PDT) Message-ID: <466814B7.6000606@gmail.com> Date: Thu, 07 Jun 2007 16:22:47 +0200 User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: VERY slow queries at random References: <46670916.9090505@gmail.com> <20070606195649.GG11545@phlogiston.dyndns.org> In-Reply-To: <20070606195649.GG11545@phlogiston.dyndns.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Gunther Mayer X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/129 X-Sequence-Number: 25162 Andrew Sullivan wrote: > On Wed, Jun 06, 2007 at 09:20:54PM +0200, Gunther Mayer wrote: > >> What the heck could cause such erratic behaviour? I suspect some type of >> resource problem but what and how could I dig deeper? >> > > Is something (perhaps implicitly) locking the table? That will cause > this. > 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. No explicit locking is done anywhere, but perhaps you're right and it is a locking issue. 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? Gunther