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 1rolwK-003HBp-NH for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2024 15:08:45 +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 1rolwJ-004Y38-BW for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2024 15:08:43 +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 1rolwJ-004Y0S-1j for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2024 15:08:43 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rolwH-006Q5Y-1x for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2024 15:08:42 +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 42PF8doH2490243; Mon, 25 Mar 2024 11:08:39 -0400 From: Tom Lane To: Nathan Bossart cc: pgsql-hackers@lists.postgresql.org, alex work , Robert Haas Subject: Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs In-reply-to: <20240325144743.GA2618709@nathanxps13> References: <20240322005139.GA2060816@nathanxps13> <806361.1711069194@sss.pgh.pa.us> <20240322144739.GA2321246@nathanxps13> <20240322145532.GA2346110@nathanxps13> <907785.1711121266@sss.pgh.pa.us> <20240322163952.GA2347986@nathanxps13> <939945.1711126395@sss.pgh.pa.us> <20240322165448.GA2350322@nathanxps13> <20240322193506.GA2352051@nathanxps13> <1084642.1711140109@sss.pgh.pa.us> <20240325144743.GA2618709@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Mon, 25 Mar 2024 09:47:43 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2490241.1711379319.1@sss.pgh.pa.us> Date: Mon, 25 Mar 2024 11:08:39 -0400 Message-ID: <2490242.1711379319@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > Are there any changes you'd like to see for the Bloom patch [0]? I'd like > to see about getting that committed for v17. One thing that crossed my > mind is creating a combined list/filter that transparently created a filter > when necessary (for reuse elsewhere), but I'm not sure that's v17 material. Yeah, that thought occurred to me too, but I think we ought to have a few more use-cases in view before trying to write an API. As for the patch, I agree it could go into v17, but I think there is still a little bit of work to do: * The magic constants (crossover list length and bloom filter size) need some testing to see if there are better values. They should probably be made into named #defines, too. I suspect, with little proof, that the bloom filter size isn't particularly critical --- but I know we pulled the crossover of 1000 out of thin air, and I have no certainty that it's even within an order of magnitude of being a good choice. * Code needs more than zero comments. * Is it worth trying to make a subroutine, or at least a macro, so as not to have 2 copies of the code? regards, tom lane