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 1s55Me-0034FS-NB for pgsql-hackers@arkaria.postgresql.org; Thu, 09 May 2024 15:07:20 +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 1s55Mc-008Cgh-Nf for pgsql-hackers@arkaria.postgresql.org; Thu, 09 May 2024 15:07:19 +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 1s55Mc-008CgY-E3 for pgsql-hackers@lists.postgresql.org; Thu, 09 May 2024 15:07:18 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s55MW-000BwW-76 for pgsql-hackers@lists.postgresql.org; Thu, 09 May 2024 15:07:17 +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 449F78ld1185950; Thu, 9 May 2024 11:07:08 -0400 From: Tom Lane To: Richard Guo cc: David Rowley , Andrew Dunstan , jian he , PostgreSQL Hackers Subject: Re: Revert: Remove useless self-joins *and* -DREALLOCATE_BITMAPSETS make server crash, regress test fail. In-reply-to: References: <1e6ca7b3-98e6-46b2-9982-97f92c7523d8@dunslane.net> <76910.1715106055@sss.pgh.pa.us> <276516.1715121616@sss.pgh.pa.us> <279607.1715122556@sss.pgh.pa.us> <282081.1715123889@sss.pgh.pa.us> <815049.1715192644@sss.pgh.pa.us> <936562.1715208033@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Thu, 09 May 2024 10:43:31 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1185948.1715267228.1@sss.pgh.pa.us> Date: Thu, 09 May 2024 11:07:08 -0400 Message-ID: <1185949.1715267228@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > I also think it seems better to do bms_copy in separate steps, not only > because this keeps consistent with the existing code in > remove_rel_from_restrictinfo, but also because we need to do > bms_del_member twice for each lefthand/righthand relid set. Yeah. Of course, we don't need a bms_copy() in the second one, but that'd just add even more asymmetry and chance for confusion. > Speaking of consistency, do you think it would improve the code's > readability if we rearrange the code in remove_rel_from_query so that > the modifications of the same relid set are grouped together, just like > what we do in remove_rel_from_restrictinfo? I left it alone, just because it didn't seem worth cluttering "git blame" here. regards, tom lane