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 1oKMKR-0001os-Ea for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Aug 2022 16:07:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oKMKP-0006n0-Gc for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Aug 2022 16:07:05 +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 1oKMKP-0006XU-6W for pgsql-hackers@lists.postgresql.org; Sat, 06 Aug 2022 16:07:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oKMKK-00066h-PP for pgsql-hackers@lists.postgresql.org; Sat, 06 Aug 2022 16:07:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 276G6iPn102027; Sat, 6 Aug 2022 12:06:44 -0400 From: Tom Lane To: Dilip Kumar cc: Andres Freund , Justin Pryzby , Robert Haas , Ashutosh Sharma , Maciek Sakrejda , Bruce Momjian , Alvaro Herrera , Andrew Dunstan , Heikki Linnakangas , PostgreSQL Hackers Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints In-reply-to: References: <20220802175043.GA13682@telsasoft.com> <2767668.1659476794@sss.pgh.pa.us> <20220802220416.GC13682@telsasoft.com> <20220802222334.umf5wsa2r63koppn@awork3.anarazel.de> <20220804212932.xyxzeprxvcnukg7o@awork3.anarazel.de> Comments: In-reply-to Dilip Kumar message dated "Fri, 05 Aug 2022 12:32:39 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <102025.1659802004.1@sss.pgh.pa.us> Date: Sat, 06 Aug 2022 12:06:44 -0400 Message-ID: <102026.1659802004@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dilip Kumar writes: > On Fri, Aug 5, 2022 at 10:43 AM Dilip Kumar wrote: >> Yeah maybe it is not necessary to close as these unowned smgr will >> automatically get closed on the transaction end. I do not think this is a great idea for the per-relation smgrs created during RelationCopyStorageUsingBuffer. Yeah, they'll be mopped up at transaction end, but that doesn't mean that creating possibly tens of thousands of transient smgrs isn't going to cause performance issues. I think RelationCopyStorageUsingBuffer needs to open and then close the smgrs it uses, which means that ReadBufferWithoutRelcache is not the appropriate API for it to use, either; need to go down another level. regards, tom lane