Re: BUG #13464: Optimizer fails to use partial index on boolean when selected via "IS" operator.

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13464: Optimizer fails to use partial index on boolean when selected via "IS" operator.
Date: 2015-06-24 01:27:05
Message-ID: CADkLM=dm8UBb+_5ujDWgq1TtxucMZiH_hDLRMRpbOCr9kGLesQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Good to know. And yes, according to
http://www.postgresql.org/docs/9.4/static/functions-comparison.html IS TRUE
will never return null even if y is null.

I can't, however think of a case where the the partial index would lead to
an incorrect answer. Can you enlighten me?

On Tue, Jun 23, 2015 at 8:28 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> corey(dot)huinker(at)gmail(dot)com writes:
> > Correct index is used on "WHERE y" and "WHERE y = true" but not "WHERE y
> IS
> > TRUE".
>
> y IS TRUE is not actually equivalent to the other two conditions ...
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2015-06-24 03:29:08 Re: Re: windows 8 RTM compatibility issue (could not reserve shared memory region for child)
Previous Message Michael Paquier 2015-06-24 01:06:00 Re: Re: windows 8 RTM compatibility issue (could not reserve shared memory region for child)