From: Tom Lane <tgl@sss.pgh.pa.us>
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
Date: Thu, 25 May 2023 15:20:25 -0400
Message-ID: <1562856.1685042425@sss.pgh.pa.us> (raw)
In-Reply-To: <17944-299d21e4e9e90eda@postgresql.org>
References: <17944-299d21e4e9e90eda@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, ajeesh2705@gmail.com, 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: <1562856.1685042425@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox