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 1q2GVk-0007iZ-4C for pgsql-bugs@arkaria.postgresql.org; Thu, 25 May 2023 19:20:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2GVi-0007ky-Is for pgsql-bugs@arkaria.postgresql.org; Thu, 25 May 2023 19: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 1q2GVi-0007ik-AY for pgsql-bugs@lists.postgresql.org; Thu, 25 May 2023 19:20:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q2GVf-0027Zk-B1 for pgsql-bugs@lists.postgresql.org; Thu, 25 May 2023 19:20:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 34PJKPic1562857; Thu, 25 May 2023 15:20:25 -0400 From: Tom Lane To: ajeesh2705@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17944: Partial index on boolean field is not picked when using = while the index is created with is In-reply-to: <17944-299d21e4e9e90eda@postgresql.org> References: <17944-299d21e4e9e90eda@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 25 May 2023 14:04:39 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1562855.1685042425.1@sss.pgh.pa.us> Date: Thu, 25 May 2023 15:20:25 -0400 Message-ID: <1562856.1685042425@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > I have recently created a partial index on tables like following > create index unprocessed_order_index > on order (creation_date) where processed is false; > When I am querying the table using processed = false like below, the index > is not used > I was expecting to treat both = and is same, or am I wrong IS and = are not the same. You could argue that they have the same effect in this particular case, but there's no logic in the planner that would deduce that. regards, tom lane