Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 761D264FF8A for ; Tue, 28 Oct 2008 15:08:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 38760-05-5 for ; Tue, 28 Oct 2008 15:07:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137092.authsmtp.com (outmail137092.authsmtp.com [62.13.137.92]) by postgresql.org (Postfix) with ESMTP id 76374650094 for ; Tue, 28 Oct 2008 15:07:55 -0300 (ADT) Received: from mail-c189.authsmtp.com (mail-c189.authsmtp.com [62.13.128.71]) by punt4.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m9SI7LST081411; Tue, 28 Oct 2008 18:07:21 GMT Received: from [192.168.0.3] (85-211-99-122.dyn.gotadsl.co.uk [85.211.99.122]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id m9SI7IRQ075390; Tue, 28 Oct 2008 18:07:19 GMT Subject: Re: Visibility map, partial vacuums From: Simon Riggs To: Tom Lane Cc: Heikki Linnakangas , PostgreSQL-development In-Reply-To: <9966.1225216692@sss.pgh.pa.us> References: <4905AE17.7090305@enterprisedb.com> <1225213395.3971.217.camel@ebony.2ndQuadrant> <9966.1225216692@sss.pgh.pa.us> Content-Type: text/plain Date: Tue, 28 Oct 2008 18:07:17 +0000 Message-Id: <1225217237.3971.225.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 43710812-a51b-11dd-bc7a-001f29070be2 X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFag1bYlpF HGQLW1xEUVV7WWR/ aQofZQBDYEtPQQxj TklLQE1QEQdtHhxP Wxd9Kx4LFWRGf3tz bEYsX3VZWAp+dkF8 QkZVF3BXYGYydWEe BBRFJVBTIR5Kfh4T aFl/U3NfNGdJBC9q VzwTFhsSEA9kHWxr QxoMJ1MWQFoaVjs1 X1RKBTw1AUwMQ20t Jhc7N1sHdDg2 X-Authentic-SMTP: 61633235383639.kestrel.dmpriest.net.uk:1378/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/1435 X-Sequence-Number: 126452 On Tue, 2008-10-28 at 13:58 -0400, Tom Lane wrote: > Simon Riggs writes: > > On Mon, 2008-10-27 at 14:03 +0200, Heikki Linnakangas wrote: > >> Lazy VACUUM only needs to visit pages that are '0' in the visibility > >> map. This allows partial vacuums, where we only need to scan those parts > >> of the table that need vacuuming, plus all indexes. > > > Just realised that this means we still have to visit each block of a > > btree index with a cleanup lock. > > Yes, and your proposal cannot fix that. Read "The Deletion Algorithm" > in nbtree/README, particularly the second paragraph. Yes, understood. Please read the algorithm again. It does guarantee that each block in the index has been checked to see if nobody is pinning it, it just avoids performing I/O to prove that. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support