Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2B7871337B5D for ; Tue, 22 Feb 2011 03:14:26 -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 47281-09 for ; Tue, 22 Feb 2011 07:14:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.catalyst.net.nz (bertrand.catalyst.net.nz [202.78.240.40]) by mail.postgresql.org (Postfix) with ESMTP id B59C41337990 for ; Tue, 22 Feb 2011 03:14:18 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.catalyst.net.nz (Postfix) with ESMTP id A1122320F8; Tue, 22 Feb 2011 20:14:16 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at catalyst.net.nz Received: from mail.catalyst.net.nz ([127.0.0.1]) by localhost (bertrand.catalyst.net.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FwAQxTZ3XO57; Tue, 22 Feb 2011 20:14:15 +1300 (NZDT) Received: from [192.168.1.11] (122-60-64-230.jetstream.xtra.co.nz [122.60.64.230]) (Authenticated sender: mark.kirkwood) by mail.catalyst.net.nz (Postfix) with ESMTPSA id 6936B3207C; Tue, 22 Feb 2011 20:14:15 +1300 (NZDT) Message-ID: <4D636247.600@catalyst.net.nz> Date: Tue, 22 Feb 2011 20:14:15 +1300 From: Mark Kirkwood User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Heikki Linnakangas CC: pgsql-bugs@postgresql.org Subject: Re: Hung Vacuum in 8.3 References: <4D6330E9.6030809@catalyst.net.nz> <4D635C1C.7040304@enterprisedb.com> In-Reply-To: <4D635C1C.7040304@enterprisedb.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.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/185 X-Sequence-Number: 29457 On 22/02/11 19:47, Heikki Linnakangas wrote: > > A long query on the same table can block vacuum. Vacuum needs to take > a so-called "cleanup lock" on each page, which means that it has to > wait until no other backend holds a pin on the page. A long-running > query can keep a page pinned for a long time. > Ah, - this is LockBufferForCleanup? So we are waiting for an exclusive LockBuffer operation i.e a LWLock not a (heavyweight) lock, urg... no wonder. To mitigate this I'm encouraging the use of a cleanup script for long running queries - since the app concerned is a web site, there is no call for queries that run this long (i.e way longer than the timeout for the respective page rendering). Thanks for the clarification (assuming I've understood correctly of course...). Cheers Mark