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 1s4TTz-004KqR-Nm for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 22:40:23 +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 1s4TTx-005fcX-8c for pgsql-hackers@arkaria.postgresql.org; Tue, 07 May 2024 22:40:22 +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 1s4TTw-005fbz-VW for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 22:40:21 +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 1s4TTv-0024IT-9r for pgsql-hackers@lists.postgresql.org; Tue, 07 May 2024 22:40:21 +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 447MeG3I276517; Tue, 7 May 2024 18:40:16 -0400 From: Tom Lane To: David Rowley cc: Andrew Dunstan , Richard Guo , 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> Comments: In-reply-to David Rowley message dated "Wed, 08 May 2024 10:35:42 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <276515.1715121616.1@sss.pgh.pa.us> Date: Tue, 07 May 2024 18:40:16 -0400 Message-ID: <276516.1715121616@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Wed, 8 May 2024 at 06:20, Tom Lane wrote: >> I find that Richard's proposed fix makes the core regression tests >> pass, but we still fail check-world. So I'm afraid we need something >> more aggressive, like the attached which makes make_restrictinfo >> copy all its input bitmapsets. Without that, we still have sharing >> of bitmapsets across different RestrictInfos, which seems pretty >> scary given what we now see about the effects of 00b41463c. This >> seems annoyingly expensive, but maybe there's little choice? > We could make the policy copy-on-modify. If you put bms_copy around > the bms_del_member() calls in remove_rel_from_query(), does it pass > then? Didn't test, but that route seems awfully invasive and fragile: how will we find all the places to modify, or ensure that the policy is followed by future patches? regards, tom lane