Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZxna-0007fD-A3 for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Mar 2022 16:37:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nZxnY-0002Li-CQ for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Mar 2022 16:37:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZxnY-0002LZ-3F for pgsql-hackers@lists.postgresql.org; Thu, 31 Mar 2022 16:37:24 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZxnR-0006y3-UN for pgsql-hackers@lists.postgresql.org; Thu, 31 Mar 2022 16:37:23 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B54325C01CC; Thu, 31 Mar 2022 12:37:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 31 Mar 2022 12:37:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=DCXdBssxEexnIJ1K+701gwEL4SMtE2q2eTzvro 0CoG0=; b=iXHzCyYln2SLWX8I4xP393SBGlNNiljqaBu7BkWqIFGA/wFzhi6qZc ea+6c8f4RgUuznu6mhjS03qh7ue8zPOKzMoWr4Hpm/0d9ziqF80AkmBFOqrIv7xT uX53HoEvvXKjmpKZA1fG2dPomnWMRt/dduVx+d5Lp7m/BKkMZOS8vf2MZF05TRjc iXz6ZEOXtEZ8Zq4IC3Jmw74Gyb1F45AZOurfl3RtVE9lARXsveYMBVGOrvY7vCcw /nmQQHExOxGeVJPpcPWs2yRR2u//rDOz5flOWly7LNduoa8ckMz7bvL/PUtIuLjO NVaJDD/cuGzj8TlosClc0vCLV2w9Rslg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=DCXdBssxEexnIJ1K+ 701gwEL4SMtE2q2eTzvro0CoG0=; b=buOem2omK9nFP+0cnHW5yFcfh9JeAoiC5 dVUFBe6ZfELJbcaMe26xX+fK4vzgQIoeLFx8XKjSuOrql/tb49dxSTm31osbhDL/ 2EVBno6p+S/JnjGNCB6H7kSJARzU8sipaawqXPQax4q93uACrHgXS/jN0Y2OrOAt rvspLcF7iqlC4ovsumrvJAhKIzTvxoEzSeyrhjW9QiP+c5ZJsRabd1Mc1oHPnE5Q miJldffJhBXX+gGn5Pu66id85eVUnOyzHyGxRBky3nSmGeB6kT4oy/6qJhosbA/2 bzfIogKVBVOrXqaxlx27cMFt5ywNQViEfZ5saVyYwjBU5JjGm4/Ew== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeff hfeuffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Mar 2022 12:37:16 -0400 (EDT) Date: Thu, 31 Mar 2022 09:37:15 -0700 From: Andres Freund To: Peter Geoghegan Cc: Justin Pryzby , Robert Haas , Thomas Munro , Masahiko Sawada , PostgreSQL Hackers Subject: Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations Message-ID: <20220331163715.6tsbbk6axjakglow@alap3.anarazel.de> References: <20220331020018.qht46hbua4gztmdf@alap3.anarazel.de> <20220331032844.j7wu5ijjpx3qay5c@alap3.anarazel.de> <20220331040407.ole7orep6sj4iore@alap3.anarazel.de> <20220331042038.udnydrj4x45i4khb@alap3.anarazel.de> <20220331045915.srhbzkajlmptclhz@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331045915.srhbzkajlmptclhz@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-03-30 21:59:15 -0700, Andres Freund wrote: > On 2022-03-30 21:29:16 -0700, Peter Geoghegan wrote: > > On Wed, Mar 30, 2022 at 9:20 PM Andres Freund wrote: > > > Perhaps we should just fetch the horizons from the "local" catalog for shared > > > rels? > > > > Not sure what you mean. > > Basically, instead of relying on the relcache, which for shared relation is > vulnerable to seeing "too new" horizons due to the shared relcache init file, > explicitly load relfrozenxid / relminmxid from the the catalog / syscache. > > I.e. fetch the relevant pg_class row in heap_vacuum_rel() (using > SearchSysCache[Copy1](RELID)). And use that to set vacrel->relfrozenxid > etc. Whereas right now we only fetch the pg_class row in > vac_update_relstats(), but use the relcache before. Perhaps we should explicitly mask out parts of relcache entries in the shared init file that we know to be unreliable. I.e. set relfrozenxid, relminmxid to Invalid* or such. I even wonder if we should just generally move those out of the fields we have in the relcache, not just for shared rels loaded from the init fork. Presumably by just moving them into the CATALOG_VARLEN ifdef. The only place that appears to access rd_rel->relfrozenxid outside of DDL is heap_abort_speculative(). Greetings, Andres Freund