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 1rom5J-003HzP-UM for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2024 15:18:02 +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 1rom5I-004mDG-C7 for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Mar 2024 15:18:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rom4F-004gyC-Ts for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2024 15:16:56 +0000 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rom49-006Lyf-F2 for pgsql-hackers@lists.postgresql.org; Mon, 25 Mar 2024 15:16:55 +0000 Received: by mail-io1-xd2d.google.com with SMTP id ca18e2360f4ac-7cc692af9ebso181984439f.0 for ; Mon, 25 Mar 2024 08:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711379810; x=1711984610; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=8ObqKOcil4DgPcfkl6x+QeyR3+UO7L4fURwAu0kuqcQ=; b=Vqs1WzdRx+sEeNd5MNPtYL9d2dEh9O5DlOAFTdlpt4F2VaHR33LQ2F4V6ZHZTvM5lU vpPF81IOCJVPCp5Xq9rcu+c2ZvuoDvmQKgw4D+aZjXE9e2caot2UMLYcN0eyOSMAuALy 91KmyUk1fgRAIODOAjh4de3TlnUUsMQjPr7LssFT68VJcGnlEJnRDySRCPxJvfTqnv5I H4rEpc9jjLI5+LGFXq7vKF4JXd/rrjKVXkNCtWBBtk4FBCXicTZYLQfZrBDcYwqAYyBt FXfHYiVXv04sr2xba3kX480LE2TuddiEnp9Fi0Qwvj866hc30Hr7sLsavmM4KMWmLWN7 qwhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711379810; x=1711984610; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8ObqKOcil4DgPcfkl6x+QeyR3+UO7L4fURwAu0kuqcQ=; b=OBa0PyFq6gIuTdSijwPsrD/w0Foe7zswqkMijZ0XSg3qo+lZQfS0YJvsZ3Nm70f8EV 97mAoPfkoyqV7ezm86P3jx3tGNIpR40tz5HM847Vce1XbUOt2gYqkTDQk9wcHWB78n1p sswBRkNYj1Roo+CB5k3xq6xzRVW++u3+G4XcsQ/sDOigFUPoy2viSX+hSBOWaZ8lxbYc b7FVwH32NrfNOSwS0LWgg3vzYuji1P+iN5HbDiUq1Ul95/OSQjxFrlJj1C+mH5gq7J5X y78oPL3gJkyS9++wy0Hj2AlSbQ6fN/yJ8t3nyd3j4M6phoPrOaUPmBrrbFJjujIIT9cM J2XA== X-Gm-Message-State: AOJu0Yyv2VOJ60N7n7ahrTB2e0zoic9B0d/oIFY3PTiGPFDsX1YKM52O Oa45o5PxKCYRIOrSa1BO9RWJ/dw7oCkCDJD4z2k4SCjUS2fKwsZb X-Google-Smtp-Source: AGHT+IGzApIIzDDD8ASWP4ghrNf0FgFmBZ8/b5j0sdayDvPr8JRz3MI1eUTjAHicdydALeRcZ2/sRA== X-Received: by 2002:a6b:f902:0:b0:7cc:556:975a with SMTP id j2-20020a6bf902000000b007cc0556975amr8165785iog.8.1711379809888; Mon, 25 Mar 2024 08:16:49 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id r14-20020a056638100e00b0047d69cc97d1sm101625jab.40.2024.03.25.08.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 08:16:49 -0700 (PDT) Date: Mon, 25 Mar 2024 10:16:47 -0500 From: Nathan Bossart To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, alex work , Robert Haas Subject: Re: Slow GRANT ROLE on PostgreSQL 16 with thousands of ROLEs Message-ID: <20240325151647.GA2662364@nathanxps13> References: <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> <2490242.1711379319@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2490242.1711379319@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 25, 2024 at 11:08:39AM -0400, Tom Lane wrote: > * 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. I'll try to construct a couple of tests to see if we can determine a proper order of magnitude. > * Code needs more than zero comments. Yup. > * Is it worth trying to make a subroutine, or at least a macro, > so as not to have 2 copies of the code? I think so. I'll try that in the next version. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com