Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 951329FB5B8 for ; Wed, 16 May 2007 11:00:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 88950-02 for ; Wed, 16 May 2007 11:00:07 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by postgresql.org (Postfix) with ESMTP id 7EB189FB38A for ; Wed, 16 May 2007 11:00:07 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id d17so38870and for ; Wed, 16 May 2007 07:00:06 -0700 (PDT) DKIM-Signature: a=rsa-sha1; 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:sender; b=b7+jJI889LlcW1YkqHhFHCOZBux5Ki/jN7GX/mWGGjHQdyQvzTNWiYT3YkQY+iEd+IJcj1NZcJYIwXW8S3nZEt3Y8pTs0i6mHO93xoPTGSc9XBoIhNq2C6HCjvApECxbT/TFsanXDwai4GBwJT1CHg/Z/aUZXjQ3fS4Gd/GfyDg= 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:sender; b=ZIxTa0X2LLumUgN1jiHHVNXfz6+WPSbpH/lKzfyoG6m6b6NSNypZiRJfbzY7vLyiG72Erm41nHTOOsKpLHxYVmJvn389s8UIyleo7jLlYMJ1P/H6+2/kVHOgWmVVkWLtc1Ie9WitMkeHbqHYrSB9JImFA2Z6tMHjP7nRYqW77Ng= Received: by 10.101.14.16 with SMTP id r16mr6108030ani.1179324006143; Wed, 16 May 2007 07:00:06 -0700 (PDT) Received: from ?172.24.32.118? ( [62.232.55.118]) by mx.google.com with ESMTP id c38sm1343295anc.2007.05.16.07.00.02; Wed, 16 May 2007 07:00:03 -0700 (PDT) Message-ID: <464B0E5A.1070807@enterprisedb.com> Date: Wed, 16 May 2007 14:59:54 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Alvaro Herrera CC: Tom Lane , Chris Browne , pgsql-patches@postgresql.org Subject: Re: [DOCS] Autovacuum and XID wraparound References: <20070514011740.GH14860@fetter.org> <23394.1179108400@sss.pgh.pa.us> <1179117269.6047.3.camel@goldbach> <60sl9z6tln.fsf@dba2.int.libertyrms.com> <20070514221619.GC8916@alvh.no-ip.org> <857.1179184222@sss.pgh.pa.us> <20070515221347.GT12731@alvh.no-ip.org> <23362.1179292856@sss.pgh.pa.us> <20070516124420.GA4582@alvh.no-ip.org> In-Reply-To: <20070516124420.GA4582@alvh.no-ip.org> Content-Type: multipart/mixed; boundary="------------070408090401080201050605" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/234 X-Sequence-Number: 2334 This is a multi-part message in MIME format. --------------070408090401080201050605 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Alvaro Herrera wrote: > However, given that Heikki just confirmed that CLUSTER does not freeze > tuples, it's not really possible to do this, so I'll drop the CLUSTER > patch for now. > > This means that people using CLUSTER to compact tables won't have the > benefit of advancing relfrozenxid, so they will have to run VACUUM on > those tables at some point anyway, even though there will be no dead > tuples :-( Now that I think this a bit more, I think CLUSTER should freeze the tuples. I was worried about losing valuable debug information by doing that, but thinking a bit more that's not a big concern: we wouldn't freeze tuples newer than recent xmin. The update chain logic is the most risky part of the code, and we wouldn't lose the xmin and xmax of tuples that are part of update chains. Patch attached. You'll need the changes to cluster.c to set the relfrozenid as well. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com --------------070408090401080201050605 Content-Type: text/x-diff; name="cluster-freeze.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cluster-freeze.patch" Index: src/backend/access/heap/rewriteheap.c =================================================================== RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/access/heap/rewriteheap.c,v retrieving revision 1.3 diff -c -r1.3 rewriteheap.c *** src/backend/access/heap/rewriteheap.c 17 Apr 2007 21:29:31 -0000 1.3 --- src/backend/access/heap/rewriteheap.c 16 May 2007 13:42:23 -0000 *************** *** 538,543 **** --- 538,545 ---- OffsetNumber newoff; HeapTuple heaptup; + heap_freeze_tuple(tup->t_data, state->rs_oldest_xmin, NULL); + /* * If the new tuple is too big for storage or contains already toasted * out-of-line attributes from some other relation, invoke the toaster. --------------070408090401080201050605--