Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJgzH-0005Ab-I1 for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2017 14:35:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eJgzG-00079D-SV for pgsql-general@arkaria.postgresql.org; Tue, 28 Nov 2017 14:35:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eJgzG-000792-KG for pgsql-general@lists.postgresql.org; Tue, 28 Nov 2017 14:35:50 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eJgz4-00037R-Ov for pgsql-general@postgresql.org; Tue, 28 Nov 2017 14:35:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vASEZXX1013951; Tue, 28 Nov 2017 09:35:33 -0500 From: Tom Lane To: "Peter J. Holzer" cc: pgsql-general@postgresql.org Subject: Re: Plan for update ... where a is not distinct from b In-reply-to: <20171128085016.ia7x25ty5krlykeh@hjp.at> References: <20171128085016.ia7x25ty5krlykeh@hjp.at> Comments: In-reply-to "Peter J. Holzer" message dated "Tue, 28 Nov 2017 09:50:16 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13949.1511879733.1@sss.pgh.pa.us> Date: Tue, 28 Nov 2017 09:35:33 -0500 Message-ID: <13950.1511879733@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Peter J. Holzer" writes: > I noticed that an update was taking a long time and found this: > [ crappy plan for join on IS NOT DISTINCT ] Yeah, there's no optimization smarts at all for IS [NOT] DISTINCT. It can't be converted into a merge qual, nor a hash qual, nor an indexscan qual. In principle this could be improved, but given how much work it'd be and how seldom anyone complains, it's not likely to happen anytime soon. regards, tom lane