Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 998F164FD0F for ; Tue, 28 Oct 2008 09:57:27 -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 39925-03 for ; Tue, 28 Oct 2008 09:57:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id 1B4D864FC56 for ; Tue, 28 Oct 2008 09:57:19 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id k40so245592ugc.7 for ; Tue, 28 Oct 2008 05:57:17 -0700 (PDT) Received: by 10.67.30.4 with SMTP id h4mr2934082ugj.11.1225198637299; Tue, 28 Oct 2008 05:57:17 -0700 (PDT) Received: from ?88.195.116.231? (dsl-hkibrasgw2-ff74c300-231.dhcp.inet.fi [88.195.116.231]) by mx.google.com with ESMTPS id f6sm8213986nfh.12.2008.10.28.05.57.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 28 Oct 2008 05:57:16 -0700 (PDT) Message-ID: <49070C29.9090508@enterprisedb.com> Date: Tue, 28 Oct 2008 14:57:13 +0200 Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Simon Riggs CC: PostgreSQL-development Subject: Re: Visibility map, partial vacuums References: <4905AE17.7090305@enterprisedb.com> <1225193108.3971.154.camel@ebony.2ndQuadrant> In-Reply-To: <1225193108.3971.154.camel@ebony.2ndQuadrant> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Heikki Linnakangas 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/1398 X-Sequence-Number: 126415 Simon Riggs wrote: > On Mon, 2008-10-27 at 14:03 +0200, Heikki Linnakangas wrote: >> One option would be to just ignore that problem for now, and not >> WAL-log. > > Probably worth skipping for now, since it will cause patch conflicts if > you do. Are there any other interactions with Hot Standby? > > But it seems like we can sneak in an extra flag on a HEAP2_CLEAN record > to say "page is now all visible", without too much work. Hmm. Even if a tuple is visible to everyone on the master, it's not necessarily yet visible to all the read-only transactions in the slave. > Does the PD_ALL_VISIBLE flag need to be set at the same time as updating > the VM? Surely heapgetpage() could do a ConditionalLockBuffer exclusive > to set the block flag (unlogged), but just not update VM. Separating the > two concepts should allow the visibility check speed gain to more > generally available. Yes, that should be possible in theory. There's no version of ConditionalLockBuffer() for conditionally upgrading a shared lock to exclusive, but it should be possible in theory. I'm not sure if it would be safe to set the PD_ALL_VISIBLE_FLAG while holding just a shared lock, though. If it is, then we could do just that. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com