From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ajeesh2705@gmail.com
Subject: BUG #17944: Partial index on boolean field is not picked when using = while the index is created with is
Date: Thu, 25 May 2023 14:04:39 +0000
Message-ID: <17944-299d21e4e9e90eda@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17944
Logged by: Ajeesh Sasidharan
Email address: ajeesh2705@gmail.com
PostgreSQL version: 13.8
Operating system: Linux
Description:
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
SELECT count(*) from order where processed = false and creation_date <
now()
but the index is used while querying using processed is false
SELECT count(*) from order where processed is false and creation_date <
now()
I was expecting to treat both = and is same, or am I wrong
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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, ajeesh2705@gmail.com
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>
* 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