Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9uQj-000500-Mc for pgsql-committers@arkaria.postgresql.org; Fri, 29 Mar 2019 16:32:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9uQi-00073n-2V for pgsql-committers@arkaria.postgresql.org; Fri, 29 Mar 2019 16:32:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9uQh-00073d-3c; Fri, 29 Mar 2019 16:32:31 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9uQf-00048E-2I; Fri, 29 Mar 2019 16:32:30 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B472521C60; Fri, 29 Mar 2019 12:32:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 29 Mar 2019 12:32:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=1bQao25cmtMTHF/RODmEnOpLrZM ogjORji25vCENk80=; b=hKsJ1Zwb1jJeEqeMkYfaHBKHD4p5cbq7TsAI9DZEiJy +xNuwmynXupLXZiUNdCGL347a6rfLLdHGBp/TiIUGHx2rP9EFqVEVYYvKqqY82GW 8cL1/qvrGi4IvrmCbLAYr9A5WCV0JB+r+SohTkbsgTtnhgcnhPpzj70Tkk2yuddc QolSrDpao1bDcEAU9QB9FJVKy8T7C0sA9eZBi/SISg9sc3rWuIdxU5JbxoSZR+wn Fvkj6dbO03Ru79uYKRCKJa4DtpfpTNkLU05bCI/ki9VYjzGbhyVQ8sLGeNxOeIUK 1v1I0rdYmVwIkI+aBIBADY8z4N4f/lqHON+L/pIr2xg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=1bQao2 5cmtMTHF/RODmEnOpLrZMogjORji25vCENk80=; b=au2EP3+H60JpHcUwBd4w3j MzVTTlPC6WcqqsjNYuFwsvACliOInnAafQSWF05z6YOB7g0dmNZb3y7e8hNJcX6c LotQIiChM6AJ2kxzxHh0U8WBzOXJL2WOsvmO2ZrpeU1ItbA+8bf41+0DZ74Ca2ym +KB5mLB07OuVXfzKJwlAnAc9VKdanZ9phWwLmwOi0wN7opgmxQ8EBC7pkhltZ8ve HdCnT2uYQLCBU/UmE6hUS8MyCKICAKBeTxCjWt5aAwxQFtNAmPw1Zj9BFGhQwR4q 589IshH9K52EtZYrY38btbnaFahFC5xeyuOvmd9fZaKPA9xQZbfzl1J4vNOdlqyw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrkeejgdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecukfhppedvtd ekrdehgedrgeegrddvtddvnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshes rghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (unknown [208.54.44.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 0EB39E46C1; Fri, 29 Mar 2019 12:32:27 -0400 (EDT) Date: Fri, 29 Mar 2019 09:32:25 -0700 From: Andres Freund To: Simon Riggs Cc: pgsql-committers , PostgreSQL Hackers Subject: Re: pgsql: Compute XID horizon for page level index vacuum on primary. Message-ID: <20190329163225.5edm2bpi34hwbgcq@alap3.anarazel.de> References: <20190329152906.356icmttz7yjgsyh@alap3.anarazel.de> <20190329161238.eyrmdtofbzmapvyv@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-03-29 16:20:54 +0000, Simon Riggs wrote: > On Fri, 29 Mar 2019 at 16:12, Andres Freund wrote: > > > > On 2019-03-29 15:58:14 +0000, Simon Riggs wrote: > > > On Fri, 29 Mar 2019 at 15:29, Andres Freund wrote: > > > > That's far from a trivial feature imo. It seems quite possible that > > we'd > > > > end up with increased overhead, because the current logic can get away > > > > with only doing hint bit style writes - but would that be true if we > > > > started actually replacing the item pointers? Because I don't see any > > > > guarantee they couldn't cross a page boundary etc? So I think we'd need > > > > to do WAL logging during index searches, which seems prohibitively > > > > expensive. > > > > > > > > > > Don't see that. > > > > > > I was talking about reusing the first 4 bytes of an index tuple's > > > ItemPointerData, > > > which is the first field of an index tuple. Index tuples are MAXALIGNed, > > so > > > I can't see how that would ever cross a page boundary. > > > > They're 8 bytes, and MAXALIGN often is 4 bytes: > > > > xids are 4 bytes, so we're good. I literally went on to explain why that's not sufficient? You can't *just* replace the block number with an xid. You *also* need to set a flag denoting that it's an xid and dead now. Which can't fit in the same 4 bytes. You either have to set it in the IndexTuple's t_info, or or in the ItemIdData's lp_flags. And both can be on a different sectors. If the flag persists, and the xid doesn't you're going to interpret a block number as an xid - not great; but even worse, if the xid survives, but the flag doesn't, you're going to access the xid as a block - definitely not ok, because you're going to return wrong results. Greetings, Andres Freund