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 1lnUgK-0002Zv-6z for pgsql-hackers@arkaria.postgresql.org; Sun, 30 May 2021 23:17:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lnUgH-0005D9-Tw for pgsql-hackers@arkaria.postgresql.org; Sun, 30 May 2021 23:17:17 +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 1lnUgH-0005D1-MJ for pgsql-hackers@lists.postgresql.org; Sun, 30 May 2021 23:17:17 +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 1lnUgF-0001fZ-I3 for pgsql-hackers@postgresql.org; Sun, 30 May 2021 23:17:17 +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 14UNHBdk2433406; Sun, 30 May 2021 19:17:11 -0400 From: Tom Lane To: Andres Freund cc: Tomas Vondra , PostgreSQL-development Subject: Re: postgres_fdw batching vs. (re)creating the tuple slots In-reply-to: <20210530212616.5k5nxnbunwnwet2a@alap3.anarazel.de> References: <20210530205831.vib4p7mt23cymhpc@alap3.anarazel.de> <2399204.1622409059@sss.pgh.pa.us> <20210530212616.5k5nxnbunwnwet2a@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sun, 30 May 2021 14:26:16 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2433404.1622416631.1@sss.pgh.pa.us> Date: Sun, 30 May 2021 19:17:11 -0400 Message-ID: <2433405.1622416631@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2021-05-30 17:10:59 -0400, Tom Lane wrote: >> But it does seem like the hashing scheme somebody added to resowners >> is a bit too simplistic. It ought to be able to cope with lots of >> refs to the same object, or at least not be extra-awful for that case. > It's not really the hashing that's the problem, right? The array > representation would have nearly the same problem, I think? ResourceArrayAdd would have zero problem. ResourceArrayRemove is O(1) as long as resources are removed in reverse order ... which is effectively true if they're all the same resource. So while I've not tested, I believe that this particular case would have no issue at all with the old resowner implementation, stupid though that was. > It doesn't seem trivial to improve it without making resowner.c's > representation a good bit more complicated. Dunno, I have not studied the new version at all. regards, tom lane