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 1r0Nwa-005LUH-NO for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Nov 2023 15:24:44 +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 1r0NwZ-009AS2-41 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Nov 2023 15:24: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 1r0NwY-009ARq-Qh for pgsql-hackers@lists.postgresql.org; Tue, 07 Nov 2023 15:24:42 +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 1r0NwS-005C8l-GF for pgsql-hackers@lists.postgresql.org; Tue, 07 Nov 2023 15:24: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 3A7FOWKC122452; Tue, 7 Nov 2023 10:24:32 -0500 From: Tom Lane To: Alvaro Herrera cc: Ashutosh Bapat , PostgreSQL Hackers Subject: Re: Relids instead of Bitmapset * in plannode.h In-reply-to: <202311071106.6y7b2ascqjlz@alvherre.pgsql> References: <202311071106.6y7b2ascqjlz@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 07 Nov 2023 12:06:28 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <122450.1699370672.1@sss.pgh.pa.us> Date: Tue, 07 Nov 2023 10:24:32 -0500 Message-ID: <122451.1699370672@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > On 2023-Oct-31, Ashutosh Bapat wrote: >> For some reason plannode.h has declared variable to hold RTIs as >> Bitmapset * instead of Relids like other places. Here's patch to fix >> it. This is superficial change as Relids is typedefed to Bitmapset *. >> Build succeeds for me and also make check passes. > I think the reason for having done it this way, was mostly to avoid > including pathnodes.h in plannodes.h. Yes, I'm pretty sure that's exactly the reason, and I'm strongly against the initially-proposed patch. The include footprint of pathnodes.h would be greatly expanded, for no real benefit. Among other things, that fuzzes the distinction between planner modules and non-planner modules. > While looking at it, I noticed that tcopprot.h includes both plannodes.h > and parsenodes.h, but there's no reason to include the latter (or at > least headerscheck doesn't complain after removing it), so I propose to > remove it, per 0001 here. 0001 is ok, except check #include alphabetization. > I also noticed while looking that I messed up in commit 7103ebb7aae8 > ("Add support for MERGE SQL command") on this point, because I added > #include parsenodes.h to plannodes.h. This is because MergeAction, > which is in parsenodes.h, is also needed by some executor code. But the > real way to fix that is to define that struct in primnodes.h. 0002 does > that. (I'm forced to also move enum OverridingKind there, which is a > bit annoying.) This seems OK. It seems to me that parsenodes.h has been required by plannodes.h for a long time, but if we can decouple them, all the better. > 0003 here is your patch, which I include because of conflicts with my > 0002. Still don't like it. > ... I would be more at ease if we didn't have to include > parsenodes.h in pathnodes.h, though, but that looks more difficult to > achieve. Yeah, that dependency has been there a long time too. I'm not too fussed by dependencies on parsenodes.h, because anything involved with either planning or execution will certainly be looking at query trees too. But I don't want to add dependencies that tie planning and execution together. regards, tom lane