Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyp7o-0000eZ-K6 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jul 2021 05:20:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyp7m-0006FY-Eg for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Jul 2021 05:20:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lyp7m-0006FQ-2o for pgsql-hackers@lists.postgresql.org; Thu, 01 Jul 2021 05:20:30 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lyp7j-0003Oi-5C for pgsql-hackers@lists.postgresql.org; Thu, 01 Jul 2021 05:20:29 +0000 Received: from Andreys-MacBook-Pro.local (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id CB60321C879E; Thu, 1 Jul 2021 08:20:24 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1625116825; bh=IkZrfohO2WeMHtZJww57BVvHpxXFTUmNDQaJUP88zwI=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=HPMeGrO246qlMp9+hBEVhpkc5vCxZMhFYdyeanMphpdIk2zbD0c1aYPnnZsEQgeji dA331leL9t1VC+kttH0JJH/H+gGxcRN/OZhwJixmrgGrni+UuEL8C3Jo2SSXMbytt+ YHUZ9/l9EyEgLvZUYcqU9YruEecvuAJAKIiJ41Z0= Subject: Re: Removing unneeded self joins To: Laurenz Albe , Hywel Carver , pgsql-hackers@lists.postgresql.org Cc: Konstantin Knizhnik References: <64486b0b-0404-e39e-322d-0801154901f3@postgrespro.ru> <21e15759-dba5-2d2b-dd03-06943ad40378@postgrespro.ru> <161553990603.28624.7702383984090736980.pgcf@coridan.postgresql.org> <2a6e540a-4c9f-9402-2e02-71e35fcd4dd1@postgrespro.ru> From: Andrey Lepikhov Organization: Postgres Professional Message-ID: <1b4b177a-ef90-d3b9-59b2-5cec182f0efb@postgrespro.ru> Date: Thu, 1 Jul 2021 08:20:24 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 30/6/21 18:55, Laurenz Albe wrote: > On Wed, 2021-06-30 at 14:21 +0300, Andrey Lepikhov wrote: >> I think, here we could ask more general question: do we want to remove a >> 'IS NOT NULL' clause from the clause list if the rest of the list >> implicitly implies it? > Generally I have the impression that we are not too keen on spending > planning time on optimizing cases that can be trivially improved by rewriting > the query. Thank you, It's strong argument. Such feature would look better as a part of an enterprise edition. -- regards, Andrey Lepikhov Postgres Professional