Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2Dze-0003Jm-Nj for pgsql-performance@arkaria.postgresql.org; Fri, 08 Mar 2019 11:48:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h2Dzd-00076l-E2 for pgsql-performance@arkaria.postgresql.org; Fri, 08 Mar 2019 11:48:49 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2Dwg-0007HO-SD for pgsql-performance@lists.postgresql.org; Fri, 08 Mar 2019 11:45:46 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h2Dwf-0005zU-8H for pgsql-performance@lists.postgresql.org; Fri, 08 Mar 2019 11:45:46 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id B5C4C4C439; Fri, 8 Mar 2019 12:45:43 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id cHTgfFna5uJG; Fri, 8 Mar 2019 12:45:40 +0100 (CET) Message-ID: <9d4c7b0de250db9aef716600ca6e39652738ff4e.camel@cybertec.at> Subject: Re: IS NOT DISTINCT FROM statement From: Laurenz Albe To: Artur =?UTF-8?Q?Zaj=C4=85c?= , pgsql-performance@lists.postgresql.org Date: Fri, 08 Mar 2019 12:45:39 +0100 In-Reply-To: <012a01d4d5a2$5cde0760$169a1620$@ang.com.pl> References: <012a01d4d5a2$5cde0760$169a1620$@ang.com.pl> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Artur Zając wrote: > Is there any reason that „NOT DISTINCT FROM” can’t be autotransformed to „=” when value > on right side of expression is not NULL or is this any way to use index with „IS NOT DISTINCT FROM” statement? That would subtly change the semantics of the expression: test=> SELECT NULL IS NOT DISTINCT FROM 21580; ?column? ---------- f (1 row) test=> SELECT NULL = 21580; ?column? ---------- (1 row) One expression is FALSE, the other NULL. It doesn't matter in the context of your specific query, but it could matter. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com