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 1ourux-0008Mm-J5 for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Nov 2022 09:07:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ouruw-0001r6-4G for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Nov 2022 09:07:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ouruv-0001qv-R6 for pgsql-hackers@lists.postgresql.org; Tue, 15 Nov 2022 09:07:41 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ourut-0004NJ-8E for pgsql-hackers@lists.postgresql.org; Tue, 15 Nov 2022 09:07:40 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 4D9F23200916; Tue, 15 Nov 2022 04:07:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 15 Nov 2022 04:07:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1668503255; x=1668589655; bh=W q7cMA4F8HQk62FefcSqlpxfqiuyVtiA9SGAlapiIco=; b=IOk4Y3Ow3HImg3Ecm AaSE3S8WE5Pn24V54iFBczBluoh/KCmesvkXZh/6j7nfOLClPyfomWHCLyVzSxY0 TRGAaGf1EACnvriaIqRZcyNdxrSA8r7dGDMcA+AuEgt9HJnkfmnXzB9izxM62N26 02cmTSJMsvoUUShvbN+4a05WOABFcq5y6YKTIuXSV8KwxJZEgvCxbgLvDmsb9W3X tRfxoi08d1z0kLFwSjAK/S0TDza/wkaslGP+zdlHgvL8KQLXydWc7fK85SIixORo A08YGsWGW13es+ugxsIRvfglt4Nk3UoDacApr4pmH+Crdoavb56uYfVQwsrSrLp6 zThYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgeegucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh epfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgrrhhoucfj vghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecugg ftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeekfffgudff hfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhr vgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Nov 2022 04:07:35 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id C13DC39C; Tue, 15 Nov 2022 10:07:33 +0100 (CET) Date: Tue, 15 Nov 2022 10:07:33 +0100 From: Alvaro Herrera To: Tom Lane Cc: Amit Langote , Richard Guo , David Rowley , Greg Stark , Julien Rouhaud , PostgreSQL Hackers Subject: Re: List of Bitmapset (was Re: ExecRTCheckPerms() and many prunable partitions) Message-ID: <20221115090733.htje4ogq27djdt5e@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <892228.1668437838@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Nov-14, Tom Lane wrote: > For discussion's sake, here's my current version of that 0004 patch, > rewritten to use list-of-bitmapset as the data structure. I feel that there should be more commentary that explains what a multi-bms is. Not sure where, maybe just put it near the function that first appears in the file. > * The multi_bms prefix is a bit wordy, so I was thinking of shortening > the function names to mbms_xxx. Maybe that's too brief. I don't think the "ulti_" bytes add a lot, and short names are better. Either you know what a mbms is, or you don't. If the latter, then you jump to one of these functions in order to find out what the data structure is; after that, you can read the code and it should be clear enough. > * This is a pretty short list of functions so far. I'm not eager > to build out a bunch of dead code though. Is it OK to leave it > with just this much functionality until someone needs more? I agree with not adding dead code. > * I'm a little hesitant about whether the API actually should be > List-of-Bitmapset, or some dedicated struct as I had in the previous > version of 0004. This version is way less invasive in prepjointree.c > than that was, but the reason is there's ambiguity about what the > forced_null_vars Lists actually contain, which feels error-prone. Hmm ... if somebody makes a mistake, does the functionality break in obvious ways, or is it very hard to pinpoint what happened? > +/* > + * multi_bms_add_member > + * Add a new member to a list of bitmapsets. > + * > + * This is like bms_add_member, but for lists of bitmapsets. > + * The new member is identified by the zero-based index of the List > + * element it should go into, and the bit number to be set therein. > + */ > +List * > +multi_bms_add_member(List *mbms, int index1, int index2) Maybe s/index1/listidx/ or bitmapidx and s/index2/bitnr/ ? -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "La rebeldía es la virtud original del hombre" (Arthur Schopenhauer)