Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 2EF71632899 for ; Fri, 5 Feb 2010 08:36:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 54812-01 for ; Fri, 5 Feb 2010 12:35:57 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f177.google.com (mail-ew0-f177.google.com [209.85.219.177]) by mail.postgresql.org (Postfix) with ESMTP id 3B14363270E for ; Fri, 5 Feb 2010 08:36:04 -0400 (AST) Received: by ewy25 with SMTP id 25so903611ewy.14 for ; Fri, 05 Feb 2010 04:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=B3kFGNeucZpTBTar6Lf5WTuhF80WcHK6Bl2bWKWbNso=; b=dcUD+3iqhFc8TO/48lLnSqI1gHVySMUpmevhA0nUaxqo+zX9GxuGntPGF1w+DVHC0c 0mq1H+zao1K4/7T/hlkInsrh5ooahm6nuzLZFpWdBE1eoWOaC6uW3YTkkwL4sBz4YIwZ guBAIz8qBj3yEMLpk26g+Cy7awm86SVx9ITbo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=u+02vXhaR8jXhOqt55oaR8LfSE4KeMlhyTpEw6eGS++75s2A0oSo7AZf/FW23wevNl NpjmzAv6D+sH1uxIwKHukY7c47Bp9yzKerO04MKsEuCxK51DlEgB9GrVjjQl20kT7CHx qVXDQLPQgiy2NUYpWUSnAGzIUkyA5PNRBA2dQ= Received: by 10.213.64.74 with SMTP id d10mr547579ebi.7.1265373361608; Fri, 05 Feb 2010 04:36:01 -0800 (PST) Received: from ?0.0.0.0? (5357DA75.cable.casema.nl [83.87.218.117]) by mx.google.com with ESMTPS id 28sm164114eyg.12.2010.02.05.04.36.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Feb 2010 04:36:01 -0800 (PST) Message-ID: <4B6C10BA.8050003@gmail.com> Date: Fri, 05 Feb 2010 13:36:10 +0100 From: Yeb Havinga User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Ibrahim Harrani CC: pgsql-admin@postgresql.org Subject: Re: vacuum deadlock References: <530068a1002050143n26ee05c6hda0de69f5ed97a9d@mail.gmail.com> In-Reply-To: <530068a1002050143n26ee05c6hda0de69f5ed97a9d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.545 tagged_above=-10 required=5 tests=AWL=-0.435, BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 201002/49 X-Sequence-Number: 33652 Ibrahim Harrani wrote: > Hi, > > I am using PostgreSQL 8.3.7. > autovacuum is enabled in postgresql.conf > > I got a deadlock while vacuuming all databases with vacuumdb command. > > vacuumdb: vacuuming of database "mydb" failed: ERROR: deadlock detected > DETAIL: Process 1294 waits for AccessExclusiveLock on relation 2662 > of database ; blocked by process 1807. > Process 1807 waits for AccessShareLock on relation 1259 of database > 16389; blocked by process 1294. > > I think, because of this lock, deleting a large table (15 million > records) was taking too much time > How can I know the name of the relations 2662 and 1259? postgres=# select oid,relname from pg_class where oid in (2662,1259); oid | relname ------+-------------------- 2662 | pg_class_oid_index 1259 | pg_class (2 rows) > Do you have any ide about the problem and solution? It would be interesting to know what are the processes 1807 and 1294. Once that is known, try to avoid executing both processes concurrently. regards Yeb Havinga