Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rV6wZ-00EuxA-Pv for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Jan 2024 09:31:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rV6wY-00CpEz-U4 for pgsql-hackers@arkaria.postgresql.org; Wed, 31 Jan 2024 09:31:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rV6wX-00CpEK-9R for pgsql-hackers@lists.postgresql.org; Wed, 31 Jan 2024 09:31:42 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rV6wT-004gVq-Kg for pgsql-hackers@lists.postgresql.org; Wed, 31 Jan 2024 09:31:40 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5D2DE5C00D0; Wed, 31 Jan 2024 04:31:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 31 Jan 2024 04:31:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1706693494; x= 1706779894; bh=U1FjqR7s5bFqm8GS18nzdTVauer0sNpIFPXy2/XWQyI=; b=T KljV3p78LuaU7RMm77It12MH1gttAgo2qN+cG8F0rjuR8zvN+K29E5Og41qkX/6U TQZaS7/r5fp8OhHXGLNEZ2U2qJasbAVMgITXZs6BRICkoS+ofGUgv0t8CiRUvJ9y K2BTyqaNR37GXtJBeZlPVMDxhXNy7NCaDjX3TdmU1kQunvmfa+rbqI2zH0oRzs3O VttVWcCxHvqtz+b4GiInxYQscEz6PThyIw4GI5UPrbevIorONbFXxSVWrfGws/OD xzEO8NzKEy81FyTS5QnmzSIJvNvq9gn7DLQAYK/L/mr2Wh3mhruIS3eOffznGIao 2rcaseZZbspxmH+kcoTfg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedtledgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueeigfffueektdfgteeuuefgtedvueehgfehleefheel jeelfeffjedttdekvdejnecuffhomhgrihhnpehpohhsthhgrhdrvghspdgvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 31 Jan 2024 04:31:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1706693489; bh=kkpWrhbt6ylOyj1eB36TCOhSqtE01fHPqxX1Rc261p0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=DuJHQKFgdwNnNuaPv+hTP1QiX7/B08TwKw6SZlpOqitJo4lC5SdbMUqlm6suMvNB4 FwFXkZEpDpTyo0ruqxEOlLyvEXlejRh7Fk90/vgG829eR9dCY5yShGeVKk7gc/Je6l jKQj1XQRKhVAmBD8o9PIYdju0Dnd6FMYyqCnowJpMOUHHG8nvRletqDVk+NKtwB63O Cby7ZwIryCHvweZT6ujwGyccsomSlwci1ZnmuCLKwa5avIIzPrHXob2+W5BDhGLo3p CQIvVYuIJn4M0EyjJ3sF36CPG9RfSEt6jM/aDmKWS4xoRBBuOqo3SJffdsNlsZMT1U 4x/sYvyH7gJ6w== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id E7BE68B; Wed, 31 Jan 2024 10:31:29 +0100 (CET) Date: Wed, 31 Jan 2024 10:31:29 +0100 From: Alvaro Herrera To: Bharath Rupireddy Cc: Jeff Davis , Andres Freund , Dilip Kumar , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org, Nathan Bossart , Masahiko Sawada Subject: Re: Improve WALRead() to suck data directly from WAL buffers when possible Message-ID: <202401310931.omdobqqbkcll@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Looking at 0003, where an XXX comment is added about taking a spinlock to read LogwrtResult, I suspect the answer is probably not, because it is likely to slow down the other uses of LogwrtResult. But I wonder if a better path forward would be to base further work on my older uncommitted patch to make LogwrtResult use atomics. With that, you wouldn't have to block others in order to read the value. I last posted that patch in [1] in case you're curious. [1] https://postgr.es/m/20220728065920.oleu2jzsatchakfj@alvherre.pgsql The reason I abandoned that patch is that the performance problem that I was fixing no longer existed -- it was fixed in a different way. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "In fact, the basic problem with Perl 5's subroutines is that they're not crufty enough, so the cruft leaks out into user-defined code instead, by the Conservation of Cruft Principle." (Larry Wall, Apocalypse 6)