Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 442961337BCD for ; Fri, 25 Mar 2011 12:17:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 00227-05 for ; Fri, 25 Mar 2011 15:17:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B8BE51337B96 for ; Fri, 25 Mar 2011 12:17:21 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p2PFHJ1e004346; Fri, 25 Mar 2011 11:17:19 -0400 (EDT) To: "Maxim Boguk" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5946: Long exclusive lock taken by vacuum (not full) In-reply-to: <201103250856.p2P8ufGc004544@wwwmaster.postgresql.org> References: <201103250856.p2P8ufGc004544@wwwmaster.postgresql.org> Comments: In-reply-to "Maxim Boguk" message dated "Fri, 25 Mar 2011 08:56:41 +0000" Date: Fri, 25 Mar 2011 11:17:19 -0400 Message-ID: <4345.1301066239@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/330 X-Sequence-Number: 29840 "Maxim Boguk" writes: > In my case vacuum tried to truncate last 10-15GB from 100Gb relation, and > each time (3) it was cost 10+ minutes of service downtime (because that > table was completely locked). > Is that correct behaviour? Are here any way to speedup that process or at > least allow read-only queries during that time? Use autovacuum --- if there's something that wants to access the table, autovac will get kicked off the lock. (Of course, the table may never get truncated then, but maybe you don't care.) regards, tom lane