Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 023889FB276 for ; Fri, 28 Sep 2007 16:32:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 25170-01 for ; Fri, 28 Sep 2007 16:32:27 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by postgresql.org (Postfix) with ESMTP id 7CBBE9FA348 for ; Fri, 28 Sep 2007 16:32:29 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id j3so1633045ugf for ; Fri, 28 Sep 2007 12:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; 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:sender; bh=IXcddT9QxIHn+pW3r2sKX3vDYKrfSef2V57BRS2VrnI=; b=D954RcujrSOaIPJ3a0gpbARofyDZdoNh6slzhwtcr6Dvi61HYDCEw/dORJczuyfcr258sQeeO2dqcHTG/bzc+kZx8Qku5ZpFY2t2exwYInc9bHh+Ay+MXmsDmLttLptR6TsXScBozzfzXkVyyYZXACpIBYeCxw+DI8dnk2a/f/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=AXyQtqJ/mVjSwfNXxbFlr8O1lFxoNG/j6ECmOwNCKBMt92/loyiGo0x4fxvn6sYnB6jr3gGnW5NtOxkI4YhtnF11KjDm3aYATNU7TZCuYnEuaSbpvWjFgnW9Dxds2WxB/3t2YcDxq1Fg2VMKlmLkp5H/L33KOFTkyx4rh1wfvPg= Received: by 10.66.220.17 with SMTP id s17mr5481532ugg.1191007947605; Fri, 28 Sep 2007 12:32:27 -0700 (PDT) Received: from ?192.168.1.34? ( [82.20.28.62]) by mx.google.com with ESMTPS id 40sm3210135uge.2007.09.28.12.32.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 Sep 2007 12:32:26 -0700 (PDT) Message-ID: <46FD5695.6000302@enterprisedb.com> Date: Fri, 28 Sep 2007 20:31:33 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: Peter Schuller CC: pgsql-performance@postgresql.org Subject: Re: Non-blocking vacuum full References: <20070928180649.GA6579@hyperion.scode.org> In-Reply-To: <20070928180649.GA6579@hyperion.scode.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/474 X-Sequence-Number: 27019 Peter Schuller wrote: > I have only looked very very briefly at the PG code so I don't know > how far fetched it is, but my thought was that it should be possible > to have a slow background process (similar to normal non-full vacuums > nows) that would, instead of registering dead tuples in the FSM, move > live tuples around. What you've described is actually very close to VACUUM FULL. VACUUM FULL needs to take an exclusive lock to lock out concurrent scanners that might miss or see a tuple twice, when a live tuple is moved. That's the fundamental problem you need to solve. I think it's doable, if you take a copy of the tuple, and set the ctid pointer on the old one like an UPDATE, and wait until the old tuple is no longer visible to anyone before removing it. It does require some changes to tuple visibility code. For example, a transaction running in serializable mode shouldn't throw a serialization error when it tries to update an old, moved row version, but follow the ctid pointer instead. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com