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 1oxDUT-00065O-CG for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Nov 2022 20:34:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oxDUQ-0005kZ-UI for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Nov 2022 20:34:02 +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 1oxDUQ-0005kQ-Kz for pgsql-hackers@lists.postgresql.org; Mon, 21 Nov 2022 20:34:02 +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 1oxDUK-0001A7-FN for pgsql-hackers@lists.postgresql.org; Mon, 21 Nov 2022 20:34: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 2ALKXp5I3267210; Mon, 21 Nov 2022 15:33:51 -0500 From: Tom Lane To: Andres Freund cc: Robert Haas , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Prevent instability in contrib/pageinspect's regression test. In-reply-to: <20221121201818.u32xtvpqc5wd6tx7@alap3.anarazel.de> References: <20221121172206.h6kywxrzqcmhoqom@awork3.anarazel.de> <3214376.1669051457@sss.pgh.pa.us> <3215927.1669052115@sss.pgh.pa.us> <20221121195628.2rlqpbkjgjsvqn6w@alap3.anarazel.de> <3264594.1669061535@sss.pgh.pa.us> <20221121201818.u32xtvpqc5wd6tx7@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 21 Nov 2022 12:18:18 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3267208.1669062831.1@sss.pgh.pa.us> Date: Mon, 21 Nov 2022 15:33:51 -0500 Message-ID: <3267209.1669062831@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-11-21 15:12:15 -0500, Tom Lane wrote: >> If I were trying to find a better fix I'd be looking for ways for >> parallel workers to be able to read the parent's temp tables. >> (Perhaps that could tie in with the blue-sky discussion we had >> the other day about allowing autovacuum on temp tables??) > That'd be a nontrivial change, because we explicitly don't use any > locking for anything relating to localbuf.c. One possible benefit could > be that we could substantially reduce the code duplication between > "normal" bufmgr.c and localbuf.c. I didn't say this was easy ;-). Aside from locking, the local buffers are inside the process's address space and not accessible from outside. Maybe they could be mapped into a shared memory region instead? And there are optimizations like commit a7212be8b that depend on the assumption that nothing else is accessing our process's temp tables. That'd need a lot of thought, if we don't want to give up all the performance benefits of temp tables. regards, tom lane