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 1rvMQy-00BUag-H3 for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2024 19:19:37 +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 1rvMQx-00HJMT-CO for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Apr 2024 19:19:35 +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 1rvMQx-00HJML-2W for pgsql-hackers@lists.postgresql.org; Fri, 12 Apr 2024 19:19:35 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rvMQu-002YEc-Kf for pgsql-hackers@lists.postgresql.org; Fri, 12 Apr 2024 19:19:33 +0000 Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-36a133ff27eso7926285ab.1 for ; Fri, 12 Apr 2024 12:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712949571; x=1713554371; 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=6vq/BRZMuOeSJgxSZvtZWsl5nPF80hQvfPl2D1wn/g4=; b=HinUxP9K5fqCSdM9DbpQTAeAHFWADGbiiOqEE7asbPb5rdleauQ2Azvh/DUEG5dGE0 Oqzrsg5J7L/0UJw+aj0F4C7uQEnUbCLQwCb4b8l1FR++h2cX4HhGkRnO/SMfJb5rpkKY YczXE1sgKGBAOGhNfMpd8fnFx9C8/UJbE+KPDBph3+vtt5Scb1uiRIsEDVhbCsFx7svs YrOhnskw6FH5oNI15R+UzCNEXEcp9hw0JOo9AuGpkB8uW3LkQ88Zmlfi2yiKVr2Hqb+c EKtU4XM5bmi/v0ZjWc186nxgfT5tN1NBGlRXsa7Oje43B2E9hs0QDknYS35q91stkqzV Know== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712949571; x=1713554371; 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=6vq/BRZMuOeSJgxSZvtZWsl5nPF80hQvfPl2D1wn/g4=; b=MgqCpi+soTPSv0J9DBxJbGG8PKT5MiGOcoZO6S8kAEThhzzZnqFc6kGEP8oS24HN7/ SK8+dIHlpxkI5+LG/g/NUGhJLg68pOrSczCXQrC4WzFr76lcCSuZbLny+YLGVggJyXAG 7sYCROGyeQveGv6hbC6rl4aKomE8kZaJH4guzsMyjweMPKWB3FEpAjsXEQzDDcU/T0Ym 4lxFq5XcV5ZBCWFoEsUvnpTm8gRHDR0JfJ9cA1z2czL/6vb0ypEze0FkORZHqML7EuQe IAn2lhxjejwbCrbDl5AflQsUOCRzyEYD5gCauBDwaVnqJ2sD/RklXbKGts8tExK5X+W8 eq1w== X-Gm-Message-State: AOJu0Yx7pc48l2MpZkOh5YTYKUXOiYXrdMQv+tPHaEdLxkIwFjiMByY5 3T6+K4VWJn9j/fMdK84i6aOok8JKgvG100SEOXiUYIr9BMZ0Upc5 X-Google-Smtp-Source: AGHT+IEz7CokBA6Hhc8LrCRzLU5xDFRpRXHsB+w1ZZ3BP+gACXP/R3C0dBXqm9mKEgZ1C+6u88NBVQ== X-Received: by 2002:a05:6e02:1b09:b0:36a:c6d9:7a9c with SMTP id i9-20020a056e021b0900b0036ac6d97a9cmr2878705ilv.2.1712949571472; Fri, 12 Apr 2024 12:19:31 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id n16-20020a056638265000b004829fa50273sm1222979jat.161.2024.04.12.12.19.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 12:19:30 -0700 (PDT) Date: Fri, 12 Apr 2024 14:19:28 -0500 From: Nathan Bossart To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, alex work , Robert Haas Subject: Re: further improving roles_is_member_of() Message-ID: <20240412191928.GA2519977@nathanxps13> References: <20240412041633.GA2315447@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240412041633.GA2315447@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Apr 11, 2024 at 11:16:33PM -0500, Nathan Bossart wrote: > As shown in the attached work-in-progress patch, this actually ends up > removing more code than it adds, and it seems to provide similar results to > HEAD (using the benchmark from the previous thread [0]). I intend to test > it with many more roles to see if it's better in more extreme cases. Even with 100K roles, the Bloom filter added in commit d365ae7 seems to do a pretty good job at keeping up with the hash table approach. The callers of roles_is_member_of() that do list_member_oid() on the returned list might benefit a little from a hash table, but I'm skeptical it makes much difference in practice. This was an interesting test, but I'll likely withdraw this patch shortly. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com