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 1s3RuJ-00D1z8-Ay for pgsql-hackers@arkaria.postgresql.org; Sun, 05 May 2024 02:47:19 +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 1s3RtH-0041jg-9P for pgsql-hackers@arkaria.postgresql.org; Sun, 05 May 2024 02:46:16 +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 1s3RtG-0041jY-R9 for pgsql-hackers@lists.postgresql.org; Sun, 05 May 2024 02:46:15 +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 1s3RtE-001bhS-Qb for pgsql-hackers@lists.postgresql.org; Sun, 05 May 2024 02:46:14 +0000 Received: from [192.168.1.101] (unknown [103.206.205.199]) (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 71255E20E90; Sun, 5 May 2024 05:46:07 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1714877171; bh=5o+ie7/TWYRMEp3xZcZXOrdvfaIAony8vUsoaGtUfB0=; h=Message-ID:Date:User-Agent:From:Subject:To:Cc:References: In-Reply-To:From; b=xOAe1S/VpqXBMxu8cvgdy1Qm/9N5vHHbTlkJr4Q5lV5JVzSDQWX07vEWD97OBwo8u gLgupFblJmEXmCErQHwphU0cb6liuvXoermpGSLIK9X1la8hRriC4hjHYyl8Nkg0Hh nsKWOOy52QaLJBasVPDRMIMcVYoTvsiJko+z8AcAoQluKo4JGqi+GVpfVLoviKDYNS HjAy8FKZ/ypGciJlI2Tph07zZ8My2G+ti5FUktdCNpcrtl5OcBcWh3oHFIEF01omtT tkfwqmJMBpCa/R63wwQiP30dE1OM4lCcY1HsQgtABiEJKFOlK/i5+52j4H7I5hQytL dszoj5GOOmCKw== Message-ID: <24e93efd-eeac-43a6-a75a-ad68eacb32ee@postgrespro.ru> Date: Sun, 5 May 2024 09:45:47 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Andrei Lepikhov Subject: Re: Removing unneeded self joins To: Robert Haas , Alexander Korotkov Cc: Tom Lane , Richard Guo , Alexander Lakhin , "Gregory Stark (as CFM)" , =?UTF-8?Q?Micha=C5=82_K=C5=82eczek?= , PostgreSQL Hackers References: <64486b0b-0404-e39e-322d-0801154901f3@postgrespro.ru> <1bd80083-a13e-4e9f-a7ce-73c3faab521c@postgrespro.ru> <922623af-872e-4cdc-9238-129b18bee42d@postgrespro.ru> <0ed2cf02-e655-6ec7-a4fe-52fd8d572f65@gmail.com> <735b5cd4-568d-fbf7-ad8c-dcfb4c3af86e@gmail.com> <2422119.1714691974@sss.pgh.pa.us> Content-Language: en-US Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2024/05/04 23:44:00 #25091022 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/5/2024 20:55, Robert Haas wrote: > One of my most embarrassing gaffes in this area personally was > a448e49bcbe40fb72e1ed85af910dd216d45bad8. I don't know how I managed > to commit the original patch without realizing it was going to cause > an increase in the WAL size, but I can tell you that when I realized > it, my heart sank through the floor. I discovered this feature and agree that it looks like a severe problem. Unfortunately, in the case of the SJE patch, the committer and reviewers don't provide negative feedback. We see the only (I'm not sure I use the proper English phrase) 'negative feelings' from people who haven't reviewed or analysed it at all (at least, they didn't mention it). Considering the situation, I suggest setting the default value of enable_self_join_removal to false in PG17 for added safety and then changing it to true in early PG18. Having no objective negative feedback, we have no reason to change anything in the design or any part of the code. It looks regrettable and unusual. After designing the feature, fixing its bugs, and reviewing joint patches on the commitfest, the question more likely lies in the planner design. For example, I wonder if anyone here knows why exactly the optimiser makes a copy of the whole query subtree in some places. Another example is PlannerInfo. Can we really control all the consequences of introducing, let's say, a new JoinDomain entity? You also mentioned 2024.pgconf.dev. Considering the current migration policy in some countries, it would be better to work through the online presence as equivalent to offline. Without an online part of the conference, the only way to communicate and discuss is through this mailing list. -- regards, Andrei Lepikhov