Re: BUG #17944: Partial index on boolean field is not picked when using = while the index is created with is

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ajeesh2705(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17944: Partial index on boolean field is not picked when using = while the index is created with is
Date: 2023-05-25 19:20:25
Message-ID: 1562856.1685042425@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-05-25 19:33:40 Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG
Previous Message Devrim Gündüz 2023-05-25 17:24:00 Re: llvmjit.so: undefined symbol: LLVMBuildGEP Fedora 38