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 1rMzyI-008PNx-Sp for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Jan 2024 00:28:00 +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 1rMzyH-008VSE-A0 for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Jan 2024 00:27:57 +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 1rMzyG-008VS6-TA for pgsql-bugs@lists.postgresql.org; Tue, 09 Jan 2024 00:27:57 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rMzyC-000YdP-Ci for pgsql-bugs@lists.postgresql.org; Tue, 09 Jan 2024 00:27:55 +0000 Received: from [192.168.1.34] (cm-27-145-180-125.revip12.asianet.co.th [27.145.180.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id D3C9FE20E5B; Tue, 9 Jan 2024 03:27:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1704760070; bh=EloshMQ10tWTQB3zgd9soLOrnjN9ZOqnLJlvi9cHDcU=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=ZndKybAu31JMF/xef1PnzmB4waXv2IZVq+qX3DtNpE5NBuftZR5FcY3FHJgYL8Eze 9NxoYO8muhAvaJvAFv4JKUkSDaX7vDdtiUW5P1D/QhrK0NfCfCWuJ2b6QBVW78PNkp Q+9ppMaeW/gBNmiCd1eSazHo1bVQsJC85M+gfQB1s3tNV+maSZtj/gU3n8RgLuszDk yW8Dy7gNbqszxBqIYnIE2aRftkKArSnKM/UWckl6rPrvxOhuZE0boSdMJG0OyRDODQ /wZq8qN/Ddz7zB+l+AcxPnLvOJ3k+1jQ4WUbh34jTLlOpWrs4IWOpuI2q9iRTkjTli amVmLO3UNA+gw== Message-ID: <8fe2d19a-9c96-459d-871d-e8ec780e8927@postgrespro.ru> Date: Tue, 9 Jan 2024 07:27:45 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18261: Inconsistent results of SELECT affected by joined subqueries To: Richard Guo Cc: Alexander Korotkov , Tom Lane , zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org References: <18261-2a75d748c928609b@postgresql.org> <2887250.1703781175@sss.pgh.pa.us> Content-Language: en-US From: Andrei Lepikhov Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/1/2024 18:50, Richard Guo wrote: > > On Fri, Jan 5, 2024 at 11:32 AM Andrei Lepikhov > > wrote: > > The regression test shows where two fully equal join clauses, > applied on > different join levels, differ by the only required_relids. It covers > the > problem and can be helpful by itself. IMO, one line in this test is > redundant (see attachment). > > > Hmm, I don't think the insert statement in the test case is redundant. > It's needed to verify that the query in the test case gives the correct > result.  Without the insert statement, the wrong plan would give the > same result as the correct plan, i.e., an empty set in this case. > > IMO, if we make some code changes and add a test case for that, we need > to ensure the test can give a different (and correct of course) result > than what came before. Maybe. I personally support explain by an execution result if the code is related to executor and couldn't be detected by the form of query plan. But why not? anyway, Alexander already committed that. -- regards, Andrei Lepikhov Postgres Professional