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 1rItJi-00Ao8E-Jo for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Dec 2023 16:33:06 +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 1rItJh-00HWRY-B2 for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Dec 2023 16:33:05 +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 1rItJh-00HWQX-2D for pgsql-bugs@lists.postgresql.org; Thu, 28 Dec 2023 16:33:05 +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 1rItJe-00EKqP-1d for pgsql-bugs@lists.postgresql.org; Thu, 28 Dec 2023 16:33:04 +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 3BSGWtNZ2887251; Thu, 28 Dec 2023 11:32:55 -0500 From: Tom Lane To: Richard Guo cc: zuming.jiang@inf.ethz.ch, Alexander Korotkov , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18261: Inconsistent results of SELECT affected by joined subqueries In-reply-to: References: <18261-2a75d748c928609b@postgresql.org> Comments: In-reply-to Richard Guo message dated "Thu, 28 Dec 2023 19:01:47 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2887249.1703781175.1@sss.pgh.pa.us> Date: Thu, 28 Dec 2023 11:32:55 -0500 Message-ID: <2887250.1703781175@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > I've looked into it a bit. The problem lies in how the SJE code handles > the transfer of qual clauses from the removed relation to the remaining > one. I am definitely starting to think that the SJE patch was not ready for prime time. We keep finding not only minor but major problems in it --- I'd call this one a "major" one. Is it time to revert and rethink it from scratch? > If we determine that avoiding duplicates is necessary, I think at least > we should compare the entire RestrictInfos not just their clauses. One > challenge with this approach is that the 'rinfo_serial' usually differs, > making direct comparison problematic. I'm wondering if we can make > 'rinfo_serial' equal_ignore. Not too sure about that. I'd say that that will break the cases rinfo_serial was introduced for. Now, I certainly don't love rinfo_serial and would be happier if we could do without it, but getting rid of it is another research project. regards, tom lane