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 1rpCnd-005ael-Gd for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Mar 2024 19:49:33 +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 1rpCnc-004VXN-Cx for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Mar 2024 19:49:32 +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 1rpCnc-004VVV-2S for pgsql-hackers@lists.postgresql.org; Tue, 26 Mar 2024 19:49:32 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rpCnZ-006dU7-98 for pgsql-hackers@lists.postgresql.org; Tue, 26 Mar 2024 19:49:31 +0000 Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-7d0262036afso232871639f.3 for ; Tue, 26 Mar 2024 12:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711482568; x=1712087368; 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=BFa7SZhyr6knbJhQGoapmTzQpkfp0AkrA3FQ87Emh9o=; b=SQXS8YWfHgkdoDGMavKpLkLk7bfgcU+qhb92xDoOdcB0pi/j38xb/rl5cVuCd/Givk wfJT63z188DXdUnZ2j9WScaJYfS5s4L7KuvG4A+Z6Ml2Lw9KfXxClCudZMCWZa/NmN1c 5Qx3NvXk47EU3ktQtlvwODW6ee28LTkH/q/1gu9MVTsFp881izUMQIzueCFxIWXgMCHJ P4ghrTge404sjHtu/fu2k03b+tWNParCzjeyjbF/RBkENY+zHcr0kppqmjVF2XIucBcq hepadpTRMifCt2lPSkEUH+LCvyBg05P5fhE8IZK6cuZRZVQ/nOR1ABj9s3lZuwJ04uhB eZ5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711482568; x=1712087368; 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=BFa7SZhyr6knbJhQGoapmTzQpkfp0AkrA3FQ87Emh9o=; b=ufZPi91Ken2kOtkeGxgQm90NG6ENVG0cxil81OOO+aZgInautTTE/dF2Qn8pLv7mB1 tyyzQ/XF959PBQKMOfSTWcNx9kyLX3fkUZM/RGk2SrAeP/6EXfCNBmni5DryExTGnkmo 4lKQhlCmnPpobGw/sFk/FNWwQ38jdxBlQNn1fNtGUr4vGpJUbIQB4rWOTL4qqrgGdQb1 ZjOjCKDunciZvmVNa/Y/kMjZFkHkTW42D1w7Q0Bq2cOgQ8S8naMTjWhH/sCl4DiNZIPU QFp0d3XXK3KQ8cVjrEZxXiRbnsjiqsJ5LpSGLtjVbH53ATK8vSB1XTNvu7c/2wH67Iau oN3w== X-Gm-Message-State: AOJu0YyTQVEOkrWg0nyH62UEvnYiBjXNl+Xre8wch+LqL6eJIhYuEU9Z qcVvpwWdttOOINShPM0x7Bms/+T4hlms1uu1TSkWntgLi43F3Rj7 X-Google-Smtp-Source: AGHT+IGCsQY+d9+sCgSicockxMmLmnsqB5E7/ASQRu8T5BrQkpSZY0wvBpp+upYfLkXhjztqVtZvRA== X-Received: by 2002:a05:6602:4f11:b0:7c8:bbdc:ebed with SMTP id gl17-20020a0566024f1100b007c8bbdcebedmr11624446iob.6.1711482567780; Tue, 26 Mar 2024 12:49:27 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id h16-20020a02c4d0000000b00476e44d5a4csm2844417jaj.43.2024.03.26.12.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 12:49:27 -0700 (PDT) Date: Tue, 26 Mar 2024 14:49:25 -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: <20240326194925.GB3701353@nathanxps13> References: <20240322165448.GA2350322@nathanxps13> <20240322193506.GA2352051@nathanxps13> <1084642.1711140109@sss.pgh.pa.us> <20240325144743.GA2618709@nathanxps13> <2490242.1711379319@sss.pgh.pa.us> <20240325151647.GA2662364@nathanxps13> <20240326165918.GA3350222@nathanxps13> <2999167.1711476963@sss.pgh.pa.us> <20240326184819.GA3559028@nathanxps13> <3088176.1711480080@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3088176.1711480080@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Mar 26, 2024 at 03:08:00PM -0400, Tom Lane wrote: > My one remaining suggestion is that this comment isn't very precise > about what's happening: > > * If there is a previously-created Bloom filter, use it to determine > * whether the role is missing from the list. Otherwise, do an ordinary > * linear search through the existing role list. > > Maybe more like > > * If there is a previously-created Bloom filter, use it to try to > * determine whether the role is missing from the list. If it > * says yes, that's a hard fact and we can go ahead and add the > * role. If it says no, that's only probabilistic and we'd better > * search the list. Without a filter, we must always do an ordinary > * linear search through the existing list. > > LGTM other than that nit. Committed with that change. Thanks for the guidance on this one. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com